Computer Science 455

First Hour Exam

 

 

 

Name ___________________________

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Friday, Feb. 12

3:00

  1. (some definitions – 5 pts. each)

Give brief definitions of the following terms

    1. DBMS
    2.  

       

       

       

       

       

    3. Primary key
    4.  

       

       

       

       

       

       

    5. Foreign key
    6.  

       

       

       

       

       

       

    7. Entity integrity
    8.  

       

       

       

       

       

       

    9. Referential integrity
  1. Some set theory (10 pts.)

Suppose that we have sets defined as follows:

A = {a, c, d}

B = {b, c}

Calculate

    1.  

       

       

       

       

    2.  

       

       

       

       

    3.  

       

       

       

       

 

 

  1. (25 pts.)
    1. What is a data model?
    2.  

       

       

       

       

       

       

       

       

       

       

    3. Pick either the hierarchical or network/CODASYL model and briefly describe it as you would to a friend who is not studying computer science (think of explaining it to a manager).

 

 

 

c. To the same friend you described the network/CODASYL model, briefly describe the relational model (you won’t need all the space provided).

  1. (20 pts.)

A company has a number of salespeople (SNO, SNAME). Each salesperson works with a number of customers (CNO, CNAME), but each customer works with only one salesperson.

    1. Model this as an entity-relationship diagram.
    2.  

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

    3. Convert the E-R diagram to a relational schema. Assuming that SNO and CNO are keys for the corresponding entities, identify keys and foreign keys in the tables of your relational schema.

 

V. (20 pts.) Write EASYALG queries for the following. For each of the following, the final table should be ANS (i.e., if I PRINT ANS, I print out the result of the query).

S(S#, SNAME, STATUS, CITY)

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

J(J#, JNAME, CITY)

SPJ(S#, P#, J#, QTY)

    1. Find the names of PARIS projects
    2.  

       

       

       

       

       

       

       

       

       

       

       

       

       

    3. Find the names of suppliers who supply PARIS projects