1. Create a script that can be used to enter new orders into the ORDERS table. N
ID: 3657128 • Letter: 1
Question
1. Create a script that can be used to enter new orders into the ORDERS table. Name the script SC101.sql. 2. Add two new orders to the ORDERS table, using the SC101.sql script to make certain that it works properly. 3. Verify that the new orders have been properly added to the ORDERS table. 4. Create a script that can be used to update the ship date of orders in the ORDERS table. The row to be updated should be identified by the Order# column. Name the script SC104.sql. 5. Change the ship date of order 1012 to reflect that the order was shipped on April 9, 2003. 6. Verify that the ship date was correctly updated. 7. Use the SELECT...FOR UPDATE command to view the ship date for order 1016. 8. Use the DELETE command to remove order 1016 from the ORDERS table. 9. Undo any changes to the records in the ORDERS table. 10. Verify that the changes no longer exist in the ORDERS table.Explanation / Answer
As you don't give a table defination i assuming it as follows
CREATE TABLE ORDERS (
order int,
Second int,
Third Varchar(100),
Fourth Char(10),
shipdate datetime
)
1. INSERT INTO ORDERS Columns(order,Second,Third,Fourth,shipdate) Values(1,2,'ABCD','EFGH','11/21/2012 2:35:14.323 AM')
2.
INSERT INTO ORDERS Columns(order,Second,Third,Fourth) Values(1,2,'ABCD','EFGH','11/21/2012 2:35:14.323 AM')
INSERT INTO ORDERS Columns(order,Second,Third,Fourth) Values(7,10,,'Hello','Hi','11/21/2012 2:35:14.323 AM')
3.
SELECT * from ORDERS where order=1 OR order=7
4. UPDATE TABLE ORDERS SET shipdate='Date Change' where order=Order no
5. UPDATE TABLE ORDERS SET shipdate='April 9, 2003' where order=1012
6.
SELECT * from ORDERS where order=1012
7.
SELECT * from ORDERS where order=1012
8.
DELETE * from ORDERS where order=1012
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.