Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Delete orders #18 and higher from the orders table; print all data of the orders table before and after the deletion 2. Select all

1. Delete orders #18 and higher from the orders table; print all data of the orders table before and after the deletion

2. Select all columns from orders table, and then using a join, get the customer last name from customer table, and have it print in alphabetical order by customer's last name.

Database needed for the two questions above:

image text in transcribed

mysql> select * from orders; AcctNum Order Num Order Date StoreNum Sales RepNum 4552 3679 1234 5623 4552 3679 1234 5623 4552 3679 1234 5623 4552 3 6 7 8 9 10 11 12 13 14 15 16 17 2004-01-03 2004-01-05 2004-01-07 2004-01-09 2004-01-11 2004-01-13 2004-01-15 2004-01-17 2004-01-19 2004-01-21 2004-01-23 2004-01-25 2004-01-27 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 3 3 1 2 3 3 2 1 NULL 13 rows in set (0.00 sec) mysql> select * from order_detail; | OrderNum LineNum ProdNum | Qty Color UnitPrice 3 6 7 8 8 9 10 11 12 12 13 14 15 16 17 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 Bike28A Bike28A Bike28A Bike28B ridinggloves Bike28B Bike28B Moped 77 Bike31A Helmet Bike31A Bike28 Bike28Cruiser Bike28 Schwinn SchwinBike 2 8Mountain 1 2 NULL 3 7 2 5 1 1 4 1 1 3 1 2 Red Blue Green Red White Blue Green Black Red 300.00 259.00 525.00 455.00 60.00 255.00 199.00 955.00 525.00 75.00 455.00 255.00 199.00 955.00 855.00 Red Blue Orange White Red Blue 15 rows in set (0.00 sec) mysql> select * from product; ProdNum ProdName ProdSupy ColorGrp | ProdCost Bike28 Bike28A Bike28B Bike28Cruiser Bike28 Schwinn Bike31A Helmet Moped 77 ridinggloves SchwinBike28 Mountain standard29InBike Trek28InBike Speedo 28InBike Cruiser 28InBike Schwinn28InBike Trek31InBike standardhelmet Moped 77 KPN standardRidingGloves Schwinn28InMountainbike Generic Trek Speedo AmBike Schwinn Trek AmManuf KPNEnterprise RidingSuppInc Schwinn 8colors 8colors 8colors 8colors 8colors 8colors RWB WhtBlk WhtBlk 8colors NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 10 rows in set (0.00 sec) mysql> select * from salesrep; | SalesRepNum Sales FName SalesLName Sales SSN Sales HDate Sales HRate Sales Bonus 1 2 3 Mike Alice Mary Smith Johnson Halvorson 222-33-4444 999-11-8888 333-00-9999 2001-01-01 2004-05-01 2004-06-01 25 27 22 4000.00 8000.00 NULL 3 rows in set (0.00 sec)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions