Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1 (5 marks) Question 1 CREATE TABLE called supplier with the following fields supplier_id numeric(10) -> Primary key with constraint name supplier_name varchar2(50) -
Question 1 (5 marks) Question 1 CREATE TABLE called supplier with the following fields supplier_id numeric(10) -> Primary key with constraint name supplier_name varchar2(50) - >unique name contact_name varchar(50) city varchar2(10) Region -> should accept only ('N'. 'NW', 'NE'S 'SE', 'SW', 'W' 'E') 1 Insert 5 records. Insert records based on the below questions 2 Display the details of the supplier who comes from Toronto and their supplier id 500 3 Add phone number in the supplier table using DOL command 4. Write a scl command to make city as unused column 5 Delete the unused column in the supplier table 6 Rename table SUPPLIER -> SUPPLIER CONTACT 7 Write a sql command to delete all the records in the supplier table 8 Write a sal command to Retrieve the deleted table 9. Write a sql command to permanently delete the table so that it is not moved to recyclebin Question 2 (5 marks) Create 2 tables based on the ER model shown below. Include all the constraints in the CREATE TABLE statements You should have only two create Table statements and no ALTER TABLE statements. Name all constraints except NOT NULLS 20. EMPIRE COMPETECH.CH WERSYTE MART LOCATION NAME DEPARTMENT DEPARTMENT DEPARTMENT MUSCATORIA BER EMPLOYEES Use the column datatypes and sizes as indicated in the ER model ENO and DNO are used to uniquely identify rows in these tables Each Employee must be assigned a Department, and no duplicate department names are allowed Assign commission default value o The Salary entered should be greater than zero If the data is given in Gender coloumn, only 'M' or are acceptable values Each table should have 5 data records in them Create and execute the SQL statements needed to enforce the data relationships among these tables
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started