$35
CSE4/560
Databases and Query Languages
Homework 1
Total Marks 60
1. [20] Explain the following terms briefly: attribute, domain, entity, relation, relational database schema, entity set, relationship set.
2. [5] Given the following relational schema, give two examples of foreign key constraints that involves the Dept relation.
3. [6] Explain the statement that relational algebra operators can be composed. Why is the ability to compose operators important?
4. [12] Briefly explain the significance of the followings in representing information in the real world: a) data definition langauge; b) data manipulation language; c) data model.
5. [5] What is the difference between the natural join R×S and the theta-join R./S where the condition C is that R.A = S.A for each attribute A appearing in the schemas of both R and S?
6.[12] Consider the database schema consists of four relations,whose schemas are:
Product(maker, model, type)
PC(model, speed, ram, hd, price)
Laptop(model, speed, ram, hd, screen, price)
Printer(model, color, type, price)
The Product relation gives the manufacturer, model number and type (PC, laptop, or printer) of various products. We assume for convenience that model numbers are unique over all manufacturers and product types; that assumption is not realistic, and a real database would include a code for the manufacturer as part of the model number. The PC relation gives for each model number that is a PC the speed (of the processor, in gigahertz), the amount of RAM (in megabytes), the size of the hard disk (in gigabytes), and the price. The Laptop relation is similar, except that the screen size (in inches) is also included. The Printer relation records for each printer model whether the printer produces color output (true, if so), the process type (laser or ink-jet, typically), and the price.
Write the following declarations:
a) A suitable schema for relation Product.
b) A suitable schema for relation PC.
c) A suitable schema for relation Laptop.
d) A suitable schema for relation Printer.
e) An alteration to your Printer schema from (d) to delete the attribute color.
f) An alteration to your Laptop schema from (c) to add the attribute od (optical-disktype, e.g., cd or dvd). Let the default value for this attribute be ’none’ if the laptop does not have an optical disk.