0% found this document useful (0 votes)
28 views22 pages

Final Course Pack - DBMS - 11.08.2024

Uploaded by

aryag5640
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views22 pages

Final Course Pack - DBMS - 11.08.2024

Uploaded by

aryag5640
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

COURSEPACK

FRAMEWORK

The Course Pack is a comprehensive and complete pedagogical guideline document that describes
the components of instruction delivery by a faculty member. It consists of the scheme of the course,
Course Overview, Course Objectives, Prerequisite course, Program-specific Outcomes (PSOs),
Course outcomes (COs), Bloom’s taxonomy (Knowledge Levels), Types of Courses, Course
articulation matrix, Course assessment patterns, Course content, Lesson Plan, Bibliography,
Problem-based learning/case-studies/clinical, and Student-Centered learning (self- learning
towards life-long-learning). It not only provides a uniform design of Course delivery across the
University but also ensures freedom and flexibility to introduce innovations in learning and teaching
and create vivid kinds of assessment tools (alternate assessment tools) by a faculty member.
The course pack is developed by the faculty member teaching a course. If more than one faculty
teaches the same course, all the faculty members teaching thecourse shall be formed as a cluster,
and a senior faculty member (Course-lead)lead the Course delivery design in a team effort. The
Course Pack provides ample scope and opportunity to bring innovations in teaching pedagogies
in aschool/department.
Hence, the Course pack is a comprehensive learning-teaching strategy framework to be followed by
all the faculty members in schools/departments in the university. It is not only a tool for measuring
the learning of a class but also analyses the achievement levels (learning outcomes of the course)
of all the students in a class in a continuous manner.

: for internal circulation 2


COURSEPACK
SCHEME

Course Title Database Management System Course Type Integrated


Course Code E2UC302B Class B.Tech
Activity Credits Credit Hours Total Number of Assessment in
Classes per Semester Weightage
Lecture 3 3
Instruction

Practical
Practical
Tutorial 0 0

Tutorial
Theory
delivery

study
Self-

SEE
CIE
Practical 1 2
Self-study 0 7
Total 4 12 45 0 30 105 50% 50%
Course Lead Mr. Manikant Panthi Course Mr. Arunendra Mani Tripathi
Coordinator
Names Course Theory/ Practical Theory/ Practical
Instructors Mr. Tarun Kumar
Dr. T. Ganesh Kumar
Mr. Yashwant Soni
Dr. Aditya Kishore Saxena
Mr. P Selvaraj
Dr. Arvind Panwar
Mr. Hradesh Kumar
Dr. Sunil Kumar
Mr. Sugan Patel
Mr. A. Boobalan
Mr. Mahesh Kumar
Mr. Arunendra Mani Tripathi
Mr. Adarsh Kumar
Mr. Brajmohan Singh
Mr. Salman Khursheed Ahmad
Mr. Amit Yadav
Mr. Ankit Sharma
Ms. Indervati
Ms. Geeta Gayatri Behera
Ms. Kirti
Mr. Shiv Kumar Madeshwaran
Mr. M Umapathy
Mr. Rochak Swami
Ms. Manu Singh
Mr. Sandeep Kumar
Ms. Namrata Kumari
Mr. Satheesh Kumar
Mr. Nand Kumar Jyotish
Mr. Sheo Kumar
Ms. Nidhi Sharma
Ms. Sonia Kukreja
Mr. Rishav Raj
Mr. Soumalya Ghosh
Mr.Manikant Panthi
Ms. suman devi
Mr. Sundara Kumar
Ms. Swati Sharma
COURSEPACK
FRAMEWORK

COURSE OVERVIEW
This course introduces the core principles and techniques required to design and implement database systems. This course
focuses on relational database management systems, including database design theory: E-R modeling, data definition, and
manipulation languages, database security, and administration. It also covers essential DBMS concepts such as Transaction
Processing, Concurrency Control, and Recovery, various types of databases like distributed databases and, Client/Server.
Students undertake a semester mini project to design and build a simple database system and demonstrate competence with
the fundamental tasks involved with modeling, designing, and implementing a DBMS. It also provides students with
theoretical knowledge and practical skills using MySQL tool in the use of databases and database management systems in
information technology applications

PREREQUISITE COURSE
PREREQUISITE COURSE No
REQUIRED
If, yes please fill in the Details Prerequisite Prerequisite
course code course name
NA NA

COURSE OBJECTIVE

1. Students will familiar with basic concepts of databases and database management systems.
2. Students are able to understanding of design the entity relationship diagram the and concept of database.
3. Students are able to normalize various type of database system.
4. Students to explore and implement all the schemas on the SQL.

COURSE OUTCOMES (COs)


After the completion of the course, the student will be able to:

CO No. Course Outcomes

Conceptual understanding of DBMS, ability to define and manipulate data,


CO1 understanding data independence, and the overall structure of databases.

Ability to design and query relational databases using SQL, ensure data integrity, and
CO2 apply relational algebra and calculus concepts in practical scenarios.

Apply database Normalization techniques up to BCNF for the removal of anomalies.


CO3
Ability to manage and ensure the consistency of transactions, implement concurrency
CO4 control mechanisms, recover from transaction failures.
PROGRAM OUTCOMES (POs):

PO1 Computing Science knowledge: Apply the knowledge of mathematics,


statistics, computing science and information science fundamentals to the solution
of complex computerapplication problems.
Problem analysis: Identify, formulate, review research literature, and analyze
PO2
complex computing science problems reaching substantiated conclusions using
first principles of mathematics, natural sciences, and computer sciences.
Design/development of solutions: Design solutions for complex computing
PO3
problems and design system components or processes that meet the specified
needs with appropriate consideration for the public health and safety, and the
cultural, societal, and environmental considerations.
Conduct investigations of complex problems: Use research-based knowledge and
PO4 research methods includingdesign of experiments, analysis and interpretation of data,
and synthesis of the information to provide valid conclusions.
Modern tool usage: Create, select, and apply appropriate techniques, resources, and
PO5 modern computing science and IT tools including prediction and modeling to complex
computing activities with an understanding of the limitations.
IT specialist and society: Apply reasoning informed by the contextual
PO6
knowledge to assess societal, health, safety, legal and cultural issues and the
consequent responsibilities relevant to the professional computing science and
information science practice.
Environment and sustainability: Understand the impact of the professional
PO7
computing science solutions in societal and environmental contexts, and
demonstrate the knowledge of, and need for sustainable development.
Ethics: Apply ethical principles and commit to professional ethics and
PO8
responsibilities and norms of the computing science practice.
Individual and team work: Function effectively as an individual, and as a
PO9
member or leader in diverse teams, and in multidisciplinary settings.
PO10 Communication: Communicate effectively on complex engineering activities with
the IT analyst community and with society at large, such as, being able to comprehend
and write effective reports and design documentation, make effective presentations,
and give and receive clear instructions.
Project management and finance: Demonstrate knowledge and understanding
PO11 of the computing science and management principles and apply these to one’s
own work, as a member and leader in a team, to manage projects and in
multidisciplinary environments.
Life-long learning: Recognize the need for, and have the preparation and ability
PO12
to engage in independent and life-long learning in the broadest context of
technological change.
COURSEPACK
FRAMEWORK

PROGRAMME SPECIFIC OUTCOME (PSO):

The students of Computer Science and Engineering shall:


PSO1: Have the ability to work with emerging technologies in computing requisite to Industry 4.0.

PSO2: Demonstrate Engineering Practice learned through industry internship and research project to solve live
problems in various domains

BLOOM’S LEVEL OF THE COURSE OUTCOMES


INTEGRATED

Remember Understand Apply Analyse Evaluate Create


CO No.
BTL1 BTL2 BTL3 BTL4 BTL2 BTL6
√ √
CO1
√ √
CO2

CO3

CO4

