DBMS UNIT-2 Assignment Questions R23
DBMS UNIT-2 Assignment Questions R23
Assignment Questions
1) How the select and project will be impact on sql querying database with examples.
2) a) What are NULL values? How do they effect the meaning of the queries. Can foreign
key values in database be NULL or duplicates? Justify your answer.
b) Consider the following relational Schema:
Sailors(sid:Integer, sname: String, age: Integer, rating: Integer)
Boats(bid: Integer, bname: String, bcolor: String)
Reserves(sid: Integer, bid: Integer, date: Date)
Write the following queries in SQL:
i) Find names of Sailors who have reserved red and green boat
ii) Find the names of Sailors who have reserved all boats.
3) a) Define the following terms: relation schema, relational database schema, domain,
attribute, attribute domain, relation instance, and relation cardinality.
b) When are integrity constraints enforced by a DBMS? What is referential integrity?
Explain with examples.
4) a) What are integrity constraints? Define the terms primary key constraint and foreign
key constraint. Give Examples.
b) Explain with examples, different DDL and DML operations in SQL.
1) a) What is a foreign key constraint? Why are such constraints important? What is
referential integrity? [July-22]
b) Define the following terms with examples: relation schema, relational database schema,
domain, and relation degree. [July-22]
2) a) What are Dr. E.F. Codd Laws for fully functional relational database management
systems? Explain. [Feb-23]
b) Consider the following Relational Schemas:
Sailors(sid:integer, sname:string, age:integer, rating:integer)
Boats(bid:integer, bname:string, bcolor: string)
Reserves(sid: Integer, bid: Integer,date:Date)
Write the following queries in SQL:
i) Find names of Sailors with third highest rating
ii) Find the age of youngest sailor who is eligibile to vote(18 years age) for each rating
level with atleast 2 sailors. [Feb-23]
4) 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, dname: string, budget: real, managerid: integer)
Write the following queries in SQL:
a) Print the names and ages of each employee who works in both the Hardware department and
the Software department.
b) 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.
c) Print the name of each employee whose salary exceeds the budget of all of the departments
that he or she works in.
d) Find the managerids of managers who manage only departments with budgets greater than $1
million.
e) Find the enames of managers who manage the departments with the largest budgets.
f) If a manager manages more than one department, he or she controls the sum of all the budgets
for those departments. Find the managerids of managers who control more than $5 million.
[July-22]