Part 1: q18 and q19 18. Provide the SQL code that will create the AGENT table. U
ID: 3833103 • Letter: P
Question
Part 1: q18 and q19
18. Provide the SQL code that will create the AGENT table. Use appropriate data types and define the Primary Key and Foreign Keys. Syntax counts.
19. Provide the SQL code that will create the CUSTOMER table. Use appropriate data types and define the Primary Key and Foreign Keys. Syntax counts.
USE THESE TABLES FOR QUESTIONS 18 THRU 23 CUSTOMER CUS CODE CUS NAME CUS ZIP AGENT CODE 1132445 Walker 32145 231 1217782 Adares 32145 125 1312243 Rakowski 34129 167 32134 1321242 Rodriguez 125 37134 421 1542311 Smithson 32145 1657399 Vanloo 231 AGENT AGENT CODE AGENT PHONE 6152439887 125 167 6153426778 231 6152431124 333 9041234445Explanation / Answer
For AGENT table:
CREATE TABLE agent
( agent_code numeric(10),
agent_phone numeric(20),
CONSTRAINT agent_pk PRIMARY KEY (agent_code)
);
For CUSTOMER table:
CREATE TABLE customer
( cus_code numeric(10) primary key,
cus_name varchar2(10),
cus_zip numeric(10),
agent_code numeric(10),
CONSTRAINT fk_agent
FOREIGN KEY (agent_code)
REFERENCES agent(agent_code)
);