PROGRAM OUTCOMES (POs): AS DEFINED BY CONCERNED THE APEX BODIES

COURSE ARTICULATIONMATRIX
PSO1

PSO2
PO10

PO11

PO12
PO1

PO2

PO3

PO4

PO5

PO6

PO7

PO8

PO9

COs#/POs

CO1 3 2 1 1 1

CO2 3 2 2 2 2 1

2 3 2 2 2 2 2
CO3
CO4 1 2 1 2 2 1

Note: 1-Low, 2-Medium, 3-High


COURSE CONTENT

THEORY:

Introduction to Data Base management system: An overview of the database management system,
database system Vs file system, Database system concept and architecture, data model schema and
instances, data independence and database language and interfaces, data definitions language, Data
modeling using Entity Relationship (ER) model , Enhanced ER model, Overall Database Structure.

Domains, Relations and Keys: domains, relations, kind of relations, relational database, various types of
keys, candidate, primary, alternate and foreign keys. Relational Data Model and Language: Relational
data model concepts, integrity constraints, entity integrity, referential integrity, Key constraints, Domain
constraints, relational algebra, relational calculus, tuple, and domain calculus.

Introduction to SQL, DDL, DML and DCL, Types of SQL commands. SQL operators and their
procedures. Tables, views, and indexes. Queries and subqueries. Aggregate functions. Insert, update, and
delete operations, Joins, Unions, Intersection, Minus, Cursors, and Triggers. Database Design &
Normalization: Functional dependencies, normal forms, first, second, and third normal forms,
Normalization-Decomposition into BCNF.

Transaction Processing Concept: Transaction system, testing of serializability, serializability of schedules,


conflict & view serializable schedule, recoverability, Recovery from transaction failures, log-based
recovery. Concurrency Control Techniques: Concurrency control, Locking Techniques for concurrency
control, Time stamping protocols for concurrency control, validation-based protocol. Recovery with
concurrent transactions.

PRACTICAL: Case Studies and Practical problem, Real-world Examples of data base Implementations.
COURSEPACK
FRAMEWORK

LESSON PLAN FOR COMPREHENSIVE COURSES


FOR THEORY 15 weeks * 3 Hours = 45 Classes) (1credit = 1Lecture Hour)
FOR PRACTICAL 15 weeks * 2Hours = 30 Hours lab sessions (1 credit = 2 lab hours)

L. No. Topics for Delivery Theory / Skills Competency


Tutorial /
Practical
Plan
1 Overview of the database management Theory
system Describe the
working of SQL CO1
2 Database system Vs file system Theory with different
clauses &
designing keys &
3 Database system concept and architecture Theory constraints.

4 Data model schema and instances Theory

5 Data independence Theory CO1

6 Database language and interfaces

7 Data definitions language Theory


8 Data modeling using Entity Relationship Theory Ability to gain RDBMS
(ER) model knowledge and SQL
9 Enhanced ER model Theory queries

10 DDL, DML, DCL Theory CO1

11 Overall Database Structure Theory

12 Domains, Relations and Keys: domains, Theory


relations, kind of relations, relational
database
13 Various types of keys, candidate, primary, Theory
alternate and foreign keys
14 RDBMS concepts, Integrity constraints, Theory

15 Entity integrity, referential integrity Theory CO2

16 Keys constraints, Domain constraints Theory

17 Relational algebra Theory

Competence to
18 Relational calculus Theory formulate Relational
Algebra & Relational
19 Characteristics of SQL, advantages of SQL Theory Calculus queries

20 SQL data type and literals. Types of SQL Theory


commands
21 SQL operators and their procedure Theory

22 Tables, views, and indexes. Theory


23 Aggregate functions Theory
Describe the
24 Insert, update, and delete operations Theory working of SQL
with different
25 Joins, Unions, Intersection, Minus Theory clauses &
CO3
designing keys &
constraints.
26 Cursors, Triggers Theory

27 Functional dependencies Theory

28 Normal forms, first & second Theory Applying DB design


