INFO 2103 Database Programming Assignment #3     For this assignment, please use the SUPPLIER and COMPUTER table. The script is available in Google Classroom. Script name: computer.sql. Note: Use Subqueries          1.    Display the supplier that supplied the most computers.           2.   Display the building location that has the most computers.

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter4: Constraints
Section: Chapter Questions
Problem 6RQ: How is adding a NOT NULL constraint to an existing table different from adding other types of...
icon
Related questions
Question
100%

INFO 2103 Database Programming

Assignment #3

 

 

For this assignment, please use the SUPPLIER and COMPUTER table. The script is available in Google Classroom. Script name: computer.sql. Note: Use Subqueries

 

 

     1.    Display the supplier that supplied the most computers.

 

 

      2.   Display the building location that has the most computers.

DROP TABLE computer CASCADE CONSTRAINTS,
DROP TABLE location CASCADE CONSTRAINTS;
DROP TABLE supplier CASCADE CONSTRAINTS:
CREATE TABLE supplier
(SuppID NUMBER (3),
SName VARCHAR2 (15),
SAddress VARCHAR2 120),
SPhone VARCHAR2 (12),
CONSTRAINT supplier_suppID_PK PRIMARY KEY (suppIDI);
CREATE TABLE location
(LocID NUMBER (3),
Bldg_code CHAR (4),
RoonNo NUMNBER (3),
CONSTRAINT location locid PK PRIMARY KEY (LOCID) I:
CREATE TABLE computer
(CompID NUMBER (5),
SNumber VARCHAR2 (15),
Make VARCHAR2 (20),
SuppID NUMBER (3),
LocID NUMBER (3),
Value NUMBER (6,2),
Date purchased DATE,
CONSTRAINT computer_compID_PK PRIMARY KEY (CompID),
CONSTRAINT computer_suppID_FK FOREIGN KEY (suppID) REFERENCES
supplier,
CONSTRAINT computer 10CID FK FOREIGN KEY (10CID) REFERENCES location) :
INSERT INTO supplier VALUES (122, 'Compag Sdn. Bhd', '10 Jalan Duta',
'03-989898');
INSERT INTO supplier VALUES (123, 'ASUS Sdn. Bhd', '12 Jalan Duta',
'03-2323231;
INSERT INTO supplier VALUES (124, 'IBM Sdn.Bhd', '15 Jalan Duta', '03-
565656'):
INSERT INTO supplier VALUES (125, 'Apple Sdn.Bhd', '18 Jalan Duta',
'03-785676')
INSERT INTO location VALUES (222, 'LAN', 343):
INSERT INTO location VALUES (333, 'IRK', 343)
INSERT INTO location VALUES (444, 'ICT', 343)
INSERT INTO computer VALUES (13321, "XDX12345', "Compaq', 122, 222,
2300.50, 70 DATE ('12-JAN-2008', 'DD-MON-YYYY')):
INSERT INTO computer VALUES (13322, 'XDX12344', 'ASUS PC', 123, 222,
3000.80, TO DATE ('17-JAN-2008', 'DD-MON-YYYY')):
INSERT INTO Computer VALUES (13323, "XDX12343', 'IBM', 124, 333,
2800.50, TO_DATE ('12-DEC-2008', 'DD-MON-YYYY'));
INSERT INTO computer VALUES (13324, "XDX12342', 'Apple', 125, 444,
5300.50, TO_DATE ('12-JUN-2009', 'DD-MON-YYYY')) :
INSERT INTO computer VALUES (13325, "XDX12341', 'Apple', 125, 444,
6300.50, T0 DATE ('12-JUN-2009', 'DD-MON-YYYY')):
INSERT INTO computer VALUES (13326, "XDX12346', 'Apple', 125, 444,
6000.85, 70 DATE ('12-JUN-2009', 'DD-MON-YYYY')):
COMMITI
Transcribed Image Text:DROP TABLE computer CASCADE CONSTRAINTS, DROP TABLE location CASCADE CONSTRAINTS; DROP TABLE supplier CASCADE CONSTRAINTS: CREATE TABLE supplier (SuppID NUMBER (3), SName VARCHAR2 (15), SAddress VARCHAR2 120), SPhone VARCHAR2 (12), CONSTRAINT supplier_suppID_PK PRIMARY KEY (suppIDI); CREATE TABLE location (LocID NUMBER (3), Bldg_code CHAR (4), RoonNo NUMNBER (3), CONSTRAINT location locid PK PRIMARY KEY (LOCID) I: CREATE TABLE computer (CompID NUMBER (5), SNumber VARCHAR2 (15), Make VARCHAR2 (20), SuppID NUMBER (3), LocID NUMBER (3), Value NUMBER (6,2), Date purchased DATE, CONSTRAINT computer_compID_PK PRIMARY KEY (CompID), CONSTRAINT computer_suppID_FK FOREIGN KEY (suppID) REFERENCES supplier, CONSTRAINT computer 10CID FK FOREIGN KEY (10CID) REFERENCES location) : INSERT INTO supplier VALUES (122, 'Compag Sdn. Bhd', '10 Jalan Duta', '03-989898'); INSERT INTO supplier VALUES (123, 'ASUS Sdn. Bhd', '12 Jalan Duta', '03-2323231; INSERT INTO supplier VALUES (124, 'IBM Sdn.Bhd', '15 Jalan Duta', '03- 565656'): INSERT INTO supplier VALUES (125, 'Apple Sdn.Bhd', '18 Jalan Duta', '03-785676') INSERT INTO location VALUES (222, 'LAN', 343): INSERT INTO location VALUES (333, 'IRK', 343) INSERT INTO location VALUES (444, 'ICT', 343) INSERT INTO computer VALUES (13321, "XDX12345', "Compaq', 122, 222, 2300.50, 70 DATE ('12-JAN-2008', 'DD-MON-YYYY')): INSERT INTO computer VALUES (13322, 'XDX12344', 'ASUS PC', 123, 222, 3000.80, TO DATE ('17-JAN-2008', 'DD-MON-YYYY')): INSERT INTO Computer VALUES (13323, "XDX12343', 'IBM', 124, 333, 2800.50, TO_DATE ('12-DEC-2008', 'DD-MON-YYYY')); INSERT INTO computer VALUES (13324, "XDX12342', 'Apple', 125, 444, 5300.50, TO_DATE ('12-JUN-2009', 'DD-MON-YYYY')) : INSERT INTO computer VALUES (13325, "XDX12341', 'Apple', 125, 444, 6300.50, T0 DATE ('12-JUN-2009', 'DD-MON-YYYY')): INSERT INTO computer VALUES (13326, "XDX12346', 'Apple', 125, 444, 6000.85, 70 DATE ('12-JUN-2009', 'DD-MON-YYYY')): COMMITI
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Single Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr