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.
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.
Chapter4: Constraints
Section: Chapter Questions
Problem 6RQ: How is adding a NOT NULL constraint to an existing table different from adding other types of...
Related questions
Question
100%
INFO 2103
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F653d7600-0325-4034-b806-8968613887ad%2Ff8f86161-4779-468c-9b15-a97bef7c488d%2Fkpy2xia_processed.png&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![Oracle 12c: SQL](https://www.bartleby.com/isbn_cover_images/9781305251038/9781305251038_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781305627482/9781305627482_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781285196145/9781285196145_smallCoverImage.gif)
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
![Oracle 12c: SQL](https://www.bartleby.com/isbn_cover_images/9781305251038/9781305251038_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781305627482/9781305627482_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781285196145/9781285196145_smallCoverImage.gif)
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
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
![A Guide to SQL](https://www.bartleby.com/isbn_cover_images/9781111527273/9781111527273_smallCoverImage.gif)
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr