Question: This is for MySQL for the AdventureWorks2017 database. This does not require a subquery. Management at AdventureWorks wants to determine the day of the week

This is for MySQL for the AdventureWorks2017 database.

This does not require a subquery. Management at AdventureWorks wants to determine the day of the week which have the most sales in 2012. You will use the Sales.SalesOrderHeader table. You will need the following functions DATENAME, SUM, COUNT. List the Day of the Week, Total Revenue (based on the SubTotal), the number of orders and the Revenue per Order. Sort the results by the Revenue per Order with the largest first.

This is for MySQL for the AdventureWorks2017 database. This does not requirea subquery. Management at AdventureWorks wants to determine the day of the

Table Sales.SalesOrderHeader (31,465 rows) General sales order information. Column Data Type Identity Nullable Default PK Sales OrderID int Primary key. Revision Number tinyint Incremental number to track changes to the sales order over time. Order Date Rectadatetime getdate() Dates the sales order was created. DueDate datetime Date the order is due to the customer. Ship Date datetime Date the order was shipped to the customer. Status tinyint Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled OnlineOrderFlag Flag(bit) 0 = Order placed by sales person. 1 = Order placed online by customer. UK Sales OrderNumber nvarchar(25) Unique sales order identification number. Purchase Order Number Order Number(nvarchar(25)) Customer purchase order number reference. Account Number Account Number(nvarchar(15)) Financial accounting number reference. FK CustomerID int Customer identification number. Foreign key to Customer. BusinessEntityID. FK Sales PersonID int Sales person who created the sales order. Foreign key to SalesPerson.Business EntityID. FK TerritoryID Territory in which the sale was made. Foreign key to Sales Territory. SalesTerritoryID. FK BillToAddressID int Customer billing address. Foreign key to Address.AddressID. int FK int FK FK int FK Ship ToAddressID Customer shipping address. Foreign key to Address.AddressID. ShipMethodID int Shipping method. Foreign key to ShipMethod. ShipMethodID. Credit CardID Credit card identification number. Foreign key to Credit Card. CreditCardID. Credit Card ApprovalCode varchar(15) Approval code provided by the credit card company. Currency RateID int Currency exchange rate used. Foreign key to Currency Rate.Currency RateID. SubTotal money 0.00 Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. TaxAmt money 0.00 Tax amount. Freight money 0.00 Shipping cost. TotalDue money Total due from customer. Computed as Subtotal + TaxAmt + Freight. Comment nvarchar(128) Sales representative comments. rowguid uniqueidentifier newid ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. ModifiedDate datetime getdate() Date and time the record was last updated. UK Table Sales.SalesOrderHeader (31,465 rows) General sales order information. Column Data Type Identity Nullable Default PK Sales OrderID int Primary key. Revision Number tinyint Incremental number to track changes to the sales order over time. Order Date Rectadatetime getdate() Dates the sales order was created. DueDate datetime Date the order is due to the customer. Ship Date datetime Date the order was shipped to the customer. Status tinyint Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled OnlineOrderFlag Flag(bit) 0 = Order placed by sales person. 1 = Order placed online by customer. UK Sales OrderNumber nvarchar(25) Unique sales order identification number. Purchase Order Number Order Number(nvarchar(25)) Customer purchase order number reference. Account Number Account Number(nvarchar(15)) Financial accounting number reference. FK CustomerID int Customer identification number. Foreign key to Customer. BusinessEntityID. FK Sales PersonID int Sales person who created the sales order. Foreign key to SalesPerson.Business EntityID. FK TerritoryID Territory in which the sale was made. Foreign key to Sales Territory. SalesTerritoryID. FK BillToAddressID int Customer billing address. Foreign key to Address.AddressID. int FK int FK FK int FK Ship ToAddressID Customer shipping address. Foreign key to Address.AddressID. ShipMethodID int Shipping method. Foreign key to ShipMethod. ShipMethodID. Credit CardID Credit card identification number. Foreign key to Credit Card. CreditCardID. Credit Card ApprovalCode varchar(15) Approval code provided by the credit card company. Currency RateID int Currency exchange rate used. Foreign key to Currency Rate.Currency RateID. SubTotal money 0.00 Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. TaxAmt money 0.00 Tax amount. Freight money 0.00 Shipping cost. TotalDue money Total due from customer. Computed as Subtotal + TaxAmt + Freight. Comment nvarchar(128) Sales representative comments. rowguid uniqueidentifier newid ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. ModifiedDate datetime getdate() Date and time the record was last updated. UK

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!