0% found this document useful (0 votes)
32 views

DBMS (CST-227) Unit-1

This document contains 6 assignments for a Database Management Systems course. Each assignment includes questions mapped to course outcomes and relating to topics like ER modeling, relational schemas, SQL queries, and normalization. The assignments involve tasks like drawing ER diagrams, writing SQL queries, analyzing relational schemas, and applying database design concepts. The last date to submit all assignments is September 20, 2019.

Uploaded by

harshit
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)
32 views

DBMS (CST-227) Unit-1

This document contains 6 assignments for a Database Management Systems course. Each assignment includes questions mapped to course outcomes and relating to topics like ER modeling, relational schemas, SQL queries, and normalization. The assignments involve tasks like drawing ER diagrams, writing SQL queries, analyzing relational schemas, and applying database design concepts. The last date to submit all assignments is September 20, 2019.

Uploaded by

harshit
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

DBMS (CST-227)

UNIT-1

Institute/Department: AIT/CSE
Division: 3rd
Subject Name: DATABASE MANAGEMENT SYSTEM
Subject Code: CST-227

Assignment No.:1
Max. Marks: 12

Date of Allotment: 17/08/2019


Last date of Submission: 20/09/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Consider the following relational database and give an expression in CO2
relational algebra each of the following queries :
Employee (person-name, street, city)
Works (person name, company name, salary)
Company (Company name, city)
Managers (person name, manager-name)
a) Find the names of all employees who work for First Bank Corporation.
b) Find the names and cities of residences of all employees who work for
First Bank Corporation.
c) Find the names of all the employees who do not work for First Bank
Corporation.
d) Find names of all employees who earn more than $10000 per annum.
e) Find names of all employees who earn more than every employee of
Small Bank Corporation
2. Suppose (A, B) and (C, D) are two relation schemas. Let r1 and r2 be the CO1
corresponding relation instances. B is a foreign key that refers to C in r2.
If data in r1 and r2 satisfy referential integrity constraints the give the
output.

3. Consider the following relational schema. CO2


Students (roll_no: integer, sname: string)
Courses (course_no: integer, cname: string)
Registration (rollno: integer, courseno: integer, percent: real)
Which of the following queries are equivalent to this query in English?
"Find the distinct names of all students who score more than 90% in the
course numbered 107"

Assignment No.:2
Max. Marks: 12

Date of Allotment: 17/08/2019


Last date of Submission: 20/09/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Let R and S be two relations with the following schema R CO1
(P,Q,R1,R2,R3) S (P,Q,S1,S2) Where {P, Q} is the key for both
schemas. Which of the following queries are equivalent?

2. If a relation with a Schema R is decomposed into two relations R1 and R2 CO1


such that (R1 ∪ R2) = R1 then derive a relation to be satisfied for a
lossless joint decomposition (→ indicates functional dependency).
3. Consider the following relational schema. CO2
Students (roll_no: integer, sname: string)
Courses (course_no: integer, cname: string)
Registration (rollno: integer, courseno: integer, percent: real)
Which of the following queries are equivalent to this query in
English? "Find the distinct names of all students who score more than
90% in the course numbered 107"

Assignment No.:3
Max. Marks: 12

Date of Allotment: 17/08/2019


Last date of Submission:20/9/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Suppose you are given the following requirements for a simple database CO2
for the National Hockey League (NHL):
 the NHL has many teams,
 each team has a name, a city, a coach, a captain, and a set of
players,
 each player belongs to only one team,
 each player has a name, a position (such as left wing or goalie),
a skill level, and a set of injury records,
 a team captain is also a player,
 a game is played between two teams (referred to as host team
and guest team) and has a date (such as May 11th, 2017) and a
score (such as 4 to 2).
Construct a clean and concise ER diagram for the NHL database.

2. Draw E-R Diagram of Chandigarh University by elaborating at least the CO1


engineering wing along with the administrative offices.

3. Following database is given: CO2

Sr. No. Name Address

1 ABC Chandigarh

2 DEF Ludhiana

3 GHI Mohali

4 GHI Mohali

If only the last row is to be deleted, write the query for the same.

Assignment No.:4
Max. Marks: 12

Date of Allotment: 17/08/2019


Last date of Submission:20/9/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. CO1

Convert the ER model into a relational Schema.

2. How does Tuple-oriented relational calculus differ from domain- CO1


oriented relational calculus?

