Question: Must create the SQL code that will answer the questions based off of the four tables. A17 fit 1. How much revenue is generated on

Must create the SQL code that will answer the questions based off of the four tables.

Must create the SQL code that will answer the questions based off

of the four tables. A17 fit 1. How much revenue is generated

A17 fit 1. How much revenue is generated on how many shipments (shipment_id) and weights moved in each quarter (just call them Q1, Q2, Q3, and Q4, don't worry about year)? 0 P B D E F G H K. L M N 1 revenue shipment file_dim branch_dim 2 pk invoice pk shipment_id pk file dim id pk branch 3 file number origin_branch shipment_id region_level1 4 client_name destination branch file number region level2 5 date month number file_type 6 revenue_branch weight_kg 7 revenue_type 8 revenue usd 9 10 Table Explanations: 11 - Invoice and file_number is multiple to one relationship. 12 - Shipment_id and file_number is multiple to multiple relationship, and shipment is one type (Type A) of the file (meaning each shipment_id has a 13 record where the file_number is the same as this shipment_id as type A). 14 - An example for branch_dim table would be: Seattle as branch, US as region_level1, and US Northwest as region_level2. 15 16 Questions: 17 1. How much revenue is generated on how many shipments (shipment_id) and weights moved in each quarter (just call them Q1, Q2, Q3, and Q4, don't worry about year)? 18 Output columns: quarter, shipment_count, weight_sum, revenue 19 20 2. How much revenue each client generated at the origin branch and level 1 region respectively? SQL Data Question Edit ESS + 100% P A B D E F H L M N 13 record where the file_number is the same as this shipment_id as type A). 14 - An example for branch_dim table would be: Seattle as branch, US as region_level1, and US Northwest as region_level2. 15 16 Questions: 17 1. How much revenue is generated on how many shipments (shipment_id) and weights moved in each quarter (just call them Q1, Q2, Q3, and Q4, don't worry about year)? 18 Output columns: quarter, shipment_count, weight_sum, revenue 19 20 2. How much revenue each client generated at the origin branch and level 1 region respectively? 21 Output columns: client_name, origin_branch, origin_region_level1, revenue_branch, revenue_region_level1 22 23 3. How much revenue is generated, and how many shipments are on each file with type B or C whose weight is below 1000kg? 24 Output columns: file_number, weight, shipment_count, revenue 25 26 Hints: 27 - Make proper assumptions if you believe it could be interpreted/answered in multiple ways, and explain your retionales in your answers. 28 If you think there are multiple methods to get the same results, please use the most efficient one. 29 Please answer each question with only one query (nested or similar method is considered as one query). 30 31 32 SQL Data Question +

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!