my sql

Swodes

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. 


    • 4 years ago
    • 10
    Answer(0)