Question: Consider the following model: Check the Assignment 3 solution and compare it with your work. Make necessary changes to your work, if needed. Use the
Consider the following model:
Check the Assignment solution and compare it with your work. Make necessary changes to your work, if needed.
Use the attached SQL script named HSDInsertData.sql to insert the data for the HSD database. Just run the file.
Create a SQL script named HSDData.sql and add the following SQL statements:
a Write an SQL statement to modify PRODUCT UnitPrice for ProductNumber VK to $ instead of the current UnitPrice of $
b Add a column called SeminarDescription to the SEMINAR table. The new column should be maximum of characters, and it is not null.
c Write a statement to drop the column SeminarDescription
d Imagine you have a table in the schema called IMPORTEDPRODUCT that has the same structure as the PRODUCT table. Write a statement to insert all the data from the IMPROTEDPRODUCT to the PRODUCT table.
Note: The statement may not run in old versions of MySQL
Create a SQL script named HSDMoreData.sql and add the following SQL statements:
a Write an SQL statement to create a view called InvoiceSummaryView that contains INVOICE.InvoiceNumber, INVOICE.InvoiceDate, LINEITEM.LineNumber, LINEITEM.ProductNumber, PRODUCT.ProductDescription, and LINEITEM.UnitPrice.
b Create and test a userdefined function named LastNameFirst that combines two parameters named FirstName and LastName into a concatenated name field formatted LastName, FirstName including the comma and space
c Write an SQL statement to create a view called CustomerInvoiceSummaryView that contains INVOICE.InvoiceNumber, INVOICE.InvoiceDate, the concatenated customer name using the LastNameFirst function, CUSTOMER.EmailAddress, and INVOICE.Total.
d Create a stored procedure that selects Customers first name and last name from a certain City with a certain ZipCode. May not be run; just write a procedure
e Create a stored procedure out of the INVOICE table that selects a field as the sum of Total and Shipping if Subtotal is less than and selects a field as the Total only if Subtotal is equal or greater than May not be run; just write a procedure
Compress to ZIP file, the files HSDMoreData.sql and HSDMoreData.sq and upload it to the portal.
End of Assignment # Good Luck
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
