Question: make it simple and In the same order as this example, please Based on the following star schema (which is related to the second exercise

 make it simple and In the same order as this example,

make it simple and In the same order as this example, please

please Based on the following star schema (which is related to the

Based on the following star schema (which is related to the second exercise of the previous assignment), answer the following questions using SQL Question 1 Calculate the total salaries for all employees. Question 2 Provide a full cross tabulation (using SQL), considering the employee's age, employee's country, and the employee's degree, of salaries for employees aged 35 or 55, located in either KSA or UAE, and holding a Master's or Bachelor's degree. Question 3 Considering the question 2, we would like to only include in the resulted table the sub-totals of employee's country, and the employee's degree. You should keep the other remaining constraints similarly to question 2 Answer this question using SQL. Question 4 In your SQL response to question 2, include the grouping function to enhance the readability of the resulting table. Question 5 In your SQL response to question 3, include the decode function to enhance the readability of the resulting table. SELECT channel_desc, calendar_month_desc AS calendar, country_id AS CO, SUM(amount_sold) AS SALES\$ FROM sales, customers, times, channels WHERE sales.time_id = times.time_id AND sales.cust_id = customers.cust_id AND sales.channel_id = channels.channel_id AND channels.channel_desc IN ('Direct_sales', 'Internet') AND times.calendar_month_desc IN ('2000-09', '2000-10') AND country_id IN ('UK', 'US') GROUP BY ROLLUP (channel_desc, calendar_month_desc, country_id)

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!