CREATE TABLE computer (ComplD NUMBER(5), SNumber VARCHAR2(15), Make VARCHAR2(20), SuppID NUMBER(3), LocID NUMBER(3). Value NUMBER(6,2), Date_purchased DATE, CONSTRAINT computer_complD_PK PRIMARY KEY...


CREATE TABLE computer<br>(ComplD NUMBER(5),<br>SNumber VARCHAR2(15),<br>Make VARCHAR2(20),<br>SuppID NUMBER(3),<br>LocID NUMBER(3).<br>Value NUMBER(6,2),<br>Date_purchased DATE,<br>CONSTRAINT computer_complD_PK PRIMARY<br>KEY (compID),<br>CONSTRAINT computer_suppID FK FOREIGN<br>KEY (suppiD) REFERENCES supplier,<br>CONSTRAINT computer_locID_FK FOREIGN KEY<br>(locID) REFERENCES location);<br>INSERT INTO supplier VALUES (122, 'Compaq<br>Sdn.Bhd', '10 Jalan Duta', '03-989898');<br>INSERT INTO supplier VALUES (123, 'ASUS<br>Sdn.Bhd', '12 Jalan Duta', '03-232323');<br>INSERT INTO supplier VALUES (124, 'IBM<br>Sdn.Bhd', '15 Jalan Duta', '03-565656');<br>INSERT INTO supplier VALUES (125, 'Apple<br>Sdn.Bhd', '18 Jalan Duta', '03-785676');<br>INSERT INTO location VALUES (222, 'LAW', 343);<br>INSERT INTO location VALUES (333, 'IRK', 343);<br>INSERT INTO location VALUES (444, ICT', 343);<br>INSERT INTO computer VALUES (13321,<br>'XDX12345', 'Compaq', 122, 222, 2300.50,<br>TO DATE('12-JAN-2008', 'DD-MON-YYYY');<br>INSERT INTO computer VALUES (13322,<br>

Extracted text: CREATE TABLE computer (ComplD NUMBER(5), SNumber VARCHAR2(15), Make VARCHAR2(20), SuppID NUMBER(3), LocID NUMBER(3). Value NUMBER(6,2), Date_purchased DATE, CONSTRAINT computer_complD_PK PRIMARY KEY (compID), CONSTRAINT computer_suppID FK FOREIGN KEY (suppiD) REFERENCES supplier, CONSTRAINT computer_locID_FK FOREIGN KEY (locID) REFERENCES location); INSERT INTO supplier VALUES (122, 'Compaq Sdn.Bhd', '10 Jalan Duta', '03-989898'); INSERT INTO supplier VALUES (123, 'ASUS Sdn.Bhd', '12 Jalan Duta', '03-232323'); 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, 'LAW', 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, TO 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, TO DATE('12-JUN-2009', 'DD-MON-YYYY"); INSERT INTO computer VALUES (13326, "XDX12346', 'Apple', 125, 444, 6000.85, TO_DATE('12-JUN-2009', 'DD-MON-YYYY"); COMMIT;
For this assignment, please use the SUPPLIER and<br>COMPUTER table. The script is available in both<br>iTaleemC and GC. Script name: computer.sql.<br>Note: Use Subqueries<br>1. Display the name of supplier(s) that supplied<br>the most expensive computer?<br>2. Display the name of supplier(s) that supplied<br>more expensive computer than that being<br>supplied by IBM.<br>3. Display the supplier that supplied the most<br>computers.<br>4. Display the building location that has the most<br>computers.<br>Considering the tables are:<br>DROP TABLE computer CASCADE<br>CONSTRAINTS;<br>DROP TABLE location CASCADE CONSTRAINTS;<br>DROP TABLE supplier CASCADE CONSTRAINTS;<br>CREATE TABLE supplier<br>(SupplD NUMBER(3),<br>SName VARCHAR2(15),<br>SAddress VARCHAR2(20),<br>SPhone VARCHAR2(12),<br>CONSTRAINT supplier supplD_PK PRIMARY KEY<br>(suppID));<br>CREATE TABLE location<br>(LocID NUMBER(3),<br>Bldg code CHAR(4).<br>RoomNo NUMBER(3),<br>CONSTRAINT Iocation_locid_PK PRIMARY KEY<br>(LocID));<br>

Extracted text: For this assignment, please use the SUPPLIER and COMPUTER table. The script is available in both iTaleemC and GC. Script name: computer.sql. Note: Use Subqueries 1. Display the name of supplier(s) that supplied the most expensive computer? 2. Display the name of supplier(s) that supplied more expensive computer than that being supplied by IBM. 3. Display the supplier that supplied the most computers. 4. Display the building location that has the most computers. Considering the tables are: DROP TABLE computer CASCADE CONSTRAINTS; DROP TABLE location CASCADE CONSTRAINTS; DROP TABLE supplier CASCADE CONSTRAINTS; CREATE TABLE supplier (SupplD NUMBER(3), SName VARCHAR2(15), SAddress VARCHAR2(20), SPhone VARCHAR2(12), CONSTRAINT supplier supplD_PK PRIMARY KEY (suppID)); CREATE TABLE location (LocID NUMBER(3), Bldg code CHAR(4). RoomNo NUMBER(3), CONSTRAINT Iocation_locid_PK PRIMARY KEY (LocID));
Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here