Q 4

I) 1.List out the column properties?

2.what is view ,list out the limitation while creating view?

3. Compare Primary key and Unique Key ?

4.What are the Rule limitations?

5.How do you create Defaults ?

6.How do you create User-Defined data types?

II) The database scheme consists of four relations:

Product(maker, model, type)
PC(code, model, speed, ram, hd, cd, price)
Laptop(code, model, speed, ram, hd, screen, price)
Printer(code, model, color, type, price)

The relation "Product" shows the maker, model number, and type (pc, laptop, or printer). It is assumed that model numbers are unique for all the makers and product types. For each model number specifying pc in the relation "PC", its listed speed (of the processor in MGz), total RAM (in MGb), hd capacity (in Gb), CD ROM speed (for example, '4x'), and the price. The relation "Laptop" is similar to that one of PCs except for the CD ROM speed which is replaced by screen size (in inches). For each printer model in the relation "Printer" it is pointed whether the printer is color or not (color attribute is 'y' for color printers; otherwise it is 'n'), printer type (laser, jet, or matrix), and the price.

1.Maker A has passed manufacture of printers to maker Z. Perform necessary changes

update product set maker='Z' where type='printer' and maker='A'

2.Delete from the Laptop table all the laptops of those makers who don't produce printers.

delete laptop where model in(select model from product where maker not in(select distinct maker from product where type!='laptop' and type='printer'))

3.Find the laptops having speeds less than all PC's. Result set: type, model, speed.

Ans: select type='laptop',model,speed from laptop where speed <(select min(speed) from pc)

No comments: