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...
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...
using the lyrics database schema in mysql provided below. 1.)List the artist name of the artists...
using the lyrics database schema in mysql provided below. 1.)List the artist name of the artists who do not have a webaddress and their leadsource is “Directmail”? 2.)List the names of members in the artist called 'Today'. 3.)Report the total runtime in minutes FOR EACH album in the Titles table. 4.)List the firstname, lastname of members who are represented by the salesperson “Lisa Williams” 5.)List EACH salesperson’s firstname along with the number of Members that EACH SalesPerson represents. below is...
Assignment Description: Write a MIPS assembly language program that adds the following two integers and displays...
Assignment Description: Write a MIPS assembly language program that adds the following two integers and displays the sum and the difference. In the .data section, define two variables num1 and num2 both words. Initialize num1 to 92413 10 and num2 to D4B 16 (use 0xD4B to initialize, Note that D4B is a hexadecimal number). Your main procedure/function should load the values of num1 and num2 into two temporary registers, and display them on the console window. Then add the values...
Please write the SQL statement for the following. I am using the Adventurework2014 database. 1. Create...
Please write the SQL statement for the following. I am using the Adventurework2014 database. 1. Create a login for AdventureWorks employees. An employee login should be composed of the first letter of a person's first name combined with their last name. In addition, the login should be all lower case characters. All the required information is located in Person.Person table. Employees can be identified by "EM" value in the PersonType field. The output should include BusinessEntityID, first name (FirstName), last...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT