I have already done the first eight questions, so no need for those. Just need the query statements in a text file is all. Thanks a lot for your help.
1. Create an ORDERS_(your initials) table based on the following:.
ORDID NOT NULL NUMBER(4)
CUSTID NOT NULL NUMBER(6)
2. Create an INVOICE table based on the following:
ORDID NOT NULL NUMBER(4)
ITEMID NOT NULL NUMBER(4)
DESCRIPTION NOT NULL VARCHAR2(20)
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.
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.
. 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
11. Create a script named LOAD_DATA_(your initials).sql to load rows into the INVOICE table interactively. Prompt the user for the values . Specify a default value for the QTY.
12. Populate the table with the four rows of sample data by running the script that you created.
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.
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. Use SQL*PLUS formatting commands to create column headings for the four columns.
. Using your view INVOICE_View, enter a query to display values for three of the four columns included in the view.
I'm using sqlplus but they only need to be written out in a text file, no return results are needed. I've actually already done the first 12 on the list, so you would only need to answer 13 through 21. I can send you the text file of what I have so far so you can see the format.
Yes it is Oracle.
Here is the link.
Here is question 21.
Create a view named INV_VIEW_QUERY that does not allow an invoice DESCRIPTION to be changed through the view.
Thank you, XXXXX XXXXX be able to finish tonight?
Hello again Matt,Based on Question 15, this is to be completed on an existing database. It states that you are to create a foreign key to products. Since the product table was not created in this assignment, it must already exist.Please let me know what the columns in the product table are.
It says the product table was non existent. There should not be anything based on an existing table as the assignment was expected for me to just write the queries in a text file and send. Did not have to be done on a putty server or in a Oracle database. Hope this helps. If all else fails just skip question 15 if you have too.
Thank you very much. SQL is definitely not my area of expertise but still needed to take the course. Thanks again for your time and also for explaining what I was doing wrong. Have a great day.