Question

In: Computer Science

This assignment refer to the “om” database (or Schema).      1.Write an INSERT statement that adds this...

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  

Solutions

Expert Solution

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.


Related Solutions

All questions in this assignment refer to the “om” database (or Schema) that you will find...
All questions in this assignment refer to the “om” database (or Schema) that you will find in your MySQL Workbench program if you have run the sample database install script. Please save all of your answers in one script (.sql) or type all your answers into Notepad++ and submit them as a single .sql file. You are encouraged to test your SQL statements in Workbench, and please use the ‘tidy’ tool to properly format your SQL before you save it...
This refer to the “om” database (or Schema) that you will find in your MySQL Workbench...
This refer to the “om” database (or Schema) that you will find in your MySQL Workbench program if you have run the sample database install script. Please save all of your answers in one script (.sql) or type all your answers into Notepad++ and submit them as a single .sql file. Please test your SQL statements in Workbench 1.       Using an INNER JOIN, select the order_id, order_date, shipped_date, fname, and customer_phone from the orders and customers tables. The fname is a...
1) Write an INSERT statement that adds this row to the Invoices table: i nvoice_id: The...
1) Write an INSERT statement that adds this row to the Invoices table: i nvoice_id: The next automatically generated ID vendor_id : 32 invoice_number: AX-014-027 invoice_date: 8/1/2014 invoice_total: $434.58 payment_total: $0.0 credit_total: $0.0 terms_id: 2 invoice_due_date: 8/31/2014 payment_date: null Write this statement without using a column list.: Use DEFAULT to insert the automatically generated ID. 2) Write an INSERT statement that adds these rows to the Invoice_line_Items table: invoice_sequence: 1 2 account_number: 160 527 line_item_amount: $180.23 $254.35 line_item_description: Hard drive...
1. Discuss the elements of a database system. Like The database schema Schema objects Indexes Tables...
1. Discuss the elements of a database system. Like The database schema Schema objects Indexes Tables Fields and columns Records and rows Keys Relationships Data types 2. Discuss the key components of a database management system architecture and how they collaborate. 3. Discuss why a database management system needs a good query optimizer.
7. Using the provided schema of a Purchase Order Administration database, write the following queries in...
7. Using the provided schema of a Purchase Order Administration database, write the following queries in SQL. (In the schema, bold attributes are primary keys and italicized attributes are foreign keys.) SUPPLIER (SUPNR, SUPNAME, SUPADDRESS, SUPCITY, SUPSTATUS) SUPPLIES (SUPNR, PRODNR, PURCHASE_PRICE, DELIV_PERIOD) PRODUCT (PRODNR, PRODNAME, PRODTYPE, AVAILABLE_QUANTITY) PO_LINE (PONR, PRODNR, QUANTITY) PURCHASE_ORDER (PONR, PODATE, SUPNR) 7d) Write a nested SQL query to retrieve the supplier number, supplier name, and supplier status of each supplier who has a higher supplier status...
Question 2: consider the following library relational database schema Write a program segment to retrieves the...
Question 2: consider the following library relational database schema Write a program segment to retrieves the list of books that became overdue yesterday and that prints the book title and borrower name for each. 1- Use JDBC with Java as the host language
Assignment 7: Congressional Vote Tracking Database Description Design an Extended E-R schema diagram for keeping track...
Assignment 7: Congressional Vote Tracking Database Description Design an Extended E-R schema diagram for keeping track of information about votes taken in the U.S. House of Representatives and Senate during the current two-year congressional session.  The database needs to keep track of each U.S. STATE's Name (e.g. Texas, New York, Pennsylvania, etc.) and include the Region of the state (whose domain is {North-east, Midwest, Southeast, West}).  Each CONGRESSPERSON in the House of Representatives is described by his or her Name, plus the...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The first database table will contain the names of at least four movies. The second table will be a list of actors who appear in the movies. The third table will be an associative table that describes the relationship between the actors and their movies (which actors appear in which movies). Actors and movies have a “many-to-many relationship,” meaning an actor can be in multiple...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The first database table will contain the names of at least four movies. The second table will be a list of actors who appear in the movies. The third table will be an associative table that describes the relationship between the actors and their movies (which actors appear in which movies). Actors and movies have a “many-to-many relationship,” meaning an actor can be in multiple...
1: Use the customers table inside of the salesordersexample database, and write a query statement to...
1: Use the customers table inside of the salesordersexample database, and write a query statement to show records from the CustFirstName, CustLastName, and CustCity columns. 2:  Use the employees table inside of the salesordersexample database, and write a query statement to show the employee’s EmployeeID, EmpFirstName, EmpLastName, and EmpPhoneNumber, if the employee is living in the 98413 zip code. 3. Use INNER JOIN to create a query result. In this query result, list each vendor’s name and the name of each...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT