Computer Science 455

 

Third Hour Exam

 

 

 

Name _______________________________

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Thursday, April 29

100 pts.

 

Happy Birthday, Poincaré!

(April 19, 1854 – July 17, 1912)

I. Some basics.

a. (10 pts.) Explain what the impedance mismatch problem is, and how PL/SQL gets around it.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

b. (10 pts.) Briefly, outline the steps involved in creating a simple report with summary elements and page numbers.

 

c. (10 pts.) SQL is sometimes referred to as a ‘hybrid’ language – mostly relational calculus with some relational algebra elements. Give a brief example of a SQL query that is purely relational calculus, and a second example of a query with a relational algebra element (circle the part of the query that is algebraic). Both queries should be brief.

calculus only

 

 

 

 

 

 

 

 

some relational algebra

 

 

 

 

 

 

 

 

 

 

 

II. Queries (10 pts. each). The following queries 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)

For the first three queries, give responses both in SQL and in the relational algebra. The final query is in SQL only

  1. Find the names of suppliers who supply parts to London projects
  2. SQL

     

     

     

     

     

     

     

     

     

    ALGEBRA

  3. Find the names of suppliers who supply no parts to London projects
  4. SQL

     

     

     

     

     

     

     

     

     

     

     

     

     

    ALGEBRA

  5. Find the names of suppliers who supply parts to all London projects.
  6. SQL

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    ALGEBRA

  7. (SQL only)

Find the names of suppliers who supply more than three projects, together with the number of projects supplied. The answer to the query should be something like

SNO ********* <- the column header here would give the

--- ------------------ problem away

S2 7

S5 4