concepts using
Dependencies, Lossless
29 Normal forms, Third & BCNF Theory design, and CO3
COURSEPACK
FRAMEWORK
30 Transaction system Theory understanding the
basics of Transaction
31 Testing of serializability Theory processing

32 serializability of schedules Theory

33 conflict & view serializable schedule Theory


Classify and
34 Recoverability Theory performing
Recoverability &
35 Recovery from transaction failures Theory deadlocks tests in
transactions
36 Log-based recovery Theory

37 Concurrency Control Techniques Theory

38 Locking Techniques for concurrency Theory


control
39 Time stamping protocols for concurrency Theory
control CO4
40 Validation-based protocol. Theory

41 Recovery with concurrent transactions Theory

42 Revision: Ability to identify the data Theory


models for relevant problems.
43 Revision: Ability to solve RDBMS and Theory
SQL queries relevant problems.
44 Revision: Ability to formulate Advanced Theory
SQL queries and understand the basics of
Normalization.
45 Revision: Ability to Classify and Theory
performing Recoverability & deadlocks
tests in transactions.
LAB PLAN FOR THEORY COURSES (15 weeks * 2 Hours = 30 Classes)

1 L Draw an E-R diagram and convert entities and relationships to a relation table for a
given scenario. (Two assignments shall be carried out i.e., consider two different scenarios (e.g. bank,
College)

2 L Implementation of DDL commands of SQL with suitable examples.


Create a table named Books with the following columns:
Book ID (Primary Key, Integer)
Title (Variable Character, 200 characters) Author (Variable Character, 100 characters)
Published Date (Date) ISBN (Variable Character, 13 characters)
Alter the Books table to add a column named Genre (Variable Character, 50 characters).
Modify the ISBN column to increase its length to 20 characters.
Drop the Published Date column from the Books table.
Drop the Books table from the database.

3 L Implementation of DML commands of SQL with suitable examples.


You are managing a database for a bookstore. Implement the following tasks:
Insert the following data into a table named Books with columns BookID, Title, Author, PublishedDate,
ISBN, and Price.
Data:
(1, 'The Great Gatsby', 'F. Scott Fitzgerald', '1925-04-10', '9780743273565', 10.99)
(2, '1984', 'George Orwell', '1949-06-08', '9780451524935', 9.99)
Update the Books table to change the Price of the book with Book ID 1 to 12.99.
Delete the book with Book ID 2 from the Books table.
4 L Implementation of different types of operators in SQL.You have two tables Products and Sales. Implement
the following tasks using various operators:

1. Find all products with a price greater than 100.


2. List all sales that happened in the year 2023.
3. Find all products whose name contains the word 'Pro'.
4. Combine the lists of products and sales to find all unique product names and sale items.
5. Find the total revenue generated from sales, assuming each sale has a quantity and price.

5 L Implementation of different types of operators in SQL.

6 L Perform the following:


a. Creating Tables (With and Without Constraints (Key/Domain)
b. Creating Tables (With Referential Integrity Constraints)

7 L For a given set of relation schemes, create tables and perform the following Queries:
a. Simple Queries
b. Queries with Aggregate functions (Max/Min/Sum/Avg/Count)
c. Queries with Aggregate functions (group by and having clause)
d. Queries involving- Date Functions, String Functions, Math Functions
COURSEPACK
FRAMEWORK
8 L For a given set of relation schemes, create tables and perform the following Queries:
a. Inner Join
b. Outer Join
c. Natural Join
9 L . For a given set of related tables perform the following: -
a. Creating Views
b. Dropping views
c. Selecting from a view
10 L Implementation of Group by & Having Clause, Order by Clause, Indexing.

11 L Given the table EMPLOYEE (EmpNo, Name, Salary, Designation, DeptID) write a
cursor to select the five highest-paid employees from the table.

12 L For a given set of related tables perform the following:


a. Begin Transactions
b. End Transaction

13 L For a given set of related tables perform the following:


a. Create roles
b. Assign Privileges
c. Revoke Privileges
14 L Perform the following: Inserting/Updating/Deleting Records in a Table, Saving (Commit) and Undoing
(rollback)

BIBLIOGRAPHY

Text Book

1. Henry F Korth, Abraham Silberschatz, S. Sudarshan, “Database system concepts”, McGraw- Hill
2. Date C J, “An Introduction to Database Systems”, Addison Wesley

Reference Books

1. Elmasri, Navathe, “Fundamentals of Database Systems”, Addison Wesley


2. O’Neil, Databases, Elsevier Pub.
3. Leon & Leon,” Database Management Systems”, Vikas Publishing House
4. Bipin C. Desai, “An Introduction to Database Systems”, Gagotia Publications
5. Majumdar & Bhattacharya, “Database Management System”, TMH (14)
6. Ramakrishnan, Gehrke, “Database Management System”, McGraw Hill
PRACTICE PROBLEMS

S. Problem based
No Learning
1 Draw an ER diagram for the Hospital database. Be sure to indicate the various attributes of each entity
and relationship set; also specify the key and participation constraints for each relationship set. Specify
any necessary overlap and cover constraints as well.
2 Consider the instance of the sample Students' relation.
1. Give an example of an attribute (or set of attributes) that you can deduce is not a candidate key, based
on this instance being legal.
2. Is there any example of an attribute (or set of attributes) that you can deduce is a candidate key, based
on this instance being legal?
3 Consider the relations between Students, Faculty, Courses, Rooms, Enrolled, Teaches, and Meets.
1. List all the foreign key constraints among these relations.
2. Give an example of a constraint involving one or more of these relations that is not a primary key or
foreign key constraint.
4 Write SQL for the following relational schema:
Emp(eid: integer, ename: string, age: integer, salary: real)
Works(eid: integer, did: integer, pct time: integer)
Dept(did: integer, dname: string, budget: real, managerid: integer)
5 Suppose that we have a ternary relationship R between entities sets A, B, and C such that A has a key
constraint and total participation and B has a key constraint; these are the only constraints. A has
attributes a1 and a2, with a1 being the key; B and C are similar. R has no descriptive attributes. Write
SQL statements that create tables corresponding to this information to capture as many of the constraints
as possible. If you cannot capture some constraint, explain why?
6 Consider the following relations containing airline flight information:
Flights (flno: integer, from: string, to: string, distance: integer, departs: time, arrives: time)
Aircraft (aid: integer, aname: string, cruisingrange: integer) Certified(eid: integer, aid: integer)
Employees (eid: integer, ename: string, salary: integer)
1. Find the eids of pilots certified for some Boeing aircraft.
2. Find the names of pilots certified for some Boeing aircraft.
3. Find the aids of all aircraft that can be used on non-stop flights from Bonn to Madras. 4. Identify the
flights that can be piloted by every pilot whose salary is more than $100,000.
5. Find the names of pilots who can operate planes with a range greater than 3,000 miles but are not
certified on any Boeing aircraft.
6. Find the eids of employees who make the highest salary.
7. Find the eids of employees who make the second highest salary.
8. Find the eids of employees who are certified for the largest number of aircraft.
9. Find the eids of employees who are certified for exactly three aircraft.
10. Find the total amount paid to employees as salaries.
7 Consider the following relational schema.
An employee can work in more than one department; the pct time field of the Works relation shows the
percentage of time that a given employee works in a given department.
Emp (eid: integer, ename: string, age: integer, salary: real)
Works (eid: integer, did: integer, pct time: integer)
Dept (did: integer, budget: real, managerid: integer)
Write the following queries in SQL:
1. Print the names and ages of each employee who works in both the Hardware department and the
COURSEPACK
FRAMEWORK
Software department.
2. For each department with more than 20 full-time-equivalent employees (i.e., where the part-time and
full-time employees add up to at least that many full-time employees), print the did together with the
number of employees that work in that department.
3. Print the name of each employee whose salary exceeds the budget of all of the departments that he or
she works in.
4. Find the managerids of managers who manage only departments with budgets greater than
$1,000,000.
5. Find the enames of managers who manage the departments with the largest budget.
8 Consider the instance of Sailors
Let us define instance S1 of Sailors to consist of the first two tuples, instance S2 to be the last two tuples,
and S to be the given instance.
(a) Show the left outer join of S with itself, with the join condition being sid=sid.
(b) Show the right outer join of S with itself, with the join condition being sid=sid.
(c) Show the full outer join of S with itself, with the join condition being sid=sid.
(d) Show the left outer join of S1 with S2, with the join condition being sid=sid.
(e) Show the right outer join of S1 with S2, with the join condition being sid=sid.
(f) Show the full outer join of S1 with S2, with the join condition being sid=sid.
9 Draw E-R diagram of following pair of entities (i)Customer & Account (ii)
Customer & Loan (iii) Doctor & Patient

10 Draw an ER diagram of the Hospital Management System.

(i) Take only 2 entities


(ii) Use all types of attributes
(iii) Use proper relationship

11 Find the minimum number of tables required for the following ER diagram in relational
model-

12 Find the minimum number of tables required to represent the given ER diagram in
relational model-
13 Write the following queries in SQL, using the university schema. (We suggest
you actually run these queries on a database, using the sample data
that we provide on the Web site of the book, db-book.com. Instructions for
setting up a database, and loading sample data, are provided on the above
Web site.)
a. Find the titles of courses in the Comp. Sci. department that have 3
credits.
b. Find the IDs of all students who were taught by an instructor named
Einstein;make sure there are no duplicates in the result.
c. Find the highest salary of any instructor.
d. Find all instructors earning the highest salary (there may be more
than one with the same salary).
e. Find the enrollment of each section that was offered in Autumn 2009.
f. Find the maximum enrollment, across all sections, in Autumn 2009.
g. Find the sections that had the maximum enrollment in Autumn 2009.
14 Write Queries for the following requirements:
(i) Find the customer names and their loan numbers for all customers having a loan at
some branches.
(ii) Find the names of all branches that have greater assets than some branch located
in Lucknow.
(iii) Find the names of all customers whose street includes the substring “main”.
(iv) List in alphabetic order the names of all customers having a loan in “Knit
Campus” branch.
(v) Find all customers who have a loan, an account, or both.
(vi) Find all customers who have both a loan and an account.
(vii) Find all customers who have an account but no loan.
(viii) Find all customers who have both an account and a loan at the same branch.

15 Write Queries for the following requirements:


(i) Find all customers who have either an account or a loan (but not both) at the bank.
(ii) Find all branches where the total account deposit is greater than the average of the
total account deposits at all branches.
(iii) Find the average account balance of those branches where the average account
balance is greater than 100000.
(iv) Account number and name of customer whose account balance is highest.
(v) Find the name of the customer with the total balance, which is most valuable.
(vi) Find all customers who have a loan at the bank but do not have an account at the
bank
(vii) Find the name of customers who have an account at all the branches located in
sultanpur.
(viii) Find the name of all customer who have an account in all branches of NEW YORK
city.
(ix) Name of branches where total customers are more than 5.
(x) Name of customers whose branch city and city of living is the same.

16 Create a Trigger on the banking database on update, insert operation.

17 Create a Trigger on the banking database on modify, delete operation.


COURSEPACK
FRAMEWORK
18 Draw an ER diagram of the Airlines Management System. Demonstrate keys, Constraints, and
relationships. Be sure to indicate the various attributes of each entity and relationship set; also specify
the key and participation constraints for each relationship set. Specify any necessary overlap and cover
constraints as well.
19 Draw an ER diagram of the Blood Bank Management System. Demonstrate keys, Constraints, and
relationships. Be sure to indicate the various attributes of each entity and relationship set; also specify
the key and participation constraints for each relationship set. Specify any necessary overlap and cover
constraints as well.
20 Suppose a relational schema R(w x y z), and set of functional dependency as followings
F : { wx yz, y w, z x }
Find the candidate keys in above relation
21 Suppose a relational schema R(a, b, c, d, e), and set of functional dependency as follows
F : { ab cd, d a, bc de }
Find the candidate keys in the above relation.
22 Suppose that we have a relation marks (ID, score) and we wish to assign grades to students based on
the score as follows: grade F if score < 40, grade C if 40 ≤ score < 60, grade B if 60 ≤ score < 80, and
grade A if 80 ≤ score. Write SQL queries to do the following:
a. Display the grade for each student, based on the mark’s relation.
b. Find the number of students with each grade
23

Consider the bank database of Figure 2, where the primary keys are underlined. Construct the
following SQL queries for this relational database.

a. Find all customers of the bank who have an account but not a loan.
b. Find the names of all customers who live on the same street and in the same city as “Smith”.
c. Find the names of all branches with customers who have an account in the bank and who live in
“Harrison”
24 Let R = (A, B, C, D, E, F) be a relation scheme with the following dependencies-

C→F

E→A

EC → D

A→B
Find Candidate keys.
25 Consider the given schedule S and check if it is view serializable or not. If yes, then give the serial
Schedule: S : S1: R1(X) R1(Y) R2(X) R2(Y) W2(Y) W1(X).
26 Write SQL TRIGGER FOR database triggers to enforce data integrity and implement business rules.
27

a. Find the total number of people who owned cars that were involved in accidents in 2009.
b. Add a new accident to the database; assume any values for required attributes.
28 Consider the database available in the previous question & perform following queries.
a. Add a column to the table car.
b. Drop the column date from table accident
c. Modify the column location as location_Info
d. Rename table owns to owner
29

Consider the library database. Write the following queries in SQL.


a) Print the names of members who have borrowed any book published by “McGraw-Hill”.
b) Print the names of members who have borrowed all books published by “McGraw-Hill”.
c) For each publisher, print the names of members who have borrowed more than five books of
that publisher.
d) Print the average number of books borrowed per member. Take into account that if an
30 Create the following Database of a Bank with following relations
Branch(Branch_name , Branch_city , Assets)
Customer(Customer_name,Customer_street,Customer_city)
Account(account_number, Branch_name, Balance)
Loan( Loan_number, Branch_name, Amount)
Depositor(account_number,Customer_name)
Borrower(Loan_number, Customer_name)
Foreign keys:
(i) In Account table Branch name is referring to Branch table
(ii) In Loan table Branch name is referring to Branch table
(iii) In the Depositor table, the account number is referring to the account table and the
customer name is referring to the customer table.
(iv)In Borrower table Loan number is referring to Loan table and customer name is referring
to customer table.
Insert data in different tables.
COURSEPACK
FRAMEWORK

STUDENT-CENTERED LEARNING (SELF-LEARNING TOWARDS LIFE-


LONG- LEARNING)

Self-Learning (it’s a typical course-based project to be carried out by a whole class in groups of four students
each; they should exhibit higher level BTLs)

The students, in a group, are expected to conceive an idea based on the content (objectives/outcomes) and apply
the suitable knowledge to demonstrate their learning.
A) SELF-LEARNING THROUGH MOOCs (Cognitive Skills):
1. Database Management System, By Prof. Partha Pratim Das & Prof. Samiran Chattopadhyay, IIT Kharagpur
https://onlinecourses.nptel.ac.in/noc20_cs60/preview

2. DML Statements and SQL Server Administration | Online | Alison


https://alison.com/topic/learn/71105/using-dml-statements-learning-outcomes

3. SQLCourse: Beginner & Advanced Interactive SQL Tutorials

4. https://academy.oracle.com/

: for internal circulation 19


COURSEPACK
FRAMEWORK

: for internal circulation 20


(Course Lead) (Program Chair) (Dean)

: for internal circulation 17

You might also like