[Main Page]      [Literature]      [Software]      [People]      [Conferences]      [Courses]      [Web-DB]

 

UNIVERSITY OF PITTSBURGH
School of Information Sciences

INFSCI 2710 - Database Management

(Spring 2000, CRN 20727)


Homework Assignment #9:    SQL


Reading Assignment

Please read the following chapter from the book by Elmasri and Navathe (3rd Edition):

Exercise 9 (12 Points)

Your results for homeworks, midterm and final exam are stored in a relational database with the following schema:

An SQL*Plus script which generates these tables and fills them with some sample data (of course, not the real data) is available from

Please write the following queries in SQL. You must actually run them in SQL*Plus (or some other SQL system). If your solution contains a syntax error which any DBMS would have found, you get 0 points. In SQL*Plus, you can create a spool file and submit this (see Appendix B). You do not need to submit the query results. You are allowed to use views.

    a)
Which students have done Homework 5 and 6? Try to solve this question without aggregations. Print first and last name of every such student.
    b)
Which students have not yet done Homework 6?
    c)
Print first and last name of a student and the exercise number of a homework, such that the student has not yet done that homework. (Of course, all such results are required, not only one student and one homework.) I can use the output of this query to check whether any homework results are missing in the database.
    d)
Print for every student the total number of points for homeworks, including students who have not done any homework yet (so their total score is 0). Order the result by the total number of points.
    e)
Print all students (first and last name) who have the perfect score for their homeworks. I.e. they got (at least) 100% for all homeworks in the database.
    f)
Who did best in the midterm exam, i.e. has the most points? Print first and last name of that student (it could be more than one, if two students have the same points).

Due Date:

Please submit your solution on next Wednesday (April 5) before the lecture.


Stefan Brass (sbrass@sis.pitt.edu), March 29, 2000

Original URL: http://www2.sis.pitt.edu/~sbrass/db00_2/h9_sql.html   [HTML 3.2 Checked]