You are on page 1of 1

1. Consider a data file EMPLOYEE(EmpId, Ename, Salary, deptNo, Dob, Designation, SSN).

Create a
primary index on EmpId and secondary index on deptNo.

Which will take more space and why?

2. Consider the following relational schema-

Representative (RepNo, LastName, FirstName, Street, City, State, Pin, Commision, Rate)

Customer (Cust_No, Cust_name, Street, City, State, Pin, Balance, Credit_Limit, RepNo)

Orders (OrderNO, Order_Date, Cust_NO)

a. List the Ordernumber, Orderdate, Customer number and Customer name for each order placed by
any sales representatives whose last name is Thakur.

b. List the Ordernumber, Orderdate, for all orders placed by a customer along with the customer
name and customer number.

c. List the number and date of all orders that were placed on Jan 15, 2012 by customer whose
representative number is 200.

3. Consider the two relations in the database

Branch Student

Branch_code Branch_Name Roll No Name Age Branch_code


CS Computer Science 1 Rahul 22 CS
EE Electronics Engineering 2 Anjali 21 CS
IT Information Technology 3 Teena 20 IT
CE Civil Engineering

Relation Student references the relation Branch.

For each of the following operations, indicate whether it results in constraint violation and if so,
which constraint and why?

i. Insert <1, ‘Meera’, 22, ‘EE’> in Student.


ii. Delete <’CS’, ‘Computer Science’> in Branch.
iii. Update <’CS’, ‘Computer Science’> to <’CSE’, ‘Computer Science’> in Branch.
iv. Insert <5, ‘Preeti’, 21, ‘EE’> in Student.

You might also like