Dbms Unit 2 Assignment
Dbms Unit 2 Assignment
(SEM V) ASSIGNMENT 2
2023-24
DATABASE MANAGEMENT SYSTEM
SECTION A
1. Attempt all questions in brief. 2x10 = 20
a. What is the difference between WHERE and HAVING clause?
b. What is the difference between DROP and DELETE command?
c. What is the purpose of view in SQL?
d. Give merits and demerits of SQL database.
e. Define constraint and list its types in DBMS
f. What is union compatibility?
g. With an example show how a referential integrity can be implemented.
h. Define the term degree and cardinality in the context of the relational data model
i. What is a CLAUSE in terms of SQL?
j. What is Equi-Join in database?
SECTION B
2. Attempt any three of the following: 10x3 = 30
a. What is Relational Algebra? Explain Different Operations of Relational Algebra with
Example.
b. What is Aggregate Function in SQL? Write SQL query for different Aggregate Function.
c. Explain SQL DML commands in detail.
d. Explain the following constraints :
i. Entity integrity constraint
ii. Referential integrity constraint
iii. Domain constraint
SECTION C
3. Attempt any one part of the following: 10x1 = 10
a. Write short note on SQL. Explain various data types used in SQL.
b. Describe the operators and its types in SQL.
a. Consider the following relational database employee (employee_name, street, city works
(employee_name, company_name, salary) company (company_name, city) manage
(employee_name, manager_name). Give an expression in SQL to express each of the following
queries :
i. Find the names and cities of residence of all employees who work for XYZ bank.
ii. Find the names, street address, and cities of residence of all employee who works for XYZ
Bank and earn more than Rs. 10,000 per annum.
iii. Find the names of all employees in this database who live in the same city as the company
for which they work.
b. Consider the following relational DATABASE. Give an expression in SQL for each
following queries. Underline records are primary key Employee(person_name, street, city)
Works(person_name, Company_name, salary) Company(_name, city) Manages(person_name,
manager_name)
i. Finds the names of all employees who works for the ABC bank.
ii. Finds the name of all employees who live in the same city and on the same street as do their
managers.
iii. Find the name street address and cities of residence of all employees who work for ABC
bank and earn more than 7,000 per annum.
iv. Find the name of all employee who earn more than every employee of XYZ.
v. Give all employees of corporation ABC a 7% salary raise.
vi. Delete all tuples in the works relation for employees of ABC.
vii. Find the name of all employees in this DATABASE who live in the same city as the
company for which they work.