1.Write a SELECT statement that returns InvoiceId and Total from the Invoice table.  Use the CONCAT function to insert a ‘$’ in the front of  the total va
May 12, 2025
1 views
Check out this sample solution our expert writers created for a client with a "write assignment" task.
1.Write a SELECT statement that returns InvoiceId and Total from the Invoice table.  Use the CONCAT function to insert a ‘$’ in the front of  the total value
-- 2.Write a SELECT statement that returns CustomerId and average Total from the Invoice table grouped by customerId. Use the CONCAT function to insert a ‘$’ in the front of  the average total and the FORMAT function to to display it with commas and 2 decimal places.Â
-- 3. Â Use the CHAR and CONCAT functions (for the first and last names), to format the the address for each customer in the customer table - the formatted output should look like this
-- Gary Hernandez
-- 3829 Broadway Ave
-- New York, NY 10012Â
-- note ***** the output will not look like this in the workbench the CHAR functions will place columns in each row of the results *****
-- 4. Display the first initial, last name, and email address of each customer in the customer table.
-- 5. Return these columns from the customer table, customerid, email and Phone. Use the substr and lpad functions to render the phone number like this: ************9999
-- 6. use the concat_ws function to render to display the customer lastname and firstname in this manner: Lastname, Firstname. Also display the customer's email address but only list the customers whose email addresses have more than 20 charactersÂ
-- 7.Display the customerId and the phone for all customers who live in the USA, format the phone numbers so that they look like this 123-456-7899
-- 8. For every track in the track table, return the track name and the album title. The album title should be in all uppercase letters.Â
-- 9. For each track, display the unitprice, unitprice rounded to 1 decimal place, unitprice truncated to 1 decimal place, smallest integer >= unitprice and largest integer <= unitprice.Â
-- 10. For each track, display the trackId and a random number between 1 and 10 using the trackId as a seed.Â
Need a similar assignment?
Our expert writers can help you with your specific requirements. Get started today.