

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


BCSE302L Database Systems Task 4: To create Software Stores Management SystemConsider a database of a Software
Stores that stores details of PCs, Printers, and Laptops and it involves the following tables:
Product (maker, model, type);
PC (model, speed, ram, hd, cd, 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, Printer) of various products. Assume that model numbers are unique.
The PC relation gives for each model number that is a PC, the speed of the processor in MHz, RAM size in MB, size of hard disk in GB, the speed of the CD reader, and the price.
The Laptop relation is similar, except that the screen size in inches is recorded in the place of CD speed.
The Printer relation records for each printer model, whether the printer produces color output (T, if so), the process type (Laser/Inkjet/Dry) and the price.
(a)Find the hard disk sizes that occur in 2 or more PCs.
(b)Find the manufacturer of a color printer with lowest price.
(c)Find for each speed of PC above 150 MHz, the average price.
Syntax:
Check constraint
Column Level Check Constraint Write a query to create Check constraints with column level Syntax for clumn level constraints using Check:
CREATE <OBJ.TYPE> <OBJ.NAME> (COLUMN NAME.1
Example CREATE TABLE EMP7(EMPNO NUMBER(3), ENAME VARCHAR2(20), DESIGN VARCHAR2(15), SAL NUMBER(5)CONSTRAINT EMP7_SAL_CK CHECK(SAL>500 AND SAL<10001), DEPTNO NUMBER(2));
Table Level Check Constraint: Write a query to create Check constraints with table level Syntax for Table level constraints using Check:
CREATE <OBJ.TYPE> <OBJ.NAME> (COLUMN NAME.1
DESIGN VARCHAR2(15), SAL NUMBER(5),DEPTNO NUMBER(2), CONSTRAINTS EMP8_SAL_CK CHECK(SAL>500 AND SAL<10001));
Check Constraint with Alter Command Write a query to create Check constraints with table level using alter command. Syntax for Table level constraints using Check:
CREATE <OBJ.TYPE> <OBJ.NAME> (COLUMN NAME.1