CS 377 - Database Systems
SQL Project 1 (2018)

Due: see class web page




Before you start on this project, you must read

You must read the information/description on the SPJ project database in the URL below to do the project.

Specifically: pay attention to what the meaning of each relation is.



How to do SQL projects:









1. Assignment





2. SQL Queries Files that you need to turn in




3. SQL Queries

Important notes:

Express the following queries in SQL:

  1. Get part numbers of all red parts that is made in London

    Sample output:

    Answer: click here

  2. Get project numbers of projects that uses a red part that is manufactured in the same city as the project

    Sample output:

    Answer: click here

  3. Get supplier numbers of suppliers who do not supply to any project in city that the supplier is based.

    Sample output:

    Answer: click here

  4. Find snum of suppliers who supply a part that is lighter than every part supplied by supplier Blake

    Sample output:

    Answer: click here

  5. Find jnum of projects that do not use any `Nut's nor any 'Bolt's.

    Sample output:

    Answer: click here

  6. For every supplier, list his supplier number snum and the part number pnum of the heaviest part that he ships

    Sample output:

    Answer: click here

  7. Find snum for suppliers that do not supply any part named 'Nut'

    Sample output:

    Answer: click here

  8. Find snum of supplier that only supplies/ships to projects in the city that the supplier lives

    Sample output:


    Answer: click here

  9. Get snum of suppliers that ship all (= every one) parts that are used in project "j6".

    Suppose project j6 uses parts p1, p2 and p3. Then find suppliers that have shipments for all these parts in the spj relation. The supplier does not need to ship these parts to project j6.

    Sample output:


    Answer: click here

  10. Get jnum of projects that have shipments from all (= every one) suppliers that live in the city where the project is located.

    E.g.: if project X is in Atlanta and the suppliers S1 and S2 live in Atlanta, than project X must have shipments from supplier S1 and S2 in the spj relation

    Sample output:


    Answer: click here



Turn in





Extension request





Statement of Policy on Computer Assignments

Students will be graded partially on the basis of their programming assignments. These programming assignments are to be treated as examinations, and are expected to be your individual work. While discussions with other students in the course may be permitted or encouraged by your instructor, you should write your program yourself. The mathlab representatives are available to explain error messages, discuss briefly technical details with which you may not be familiar, and give short suggestions as to how you might detect logic errors. The reps should not, however be asked to write part or all of your program. Your instructor (and any teaching assistants assigned to the course) will be glad to help you to the extent that he or she feels reasonable.

Submissions based on other students solutions in prior offerings of the course specifically violate these guidelines, as do submissions prepared with the help of an outside "tutor".

You should take precautions to protect the confidentiality of your work: preserve the secrecy of your password, do not make files or directories sharable, pick up your printouts promptly and dispose of printouts where they will not tempt other students. All work should be done either in the class directory of your ITD account (preferred) or in your "priv" directory (only if you do not have a class directory).

All submissions should include a comment statement near the top of the program of the form:

THIS CODE IS MY OWN WORK, IT WAS WRITTEN WITHOUT CONSULTING A TUTOR OR CODE WRITTEN BY OTHER STUDENTS - your name

Cases of apparent plagiarism or collusion will be referred to the Honor Council.