Sql script to create and populate the tables, PL-SQL Programming

Create the four tables and populate them with the given data. Answer the following queries in SQL.

1. Get all part-color/part-city combinations. Note: Here and subsequently, the term "all" is to be taken to mean "all currently represented in the database" not "all possible".  

2. Get all supplier-number/part-number/job-number triples such that the indicated supplier, part, and job are colocated.  

3. Get all supplier-number/part-number/job-number triples such that the no two of the indicated supplier, part, and job are colocated.  

4. Get all pairs of part numbers such that some supplier supplies both the indicated parts. 

5. Get job numbers for jobs whose city is first in the alphabetic list of such cities.

6. Get job numbers for jobs not supplied with any red part by any London supplier.  

7. Get part numbers for parts supplied to all jobs in London.  

8. Get supplier numbers for suppliers who supply the same part to all jobs.  

9. Get the total quantity of part P1 supplied by supplier S1.  

10. Get part number for parts that are supplied either by a London supplier or to a London job.

Please turn in the following materials:

1.  A SQL script to create and populate the tables.

2.  A SQL script to answer the queries.

3.  The results of your queries.

Posted Date: 3/12/2013 2:46:05 AM | Location : United States







Related Discussions:- Sql script to create and populate the tables, Assignment Help, Ask Question on Sql script to create and populate the tables, Get Answer, Expert's Help, Sql script to create and populate the tables Discussions

Write discussion on Sql script to create and populate the tables
Your posts are moderated
Related Questions
EXECUTE Privilege To call an invoker-rights routine straightforwardly, the users should have the EXECUTE privilege on that routine. By yielding the privilege, you permit a user

SQL Database: So, an SQL database is one whose symbols are organized into a collection of tables. Now, shows an SQL table as the current value of an SQL variable, ENROLMENT, b

First Step at defining type SID in SQL CREATE TYPE SID AS ( C VARCHAR(5) ) ; Explanation: TYPE SID announces that a type named SID is being defined to the syst

Using NOT NULL Besides assigning an initial value, the declarations can impose the NOT NULL constraint, as the example below shows: acct_id INTEGER(4) NOT NULL := 9999; You ca

ALTER TABLE bb_basketitem ADD CONSTRAINT bitems_qty_ck CHECK (quantity BEGIN INSERT INTO bb_basketitem VALUES (88,8,10.8,21,16,2,3); END; Brewbean’s wants to add a check

Create a procedure named STATUS_SHIP_SP that allows a company to employee in the Shipping Department to update the status of an order to add shipping information. The BB_BASKETSTAT

FOR-LOOP While the number of iterations through a WHILE loop is unknown till the loop completes, then the number of iterations through a FOR loop is known before the loop is ent

Exception handling In the PL/SQL, a warning or error condition is known as an exception. The Exceptions can be internally defined (by the run-time system) or user defined. The

Dynamic Ranges The PL/SQL lets you determine the loop range dynamically at run time, as the example below shows: SELECT COUNT(empno) INTO emp_count FROM emp; FOR i IN 1..emp_cou

Parameter Default Values As the illustration below shows, you can initialize the IN parameters to the default values. In that way, you can pass various numbers of actual par