In: Computer Science
This assignment refer to the “om” database (or Schema).
1.Write an INSERT statement that adds this row to the Items table:
a. Artist: Newly Added
b. Title: Assignment 3
c. unit_price: 0.0
d. ID: 12
2. Write an UPDATE statement that modifies the row you just added to the Items table. This statement should change the artist column to “RockOn”, and it should use the ID column to identify the row.
3. Write a DELETE statement that deletes the row you added to the Items table in above queries. This statement should use the ID column to identify the row.
4. Write an INSERT statement that adds this row to the Customers table:
a. Customer_id: 26
b. last_name: Raven
c. address: XYZ
d. City: town
e. State: ON
f. ZIP: ABCD
g. Phone: 987654321
5. Write an UPDATE statement that modifies the Customers table. Change the first_name column to “Rick” and last_name to “Fun” for the customer with Phone number: 987654321
A> "Items" Table :-
1> Insert data into the Items table using the INSERT STATEMENT
INSERT STATEMENT :- INSERT INTO Items VALUES(12,'Newly Added','Assignment 3',0.0)
Output:-
2> UPDATE the above data using UPDATE STATEMENT
UPDATE STATEMENT :- UPDATE Items SET Artist = 'RockOn' WHERE ID = 12;
Output:-
3> DELETE the above data using DELETE STATEMENT
UPDATE STATEMENT :- DELETE FROM items WHERE ID = 12;
Output:-
B> "Customer" Table :-
1> Insert customer detail into the Customer table.
INSERT STATEMENT:- INSERT INTO Customer(Customer_id,last_name,address,City,State,ZIP,Phone) VALUES(26,'Raven','XYZ','town','ON','ABCD',987654321);
Output:-
Here, we are not storing "first_name" data into the table so its column value is empty and we used INSERT STATEMENT which insert specific data into the table by specifing column name in after the table name into the round brackets.
2> Update above customer detail from Customer table.
UPDATE STATEMENT:- UPDATE Customer SET first_name = 'Rick', last_name = 'Fun' WHERE Phone = 987654321;
Output:-
I hope you will understand the above queries.
Do you feel needful and useful then please upvote me.
Thank you.