3. Information about a collection of students is given by the relation CO1


studinfo(studId, name, sex). The relation enroll(studId, courseId) gives
which student has enrolled for (or taken) that course(s). Assume that
every course is taken by at least one male and at least one female student.
What does the following relational algebra expression represent?

Assignment No.:5
Max. Marks: 12

Date of Allotment: 17/08/2019


Last date of Submission:20/9/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Write the query that the itemdesc, itemrate, quantity on hand, and total price CO2
(qty_hd * itemrate) for each individual inventory item. Format each
inventory item return values as follows:
Description:--This is the item description
Price: -- This is the itemrate
QOH:--This is the quantity on hand
Value:--This is qty_hd multiplied by itemrate

2. Information about a collection of students is given by the relation CO1


studinfo(studId, sex). The relation enroll(studId, courseId) gives which
student has enrolled for (or taken) that course(s). Assume that every
course is taken by exactly one male and exactly one female student. What
does the following relational algebra expression represent
3. Draw ER Diagram of AIT-CSE Department. C01

Assignment No.:6
Max. Marks: 12

Date of Allotment: 17/08/2019


Last date of Submission: 20/9/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Student(rollNo, name, degree, year, sex, deptNo, CO2
advisor)department(deptId, name, hod, phone)Obtain the rollNo, name of
all girl students in the Maths Dept (deptId= 2)

2. You have been given a set of tables with data and asked to create a new CO2
database to store them. When you examine the data values in the tables,
what are you looking for?

3. Draw ER Diagram for HR department of an organization. CO1

Assignment No.:7
Max. Marks: 12

Date of Allotment: 17/08/2019


Last date of Submission: 20/9/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Student(rollNo, name, degree, year, sex, deptNo, CO1
advisor)department(deptId, name, hod, phone)Obtain the rollNo, name of
all girl students in the Maths Dept (deptId= 2)

2. Difference between Domain Calculus and Tuple Calculus?. CO1

3. Draw ER Diagram for AIT-CSE of an organization. CO1

DBMS (CST-227)

UNIT 2
Institute/Department: AIT-CSE
Division: 3rd Sem
Subject Name: Database Management System
Subject Code: CST-227

Assignment No.: 2.1


Max. Marks: 12

Date of Allotment: 27/08/2019


Last date of Submission: 23/09/2019
Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Write a PL/SQL block to ask the user to enter the student’s marks CO2
and determine the GRADE according to the following criteria.
>90 A
>80 AND <90 B
>70 AND <80 C
>60 AND <70 D
<60 F

2. The employees’ salary is to be classified as following: CO2


Class A: <= 30000
Class B: > 30000 and <= 60000
Class C: > 60000
Using CURSOR and LOOP, write a PL/SQL program to display the full
name (i.e. first name followed by middle name and last name), salary, and
class of salary for each employee who works in the department
'Production.' The output must be ordered alphabetically by the
employee’s first name, and displayed in the following format:

Full Name:Bijoy Bordoloi


Salary:55000 (Class B)
3. Write a PL/SQL program that uses implicit cursor to display the data CO2
expected, quantity expected, item description, color and quantity on hand
for any particular Ship ID number. Include exception handlers for the cases
where no data is returned or where multiple records are returned. Format
the output so that it is displayed as follows (assuming 212 is the Ship ID):
Shipment 212 is expected to
Arrive on 15-Nov-01
And will contain 25
3-Season Tents, Color forest

Assignment No.: 2.2


Max. Marks: 12

Date of Allotment: 27/08/2019


Last date of Submission: 23/09/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. Question CO Number
No.
1. 1. Normalize the following Table:
CO2
2. Use LOOP to find and display 2 employees who are born on a Tuesday. Display CO2
only their full names. Raise and display a user-defined exception if the criterion
is not met.
3. Write a PL/SQL program that uses an explicit cursor to display the item and the CO2
inventory information for each product. The cursor will also calculate the values
for each inventory item (qty_hd * itemrate), and the total value of all inventory
items for that product category.
Create an explicit cursor that returns and then displays the itemdesc, itemrate,
quantity on hand, and total price (qty_hd * itemrate) for each individual inventory
item. Format each inventory item return values as follows:
Description:--This is the item description
Price: -- This is the itemrate
QOH:--This is the quantity on hand
Value:--This is qty_hd multiplied by itemrate
Create a variable that sums up the total value of all inventory items and then
display the total value after all rows are processed.

