My SQL 1. 2. 3. 4. 5.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

My SQL 1. 2. 3. 4. 5.

Post by answerhappygod »

My SQL
1.
My Sql 1 2 3 4 5 1
My Sql 1 2 3 4 5 1 (33.62 KiB) Viewed 42 times
2.
My Sql 1 2 3 4 5 2
My Sql 1 2 3 4 5 2 (49.86 KiB) Viewed 42 times
3.
My Sql 1 2 3 4 5 3
My Sql 1 2 3 4 5 3 (58.55 KiB) Viewed 42 times
4.
My Sql 1 2 3 4 5 4
My Sql 1 2 3 4 5 4 (62.05 KiB) Viewed 42 times
5.
My Sql 1 2 3 4 5 5
My Sql 1 2 3 4 5 5 (57.15 KiB) Viewed 42 times
Using the customers table in the OM database, write a SELECT statement that concatenates first name and last name into a name with the column alias of "Full Name". Order by last name and then first name. Here is an example of the expected output: Result Grid ▶ Full Name Trisha Anum Dakota Baylee Korah Blanca Julian Carson Derek Chaddick Deborah Damien Mikayla Damion Kelsey Eulalia Rashad Holbrooke Kaitlin Hostlery Ania Irvin Samuel Jacobsen Justin Javen Erick Kaleigh Gonzalo Keeton Karina Lacy Kyle Marissa Kendall Mayte Johnathon Millerton Thalia Neftaly Kurt Nickalus Marvin Quintin Yash Randall Anders Rohansen Kirsten Story
Using the items table in the OM database, write a SELECT statement that shows item_id, title, artist and calculates a new price by multiplying the unit_price in the items table by 1.08. Round the result to two decimal places and assign the alias "new_price". Sort the output by price in descending order. Here is an example of your output: Round function: https://www.w3schools.com/sql/func To multiply a numeric field by 2 for example, you can simply use: SELECT numeric_field * 2 AS "Alias" item_id title H&SAMSON 8 10 Umami In Concert More Songs About Structures and Comestibles Burt Ruggles: An Intimate Portrait On The Road With Burt Ruggles Etcetera sqlserver round.asp No Rest For The Weary No Fixed Address Zone Out With Umami Race Car Sounds Rude Noises artist Umami No Rest For The Weary Burt Ruggles Burt Ruggles Onn & Onn No Rest For The Weary Sewed the Vest Pocket Umami The Ubernerds Jess & Odie new_price 19.39 19.39 19.39 18.90 18.36 18.31 18.31 18.31 14.04 14.04
Using the OM database, write a SELECT statement that shows customer last name from the customers table and order date and shipped date from the orders table. Use table aliases and the JOIN ON technique to output the data sorted by customer last name. Here is an example of the expected output: Info on Joins: https://www.w3schools.com/sql/sql_join.asp Inner Join Function: https://www.w3schools.com/sql/sql_join_inner.asp Aliases: https://www.w3schools.com/sql/sql_alias.asp Result Grid Filter Rows: customer_last_name order_date shipped_date 2017-06-24 2017-07-06 2018-02-08 2018-02-14 2018-04-21 2018-04-27 2012-10-23 2016-10-28 2018-01-30 2018-03-03 Anum Baylee Baylee Blanca Blanca Blanca Carson Chaddick Damien Damion Eulalia Holbrooke Hostlery Irvin Jacobsen Jacobsen Jacobsen Jacobsen Jacobsen Jacobsen Javen NULL 2018-08-01 2017-04-25 2017-05-30 2017-11-08 2017-11-16 2012-11-05 2016-11-11 2018-02-10 2018-02-14 2012-11-10 2016-11-13 2017-01-20 2017-01-22 2018-04-25 2018-05-02 2017-06-14 2017-06-22 2017-03-21 2017-03-29 2017-12-05 2018-01-11 2018-03-23 2018-04-03 2018-05-05 2018-05-10 2018-06-05 2018-06-08 2018-07-19 2018-07-26 2017-08-18 2017-09-22 Export:
You are tasked with the job of displaying title, artist and order_qty for items ordered. Formulate a query (include comments) to accomplish this task using table aliases and sorting by title. Here is an example of the output: Result Grid title Burt Ruggles: An Intimate Portrait Burt Ruggles: An Intimate Portrait Burt Ruggles: An Intimate Portrait Burt Ruggles: An Intimate Portrait Burt Ruggles: An Intimate Portrait Etcetera Etcetera Etcetera Etcetera Etcetera Etcetera Etcetera Etcetera Filter Rows: More Songs About Structures an... More Songs About Structures an... More Songs About Structures an... More Songs About Structures an... More Songs About Structures an... More Songs About Structures an... More Songs About Structures an... More Songs About Structures an... No Fixed Address artist Burt Ruggles Burt Ruggles Burt Ruggles Burt Ruggles Burt Ruggles Onn & Onn Onn & Onn Onn & Onn Onn & Onn Onn & Onn Onn & Onn Onn & Onn Export: order_qty 1 1 1 1 1 1 1 1 1 1 1 1 Onn & Onn 1 No Rest For... 1 No Rest For... 1 No Rest For... 1 No Rest For... 1 No Rest For... 1 No Rest For... 1 No Rest For... 1 No Rest For... 1 Sewed the ... 1 Take a screenshot that includes your query (be sure to include comments) code, sample output, and action output window. Add this to your document to submit.
Next, we're going to add another table to the statement. Edit your query from the previous step to include customer_id (this requires adding the orders table.) sort by customer_id and then title. Here is an example of the output: Filter Rows: Result Grid customer_id 1 1 1 1 2 NNNNNMM & in 67 2 2 2 2 3 3 4 5 8 8 9 9 9 title More Songs About Structures and Comestibles No Rest For The Weary On The Road With Burt Ruggles Rude Noises Umami In Concert Etcetera No Rest For The Weary Race Car Sounds Rude Noises Zone Out With Umami Umami In Concert Export: Zone Out With Umami Race Car Sounds Umami In Concert Burt Ruggles: An Intimate Portrait Umami In Concert Etcetera No Rest For The Weary Burt Ruggles: An Intimate Portrait Etcetera More Songs About Structures and Comestibles No Fixed Address Wrap Cell Content: A artist No Rest For The Weary No Rest For The Weary Burt Ruggles Jess & Odie Umami order_qty 1 1 1 2 2 Onn & Onn 1 No Rest For The Weary 1 The Ubernerds 1 Jess & Odie Umami Umami Umami The Ubernerds Umami Burt Ruggles Umami Onn & Onn No Rest For The Weary 1 1 1 1 Burt Ruggles Onn & Onn No Rest For The Weary Sewed the Vest Pocket 1 1 1 1 1 1 1 1 1 Take a screenshot that includes your query (be sure to include comments) code, sample output, and action output window. Add this to your document to submit.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply