Part 2: q20 to q23 20. Provide SQL code to Insert one row into the CUSTOMER tabl
ID: 3833114 • Letter: P
Question
Part 2: q20 to q23
20. Provide SQL code to Insert one row into the CUSTOMER table you just created. Use values of your choice.
21. Provide SQL code to create a sequence that could be used to generate the primary key for the AGENT table. Syntax counts.
22. Write an SQL statement that will delete the CUST_ZIP column in the CUSTOMER table.
23. Write an SQL statement to remove the AGENT table and all its contents.
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
1.insert into customer values(1764935,'John',32145,125);
2.seq ni can be done in 4 steps .add primafykey column to table ,create sequence, update table,make it primary key.
Alter table AGENT ADD (agent_id number);
Create sequence agent_id_seqagent_id_seq.nextval;
3.alter table CUSTOMER
drop column CUST_ZIP;
4.drop Command removes all defntn and data.
DROP TABLE agent;
Make it primary key
ALTER TABLE AGENT
ADD CONSTRAINT pk_agent_I'd PRIMARY KEY(agent_id);
START WITH 1
INCREMENT BY 1
CACHE 20;
Update AGENT
SET agent_id=