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

Dbms Unit 2 Assignment

This document outlines an assignment for a Database Management Systems course. It includes 7 sections with multiple choice, short answer, and long answer questions. The questions cover topics like SQL clauses, data definition language commands, data types, joins, aggregation, constraints, relational algebra operations, and more. Students are asked to write SQL queries based on sample schemas and perform relational algebra operations to answer multi-part questions.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

Dbms Unit 2 Assignment

This document outlines an assignment for a Database Management Systems course. It includes 7 sections with multiple choice, short answer, and long answer questions. The questions cover topics like SQL clauses, data definition language commands, data types, joins, aggregation, constraints, relational algebra operations, and more. Students are asked to write SQL queries based on sample schemas and perform relational algebra operations to answer multi-part questions.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

B.TECH.

(SEM V) ASSIGNMENT 2
2023-24
DATABASE MANAGEMENT SYSTEM

Time: 3 Hours Total Marks: 100


Note: Attempt all Sections.

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.

4. Attempt any one part of the following: 10 x1 = 10


a. What are Joins? Discuss all types of Joins with the help of suitable examples.
b. Describe views and indexes in SQL

5. Attempt any one part of the following: 10x1 = 10


a. Consider the following relations : Student (ssn, name, address, major) Course (code, title)
Registered (ssn, code) Use relational algebra to answer the following :
i. List the codes of courses in which at least one student is registered (registered courses).
ii. List the title of registered courses.
iii. List the codes of courses for which no student is registered.
iv. The titles of courses for which no student is registered.
v. Name of students and the titles of courses they registered to.
vi. SSNs of students who are registered for both Database Systems and Analysis of Algorithms.
vii. The name of students who are registered for both Database Systems and Analysis of
Algorithms. i. List of courses in which all students are registered.
viii . List of courses in which all ‘ECMP’ major students are registered.

b. Describe the SQL set operations.

6. Attempt any one part of the following: 10x1 = 10

a. What is trigger? Explain different trigger with example.


b. Explain cursors, sequences and procedures used in SQL.

7. Attempt any one part of the following: 10x1 = 10

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.

You might also like