SlideShare a Scribd company logo
B.Tech III Sem ‘A’
DATABASE MANAGEMENT SYSTEMS
Entities: University Database Table
 Books
 Types
 Authors
 Students
 Borrows
Attributes
Authors
Authorid
Name
Surname
Books
Bookid
Name
Pagecount
sem
Authorid
typeid
Borrows
Borrowid
Studentid
Bookid
Takendate
Broughtdate
Students
Studentid
Name
Surname
Birthdate
Gender
Class
sem
Types
Typeid
Name
BooksTypes
Authors
Students
Borrows
Category
Issued to
Lending
Authored
by
Authorid
name
surname
namebookid
borrowwid
studnetid
name
typeid
studentid name
surnamebirthdate
gender
bookid
takendate
Broughtdate
pagec
ount
sem
authorid typeid
Table definitions
Authors
Authorid Int ; Primary key
Name Varchar(30)
Surname Varchar(20)
Books
Bookid Int; Primary Key
title Varchar(40)
Pagecount Int
sem Int
Authorid Int
typeid Int
Types
Typeid Int; PK
Name Varchar(20)
Table definitions
Borrows
Borrowid Int; Primary key
Studentid Int
Bookid Int
Takendate Date
Broughtdate Date
Students
Studentid Int; Primary key
Name Varchar(30)
Surname Varchar(30)
Birthdate Date
Gender Varchar(6)
Class Varchar(5)
sem int
Commands to be executed
1. Create Tables authors, books, borrows, students, types
2. Describe the list of column definitions for the tables created
3. Insert values into the tables
authors (10 records); books (20 records);
types (10 records);
borrows (20 records);
students (30 records);
Queries on Library Database
4. List the books where page count is greater than 100
 Select * from books where pagecount > 100
5. List the books where pagecount is between 50 and 100
 Select * from books where pageCount between 50 and 100;
6. List all the male from class 3A or 3B
 Select * from students where (class = '3A' or class = '3B')
and gender='M'
Queries on Library Database
7. List the unique class from students
Select distinct class from students;
8. List the total number of Male and Females in each
class
Select class,gender,count(*) as StudentCount from
students group by gender,class;
Queries on Library Database
9. List only the total number of females in each class
 Select class,gender,count(*) as StudentCount from
students where gender = 'F' group by gender,class;
10. List the book with the most page number
 Select * from books where pageCount=(Select
max(pageCount) from books)

More Related Content

PPTX
Lis 457 power point - moreau.docx
PPTX
Csc303 part1 chap1
PPT
Linking KOS Data [using SKOS and OWL2]
PPTX
The library website
PPT
Authority Control
PPTX
Library Resources for EN4271
PPTX
.dissertationforum.org
PPT
Classification 1207530467697071 9
Lis 457 power point - moreau.docx
Csc303 part1 chap1
Linking KOS Data [using SKOS and OWL2]
The library website
Authority Control
Library Resources for EN4271
.dissertationforum.org
Classification 1207530467697071 9

What's hot (9)

PPT
Academic Search Engines
PPT
Authority
PPT
INformation LIteracy - Module 3
PPT
How to Use WorldCat
PPT
Information Literacy - Module 2
PPT
TxLOR Origins
PPT
finding info for film industry
DOC
Rda seminar syllabus
PPT
State Library of Pennsylvania Cataloging PALA 2009
Academic Search Engines
Authority
INformation LIteracy - Module 3
How to Use WorldCat
Information Literacy - Module 2
TxLOR Origins
finding info for film industry
Rda seminar syllabus
State Library of Pennsylvania Cataloging PALA 2009
Ad

More from Sreedhar Chowdam (20)

PDF
DBMS Nested & Sub Queries Set operations
PDF
DBMS Notes selection projection aggregate
PDF
Database management systems Lecture Notes
PPT
Advanced Data Structures & Algorithm Analysi
PDF
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
PPTX
Design and Analysis of Algorithms Lecture Notes
PDF
Design and Analysis of Algorithms (Knapsack Problem)
PDF
DCCN Network Layer congestion control TCP
PDF
Data Communication and Computer Networks
PDF
DCCN Unit 1.pdf
PDF
Data Communication & Computer Networks
PDF
PPS Notes Unit 5.pdf
PDF
PPS Arrays Matrix operations
PDF
Programming for Problem Solving
PDF
Big Data Analytics Part2
PDF
Python Programming: Lists, Modules, Exceptions
PDF
Python Programming by Dr. C. Sreedhar.pdf
PDF
Python Programming Strings
PDF
Python Programming
PDF
Python Programming
DBMS Nested & Sub Queries Set operations
DBMS Notes selection projection aggregate
Database management systems Lecture Notes
Advanced Data Structures & Algorithm Analysi
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms (Knapsack Problem)
DCCN Network Layer congestion control TCP
Data Communication and Computer Networks
DCCN Unit 1.pdf
Data Communication & Computer Networks
PPS Notes Unit 5.pdf
PPS Arrays Matrix operations
Programming for Problem Solving
Big Data Analytics Part2
Python Programming: Lists, Modules, Exceptions
Python Programming by Dr. C. Sreedhar.pdf
Python Programming Strings
Python Programming
Python Programming
Ad

Recently uploaded (20)

PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPT
Mechanical Engineering MATERIALS Selection
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
PPT on Performance Review to get promotions
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Geodesy 1.pptx...............................................
PDF
composite construction of structures.pdf
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
additive manufacturing of ss316l using mig welding
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Well-logging-methods_new................
PPTX
Construction Project Organization Group 2.pptx
PPTX
Internet of Things (IOT) - A guide to understanding
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Mechanical Engineering MATERIALS Selection
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Fundamentals of safety and accident prevention -final (1).pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PPT on Performance Review to get promotions
Operating System & Kernel Study Guide-1 - converted.pdf
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Geodesy 1.pptx...............................................
composite construction of structures.pdf
R24 SURVEYING LAB MANUAL for civil enggi
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
additive manufacturing of ss316l using mig welding
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Well-logging-methods_new................
Construction Project Organization Group 2.pptx
Internet of Things (IOT) - A guide to understanding

Dbms university library database