Computer Science 455

 

 

First Hour Exam

 

 

 

 

Name _______________________________

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Friday, Feb. 16

100 pts.

 


I.          Some basics.

 

a.         (10 pts.)          Give a brief definition of a database management system that would tell your boss what she needs to know in order to make a decision to purchase one for the company.

 

 

 

 

 

 

 

 

 

 

 

 

 

b.         (5 pts.)           Give a brief definition of a data model.

 

 

 

 

 

 


 

 

c.         (5 pts.)            Give a definition of a key

 

 

 

 

 

 

 

 

d.         (5 pts) Give a definition of a foreign key

 

 

 

 

 

 

 

 

e.         (5 pts.)            Give a definition of entity integrity

 

 

 

 

 

 

 

f.          (5 pts.)            Give a definition of referential integrity

 

 

 


c.         (15 pts.)          Consider the following entity-relationship diagram:

 

 

 

A is the key to T1, C is the key to T2, and G is the key to T3.  From this diagram, construct a relational schema, identifying keys and foreign keys.


Questions following are with respect to the SPJ database:

 

S(SNO, SNAME, STATUS, CITY)

P(PNO, PNAME, COLOR, WEIGHT, CITY)

J(JNO, JNAME, CITY)

SPJ(SNO, PNO, JNO, QTY)

 

2.         (20 pts.)          Using both EASYALG and SQL, write queries to find the names and weights of red parts.

 

EASYALG

 

 

 

 

 

 

 

 

SQL


3.         (20 pts.)          Using both EASYALG and SQL, write queries to find the names of RED parts supplied to a LONDON project.

 

EASYALG

 

 

 

 

 

 

 

 

 

 

 

 

 

SQL

 

 

 


4.         (10 pts.)          (SQL only) Write  a query to find the names of suppliers who supply RED parts to LONDON projects.