Assignment No.:2.3
Max. Marks: 12
Date of Allotment: 27/08/2019
Last date of Submission: 23/09/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember
Questions:
Sr. No. Question CO Number
1. Write a PL/SQL program that uses implicit cursor to display the data CO2
expected, quantity expected, item description, color and quantity on hand
for any particular Ship ID number. Include exception handlers for the cases
where no data is returned or where multiple records are returned. Format
the output so that it is displayed as follows (assuming 212 is the Ship ID):
Shipment 212 is expected to
Arrive on 15-Nov-01
And will contain 25
3-Season Tents, Color forest

2. Create a database table with the following fields: CO2


Field name Data type
Ship_id Number -- This is the ID of a particular Ship
Date_expected Date --The date at which the goods are
expected to arrive
Qty_expected Number --The quantity that is supposed to
arrive
Description Varchar2 --The description of the items
Color Varchar2 --The color of the items
Qty_hand Number –The quantity on hand for these
items
Itemrate Number—Price of each item.

3. Write a program to display the following information for each CO2


department:
a. department’s name
b. department’s manager
c. all the project’s names
d. total work hours
e. total work hours planned

Assignment No.:2.4
Max. Marks: 12

Date of Allotment: 27/08/2019


Last date of Submission: 23/09/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Write a program to find whether the assigned year is a ―Century and leap CO2
year‖ or ―Century and not leap‖ or ―Not century not leap‖ or ―Not century
but leap year‖.

2. Write a PL/SQL block to ask the user to enter the student’s marks CO2
and determine the GRADE according to the following criteria.
>90 A
>80 AND <90 B
>70 AND <80 C
>60 AND <70 D
<60 F

3. Using an IF-THEN statement, write a PL/SQL block to test if the CO2


date provided by the user falls on weekend. In other words, if the
day happens to be Saturday or Sunday.

Assignment No.:2.5
Max. Marks: 12

Date of Allotment: 27/08/2019


Last date of Submission: 23/09/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Create an explicit cursor that returns and then displays the itemdesc, CO2
itemrate, quantity on hand, and total price (qty_hd * itemrate) for each
individual inventory item. Format each inventory item return values as
follows:
Description:--This is the item description
Price: -- This is the itemrate
QOH:--This is the quantity on hand
Value:--This is qty_hd multiplied by itemrate

2. Write a PL/SQL program that uses an explicit cursor to display the item CO2
and the inventory information for each product. The cursor will also
calculate the values for each inventory item (qty_hd * itemrate), and the
total value of all inventory items for that product category.

3. Normalize the following table : CO2


Emp-Id Emp-Name Month Sales Bank-Id Bank-Name
E01 AA Jan 1000 B01 SBI
Feb 1200
Mar 850
E02 BB Jan 2200 B02 UTI
Feb 2500

E03 CC Jan 1700 B01 SBI


Assignment No.:2.6
Max. Marks: 12

Date of Allotment: 27/08/2019


Last date of Submission: 23/09/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply
CO3 Analyze and apply concepts of normalization to relational database Understand
design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Create an explicit cursor that returns and then displays the itemdesc, CO2
itemrate, quantity on hand, and total price (qty_hd * itemrate) for each
individual inventory item. Format each inventory item return values as
follows:
Description:--This is the item description
Price: -- This is the itemrate
QOH:--This is the quantity on hand
Value:--This is qty_hd multiplied by itemrate

2. Write a PL/SQL program that uses an explicit cursor to display the item CO2
and the inventory information for each product. The cursor will also
calculate the values for each inventory item (qty_hd * itemrate), and the
total value of all inventory items for that product category.

3. Explain 2NF with proper example? CO2

Assignment No.:2.7
Max. Marks: 12

Date of Allotment: 27/08/2019


Last date of Submission: 23/09/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Write a program to find whether the assigned year is a ―Century and leap CO2
year‖ or ―Century and not leap‖ or ―Not century not leap‖ or ―Not century
but leap year‖.

2. Describe the structure of implicit cursor? CO2


3. Explain 4NF with proper example? CO2

DBMS (CST-227)
UNIT -3

Institute/Department- UIE-CSE
Division: 3rd Sem
Subject Name: Database Management System
Subject Code: CST-227

Assignment No.: 3.1


Max. Marks: 12

Date of Allotment: 22/10/2019


Last date of Submission: 11/11/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. CO3
Consider the following schedule for transactions T1, T2 and T3:
Which one of the schedules below is the correct serialization of the
above?

2. Consider money is transferred from (1) account-A to Account-B CO3


and (2) account-B to account-A. Which form a transaction will it
be? Explain.

3. Two transactions T1 and T2 are given as: CO3


T1: r1(X)w1(X)r1(Y)w1(Y)
T2 : r2(Y)w2(Y)r2(Z)w2(Z)
where ri(V) denotes a read operation by transaction Ti on a
variable V and wi(V) denotes a write operation by
transaction Ti on a variable V. Calculate The total number
of conflict serializable schedules that can be formed by T1
and T2

Assignment No.:3.2
Max. Marks: 12

Date of Allotment: 22/10/2019


Last date of Submission: 11/11/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. Write about Concurrency Algorithm? CO3

2. Explain Timestamp Protocol? CO3


3. Two transactions T1 and T2 are given as: CO3
T1: r1(X)w1(X)r1(Y)w1(Y)
T2 : r2(Y)w2(Y)r2(Z)w2(Z)
where ri(V) denotes a read operation by transaction Ti on a
variable V and wi(V) denotes a write operation by
transaction Ti on a variable V. Calculate The total number
of conflict serializable schedules that can be formed by T1
and T2

Assignment No.:3.3
Max. Marks: 12

Date of Allotment: 22/10/2019


Last date of Submission: 11/11/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember
Questions:
Sr. No. Question CO Number
1. CO3
Consider the following schedule for transactions T1, T2 and T3:

Which one of the schedules below is the correct serialization of the


above?

2. Explain recovery Techniques? CO3


3. Explain Shadow Paging Algorithm? CO3

Assignment No.:3.4
Max. Marks: 12

Date of Allotment: 22/10/2019


Last date of Submission: 11/11/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember
Questions:
Sr. No. Question CO Number
1. CO3
Consider the following schedule for transactions T1, T2 and T3:

Which one of the schedules below is the correct serialization of the


above?

2. Explain log recovery? CO3


3. Disadvantages of single Locking Technique? CO3

Assignment No.:3.5
Max. Marks:12

Date of Allotment: 22/10/2019


Last date of Submission: 11/11/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember
Questions:
Sr. No. Question CO Number
1. Consider money is transferred from (1) account-A to Account-B CO3
and (2) account-B to account-A. Which form a transaction will it
be? Explain.

2. Compare the deferred-modification and immediate-modification CO3


version of the log-based recovery schemes, in terms of ease of
implementation and overhead cost
3. Explain shadow paging Technique? CO3

Assignment No.:3.6
Max. Marks: 12

Date of Allotment: 22/10/2019


Last date of Submission: 11/11/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database Understand


design
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. No. Question CO Number
1. IF the system recovers from a crash, it constructs an undo-list and a CO3
redo-list. Explain why log records for transactions on the undo-list
must be processed in reverse order while those log records for
transactions on the redo-list are processed in a forward direction.

2. List in detail various techniques to be used for data recovery. CO3


3. Consider the following schedule S of transactions T1 and T2: CO3
Serialize the schedule S?

Assignment No.:3.7
Max. Marks: 12

Date of Allotment: 22/10/2019


Last date of Submission: 11/11/2019

Course Outcomes:
CO Title Level
Number
CO1 Understand the fundamentals of database systems, Design and draw ER Understand
diagram for the real life problems.
CO2 Design and querying database using SQL. Apply

CO3 Analyze and apply concepts of normalization to relational database design Understand
CO4 Understand the concept of transaction, concurrency and recovery. Remember

Questions:
Sr. Question CO
No Numb
. er
1. Check whether Schedule is serial, serializable, Conflict serializable CO3

S:R2(Z),R2(Y),W2(Y),R3(Y),R3(Z),R1(X),W1(X),W3(Y)W3(Z)R2(X)R1(Y)W
1(Y)

2. State the purpose of the checkpoint mechanism. How often should checkpoints be CO3
performed? How does the frequency of checkpoints affect.
a. System performance when no failure occurs
b. The time it takes to recover from a system crash
c. The time it takes to recover from a disk crash

3. Check whether Schedule is serial, serializable, Conflict serializable CO3

S:R2(Z),R2(Y),W2(Y),R3(Y),R3(Z),R1(X),W1(X),W3(Y)W3(Z)R2(X)R
1(Y)W1(Y)

You might also like