Assignment 1
Assignment 1
Chapter 1
1.1. Define the following terms:
a) Database catalog and meta-data,
b) Program-data independence,
c) DBA
d) Canned transactions,
e) Deductive database system,
f) Persistent object,
g) Transaction-processing application.
1.2. Differentiate between Database management system and Traditional file systems.
1.4 Briefly explain the main activities different types of database end users (30 words for each type of user)
perform.
1.7 What is the difference between controlled and uncontrolled redundancy? Illustrate with examples.
Chapter 2
2.1. Define the following terms:
a) Data model,
b) Data independence,
c) Client/Server architecture
2.3. Explain the three-schema architecture and mappings among schema levels. How is this architecture
supported by schema definition languages?
Chapter 5
5.1. Define the following terms:
a) Domain,
b) n-tuple,
c) Degree of a relation
5.3. Why are tuples not ordered and duplicate tuples not allowed in a relation?
5.4. Why do we designate one of the candidate keys of a relation to be the primary key?
5.6. Explain entity integrity and referential integrity constraints with the help of examples.
5.8. Consider the following six relations for an order-processing database application in a company:
CUSTOMER(Cust#, Cname, City)
ORDER(Order#, Odate, Cust#, Ord_amt)
ORDER_ITEM(Order#, Item#, Qty)
ITEM(Item#, Unit_price)
SHIPMENT(Order#, Warehouse#, Ship_date)
WAREHOUSE(Warehouse#, City)
Here, Ord_amt refers to total dollar amount of an order; Odate is the date the order was placed; and Ship_date is the
date an order (or part of an order) is shipped from the warehouse. Assume that an order can be shipped from several
warehouses. Specify the primary key and foreign keys for this schema, stating any assumptions you make. What other
constraints can you think of for this database?
5.9. Consider the following relations for a database that keeps track of student enrollment in courses and the
books adopted for each course:
Specify the primary key and foreign keys for this schema, stating any assumptions you make.
Chapter 6
6.1 Consider the database schema shown below. What are the entity and referential integrity constraints that
should hold on the schema? Write appropriate SQL DDL statements to define the database.
STUDENT
Roll_no Student_name Class Major
COURSE
Course_no Course_name Credit_hrs Dept
PREREQUISITE
Course_no Prerequisite_no
SECTION
Section_id Course_no Sem Year Instructor
GRADE_REPORT
Roll_no Section_id Grade
6.2 Consider the relational database schema shown below. Choose the appropriate action (reject, cascade, set
to NULL , set to default) for each referential integrity constraint, both for the deletion of a referenced tuple
and for the update of a primary key attribute value in a referenced tuple. Justify your choices.
Reference_Book
Book# Title Publisher
Author
Book# Author_name
Publisher
Name Address Phone
Book_Copies
Book# Branch# No_of_copies
Branch
Branch# Branch_name Address
Borrower
Card_no Name Address Phone
6.3 Write the following queries in SQL on the relational database schema shown below.
EMPLOYEE
Ssn Fname Lname Bdate Address Salary Super_ssn Dno
DEPT
Dnum Dname Mgr_ssn Mgr_startdate
WORKS_ON
Wssn Pno Hours
PROJECT
Pnum Pname Dnum
DEPENDENT
Essn Dep_name Bdate Relationship
a. List the names of all employees who have a dependent with the same first name as themselves.
b. Fetch the names of all employees in Dept ‘Sales’ who work less than 40 hours per month on the project ‘ITEM-X’.
c. Find the names of all employees who are directly supervised by ‘Mr. Verma’.
6.4. Write SQL update statements to do the following on the database schema shown in question 6.1.