Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

image text in transcribed 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

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_2

Step: 3

blur-text-image_3

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 Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

State the uses of job description.

Answered: 1 week ago

Question

Explain in detail the different methods of performance appraisal .

Answered: 1 week ago