Question: i have to answer these questions with sql query Retrieving Data Provide the SQL commands needed to answer the questions below using the information in


Retrieving Data Provide the SQL commands needed to answer the questions below using the information in the Human Resources and Order Entry databases. Remember to use explicit joins and to format your code as discussed in class. 1. What are the categories, product IDs, and names of all products that are available in warehouses in the Americas? Put in alphabetical order first by category name then by product name. 2. For each product with a warrantee that was purchased, list the customer id, their names (as separate columns), the order number, the product id, the product name the purchase date, and the warranty expiration date. Give the calculated columna short but meaningful name. a. Write a query to do this. b. Create a view in your schema called warranties based on this query. c. Write a query based on the view that lists in alphabetical order the names of all customers who will have a warranty expire in 2027. 3. Consider warehouse inventories based on the minimum price of the items stored there. a. List the name of each warehouse along with the total value of its inventory. b. Do the same, but only show those with more than $2 million in inventory. Tables (Filtered) CUSTOMERS CUSTOMER_ID 1 CUST_FIRST_NAME CUST_LAST NAME CUST_STREET_ADDRESS 1 CUST_POSTAL_CODE 1 CUST_CITY 1 CUST_STATE_PROVINCE CUST_COUNTRY_ID PHONE_NUMBER 1 NLS_LANGUAGE 1 NLS_TERRITORY I CREDIT_LIMIT -1 CUST_EMAIL II ACCOUNT_MGR_ID LANGUAGES LANG_ABBR LANG_NAME PRODUCT DESCRIPTIONS | PRODUCT_ID LANGUAGE_ID I TRANSLATED_NAME TRANSLATED_DESCRIPTION 6 PRODUCT_INFORMATION PRODUCT_ID PRODUCT_NAME PRODUCT_DESCRIPTION I CATEGORY_ID WEIGHT_CLASS I WARRANTY_PERIOD Reports Tables (Filtered) CUSTOMERS CUSTOMER_ID CUST_FIRST_NAME CUST_LAST_NAME 1 CUST_STREET_ADDRESS 1 CUST_POSTAL_CODE CUST_CITY CUST_STATE_PROVINCE I CUST_COUNTRY_ID IPHONE_NUMBER NLS_LANGUAGE NLS_TERRITORY CREDIT_LIMIT 1 CUST_EMAIL ACCOUNT_MGR_ID LANGUAGES LANG_ABBR 1 LANG_NAME PRODUCT DESCRIPTIONS PRODUCT_ID LANGUAGE_ID TRANSLATED_NAME I TRANSLATED_DESCRIPTION PRODUCT_INFORMATION 11 PRODUCT_ID PRODUCT_NAME II PRODUCT_DESCRIPTION I CATEGORY_ID WEIGHT_CLASS WARRANTY PERIOD 3 Reports Retrieving Data Provide the SQL commands needed to answer the questions below using the information in the Human Resources and Order Entry databases. Remember to use explicit joins and to format your code as discussed in class. 1. What are the categories, product IDs, and names of all products that are available in warehouses in the Americas? Put in alphabetical order first by category name then by product name. 2. For each product with a warrantee that was purchased, list the customer id, their names (as separate columns), the order number, the product id, the product name the purchase date, and the warranty expiration date. Give the calculated columna short but meaningful name. a. Write a query to do this. b. Create a view in your schema called warranties based on this query. c. Write a query based on the view that lists in alphabetical order the names of all customers who will have a warranty expire in 2027. 3. Consider warehouse inventories based on the minimum price of the items stored there. a. List the name of each warehouse along with the total value of its inventory. b. Do the same, but only show those with more than $2 million in inventory. Tables (Filtered) CUSTOMERS CUSTOMER_ID 1 CUST_FIRST_NAME CUST_LAST NAME CUST_STREET_ADDRESS 1 CUST_POSTAL_CODE 1 CUST_CITY 1 CUST_STATE_PROVINCE CUST_COUNTRY_ID PHONE_NUMBER 1 NLS_LANGUAGE 1 NLS_TERRITORY I CREDIT_LIMIT -1 CUST_EMAIL II ACCOUNT_MGR_ID LANGUAGES LANG_ABBR LANG_NAME PRODUCT DESCRIPTIONS | PRODUCT_ID LANGUAGE_ID I TRANSLATED_NAME TRANSLATED_DESCRIPTION 6 PRODUCT_INFORMATION PRODUCT_ID PRODUCT_NAME PRODUCT_DESCRIPTION I CATEGORY_ID WEIGHT_CLASS I WARRANTY_PERIOD Reports Tables (Filtered) CUSTOMERS CUSTOMER_ID CUST_FIRST_NAME CUST_LAST_NAME 1 CUST_STREET_ADDRESS 1 CUST_POSTAL_CODE CUST_CITY CUST_STATE_PROVINCE I CUST_COUNTRY_ID IPHONE_NUMBER NLS_LANGUAGE NLS_TERRITORY CREDIT_LIMIT 1 CUST_EMAIL ACCOUNT_MGR_ID LANGUAGES LANG_ABBR 1 LANG_NAME PRODUCT DESCRIPTIONS PRODUCT_ID LANGUAGE_ID TRANSLATED_NAME I TRANSLATED_DESCRIPTION PRODUCT_INFORMATION 11 PRODUCT_ID PRODUCT_NAME II PRODUCT_DESCRIPTION I CATEGORY_ID WEIGHT_CLASS WARRANTY PERIOD 3 Reports
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
