r Answer The following are the scripts to create the tables in the Premier datah
ID: 3721715 • Letter: R
Question
r Answer The following are the scripts to create the tables in the Premier datahase schema CREATE TABLE REP (REP NUM CHAR(2) PRIMARY KEY LAST_NAME CHAR(15) FIRST NAME CHAR(15), STREET CHAR(15), CITY CHAR(15), STATE CHAR2), ZIP CHAR(5), COMMISSION DECIMAL(7,2) RATE DECIMAL(3,2) ); Qn. List the part number,part description,and CREATE TABLE CUSTOMER (CUSTOMER-NUM CHAR(3) PRIMARY KEY, CUSTOMER NAME CHAR(S) NOT NULL, item class Tor STREET CHAR(15), CITY CHAR(15), STATE CHAR(2), ZIP CHAR(5), BALANCE DECIMAL(8,2), CREDIT LIMIT DECIMAL(8,2) REP NUM CHAR(2) ): each pair of parts that are in the same item class. CREATE TABLE ORDERS (ORDER_NUM CHAR(S) PRIMARY KEY,DO no ORDER DATE DATE CUSTOMER NUM CHAR(3)) duplicate parts or reverse combination of parts CREATE TABLE PART (PART NUM CHAR(4) PRIMARY KEY DESCRIPTION CHAR 15) ON-HAND DECI MAI (4,0). CLASS CHAR(2), WAREHOUSE CHAR1), PRICE DECIMAL(6,2) ); CREATE TABLE ORDER LINE (ORDER-NUM CHAR(5), PART NUM CHAR(4), NUM ORDERED DECIMAL 3,0), QUOTED PRICE DECIMAL(6,2), PRIMARY KEY (ORDER NUM, PART NUM) ) - Using this information, author SOL statements to answer the following questions. List the part number and part description for all parts (5 points).Explanation / Answer
Hi,
we are asked the info about parts here, and since we will be writing the query on the part table,
here are the columns of interest in PART table
PART_NUM
DESCRIPTION
CLASS
now, we want all pairs of parts such that they belong to same item class, i.e they will have same CLASS column value, this can be done by group by as
SELECT PART_NUM,DESCRIPTION,CLASS FROM PART GROUP BY CLASS;
Thumbs up if this was helpful, otherwise let me know in comments
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.