Download the file \"Task_2_Code.sql\" to your computer and import it to your LDD
ID: 3843086 • Letter: D
Question
Download the file "Task_2_Code.sql" to your computer and import it to your LDD account. The file will create a data warehouse for a sales schema with five dimension tables (W_CUSTOMERS, W_PRODUCTS, W_STORES, W_SUPPLIERS, W_TIME) and one fact table (W_FACTS). The data warehouse covers the time period from January to December 2014. Use this schema to answer the following questions: 1- Write several queries to display the number of records in each table. 2- Which product generated maximum sales in Dec, 2014? 3- Which store produced highest sales in the whole year?Explanation / Answer
1. SELECT Count(row_name) AS col_name FROM tablename;
SO, for several queries to run with the help of the number of records in each table you will have to use the COUNT() it helps in returning the number of records.
The required number of records are displayed when certain query is entered in the databases like MSACCESS 14, MSACESS 16,etc.
2. Product generated maximum sales in 2014
The product which is generated maximum sales in December 2014 is queried as
Hence, this is the generated query for finding the maximum sales throughout the year.
3.Highest Sales In Whole Year
Hence,this is the query for geting the highest sales in the whole year and making the query look simpler and easy to run.
Please rate the answer if it helped..Thankyou
Hope it helps...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.