CREATE TABLE called supplier with the following fields. supplier_id numeric(10) -> Primary key with constraint name...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 varchar2(50) city varchar2(10) Region should accept only ('N', 'NW', 'NE', 'S', 'SE', 'SW', 'W', 'E') 1. Insert 8 records (Insert records based on the below questions). 2. Display the details of the supplier who comes from Toronto and their supplier id 500 (note: you need to use make believe data). 3. Add phone number in the supplier table using DDL command 4. Write a sql 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 sql 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 COMP122W21_002_P_40.EMPLOYEE P ENO ENAME * JOB MANAGER * JDATE GENDER CHAR (4 BYTE) VARCHAR2 (30 BYTE) VARCHAR2 (30 BYTE) CHAR (4 BYTE) TIMESTAMP CHAR (1 BYTE) SALARY NUMBER (8.2) COMISSION NUMBER (8,2) F DEPTNO NUMBER (0) EMPLOYEE_PK (ENO) SYS_CO0853807 (DEPTNO) COMP122W21_002_P_40.DEPARTMENT NUMBER (0) VARCHAR2 (30 BYTE) PDNO U DNAME U DLOCATION VARCHAR2 (30 BYTE) DEPARTMENT_PK (DNO) DEPARTMENT_DNAME_UN (DNAME) DEPARTMENT_DLOCATION_UN (DLOCATION) 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 0. The Salary entered should be greater than zero. If the data is given in Gender column, only 'M' or 'F' are acceptable values Each table should have 8 data records in them Create and execute the SQL statements needed to enforce the data relationships among these tables. 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 varchar2(50) city varchar2(10) Region should accept only ('N', 'NW', 'NE', 'S', 'SE', 'SW', 'W', 'E') 1. Insert 8 records (Insert records based on the below questions). 2. Display the details of the supplier who comes from Toronto and their supplier id 500 (note: you need to use make believe data). 3. Add phone number in the supplier table using DDL command 4. Write a sql 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 sql 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 COMP122W21_002_P_40.EMPLOYEE P ENO ENAME * JOB MANAGER * JDATE GENDER CHAR (4 BYTE) VARCHAR2 (30 BYTE) VARCHAR2 (30 BYTE) CHAR (4 BYTE) TIMESTAMP CHAR (1 BYTE) SALARY NUMBER (8.2) COMISSION NUMBER (8,2) F DEPTNO NUMBER (0) EMPLOYEE_PK (ENO) SYS_CO0853807 (DEPTNO) COMP122W21_002_P_40.DEPARTMENT NUMBER (0) VARCHAR2 (30 BYTE) PDNO U DNAME U DLOCATION VARCHAR2 (30 BYTE) DEPARTMENT_PK (DNO) DEPARTMENT_DNAME_UN (DNAME) DEPARTMENT_DLOCATION_UN (DLOCATION) 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 0. The Salary entered should be greater than zero. If the data is given in Gender column, only 'M' or 'F' are acceptable values Each table should have 8 data records in them Create and execute the SQL statements needed to enforce the data relationships among these tables.
Expert Answer:
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date:
Students also viewed these databases questions
-
can I get some help on Solving letter C? thank you!
-
Data set Theory Assume an informational record with one association parent including matches (a, b) where a can't try not to be a parent of b. (a) Write a Datalog demand which gives the graph of...
-
(a) Explain how a limit worth may be tended to at run-time, both in a syntaxtree middle person and in collected code. What is the importance word "settled" already? [3 marks] (b) Give a model program...
-
Implement a Digraph data type that represents directed graphs, where the direction of edges is significant: \(\operatorname{addEdge}(v, w)\) means to add an edge from \(v\) to \(w\) but not from...
-
Explain the model for organizational behavior that is used in this text.
-
A trader writes five naked put option contracts, with each contract being on 100 shares. The option price is $10, the time to maturity is six months, and the strike price is $64. (a) What is the...
-
What was the arithmetic average return to PDL during this period? a. 4.32% b. 6.45% c. 6.89% d. 7.78% 2001 2002 Year Return (%) 37.34 -23.67 2003 15.45 2004 17.87 2005 -8.08
-
You are an audit supervisor assigned to a new client, Go-Go Corporation, which is listed on the New York Stock Exchange. You visited Go-Gos corporate headquarters to become acquainted with key...
-
Sachs Brands's defined benefit pension plan specifies annual retirement benefits equal to 1.6% service years final year's salary, payable at the end of each year. Angela Davenport was hired by Sachs...
-
Using the case study NFL'S SCOOFLES: SCOOPED WITH MARKETING RESEARCH PROBLEM? answer these questions As the Market Researcher of the company, what steps would you follow to clarify the situation and...
-
Assume BBB stock price is currently $20. In each six-month period, it will either fall by 50 percent or rise by 100 percent. What is the current value of a one-year call option with an exercise price...
-
A parked police car takes off after a suspect and reaches 78.5 km/h East in 8.20 seconds. What is the average acceleration (m/s^2) of the car? | Select an answer Enter an integer or decimal number,...
-
1. What is the essence of communication for women? How about for men? 2. Describe the masculinity-femininity dimension and offer a specific example not listed in the reading. 3. Why is there a...
-
Two tiny conducting spheres are identical and carry charges of -17.4 C and +43.7 C. They are separated by a distance of 2.39 cm. (a) What is the magnitude of the force that each sphere experiences?...
-
a . Show the optimum using indifference curves and a feasible set diagram. b . Show how this optimum might change if Alexei s indifference curves were ( i ) shallower, and ( ii ) steeper. c . How...
-
Alyeska Services Company, a division of a major oil company, provides various services to the operators of the North Slope oil field in Alaska. Data concerning the most recent year appear below:...
-
In Problem 8.43, determine the smallest value of for which the rod will not fall out of the pipe. IA -3 in.-
-
The Mission Company Ltd, whose year-end is 31 December, has acquired two items of machinery on leases, the conditions of which are as follows: Item Y: Ten annual instalments of 20,000 each, the first...
-
Peter Mullen says in an article sent in to the ASB, the following: the ASB advocates that all leasing type deals should essentially be accounted for in relation to the extent of asset and liability...
-
(a) When accounting for finance leases, accountants prefer to overlook legal form in favour of commercial substance. Required: Discuss the above statement in the light of the requirements of IAS 17...
Study smarter with the SolutionInn App