I need qUESTION 2 in the next 12 hours
Question 2: The following questions will help you to prepare your Upcoming Final Exam .
1. Create an ORDERS_(your initials) table based on the following:.
ORDID NOT NULL NUMBER(4)
ORDERDATE DATE
COMMPLAN VARCHAR2(1)
CUSTID NOT NULL NUMBER(6)
SHIPDATE DATE
2. Create an INVOICE table based on the following:
ORDID NOT NULL NUMBER(4)
ITEMID NOT NULL NUMBER(4)
DESCRIPTION NOT NULL VARCHAR2(20)
PRODID NUMBER(6)
ACTUALPRICE NUMBER(8,2)
QTY NUMBER(8)
ITEMTOT NUMBER(8,2)
3. Modify the INVOICE table to allow for longer DESCRIPTION names.
4. Create an INVOICE_2 table from the INVOICE table using a select statement.
5
.
Rename the INVOICE_2 table to INVOICE_3.
6. Add a comment to the INVOICE_3 table definitions describing the tables.
7. Drop the ITEMID column from the INVOICE table.
8. Create an INVOICE_4 table using a subquery based on the structure of the INVOICE table. Include only the ORDID, DESCRIPTION, PRODID and QTY columns. Name the columns in your new table INV ID, DESCRIPT, PROD ID and QUANTITY, respectively.
9. Add a first row of data to the INVOICE table with data of your own choosing. Do not list the columns in the INSERT clause.
10
. Populate the INVOICE table with the sample data. You are to create the values to enter into the table. This time, list the columns explicitly in the INSERT clause.
ORDID, DESCRIPTION, ITEMID, ACTUALPRICE, QTY, ITEMTOT, PRODID
13. Change the value for one of the DESCRIPTIONS.
14. Create a PRIMARY KEY constraint on the INVOICE table using the ORDID column. The constraint should be named at creation as a named table level constraint.
15. Add a named table level foreign key reference on the INVOICE table that will ensure that the PRODID is not assigned to a nonexistent PRODUCT.
16.
Modify the INVOICE_3 table. Add an ORD_DATE column of DATE datatype.
17. Modify the INVOICE table. Add a CHECK constraint to prevent any ACTUALPRICE greater than what you think is a reasonable level.
18. Modify the INVOICE table by making one of the columns NOT NULL.
19. Create a view called INVOICE_View based on four columns in the INVOICE table.
20
. Using your view INVOICE_View, enter a query to display values for three of the four columns included in the view.
21. Create a view named INV_VIEW_QUERY that does not allow an invoice DESCRIPTION to be changed through the view.
10 years ago
18
Purchase the answer to view it

- week_9_assignment.docx