Question: Database Design Report and Implementation - Please ignore requirement for screenshot, just need assistance with the actual SQL queries so I can insert them into
Database Design Report and Implementation - Please ignore requirement for screenshot, just need assistance with the actual SQL queries so I can insert them into the data myself for the output.


Question 1: (25 Marks) We provide you with an Oracle sample database which is based on a global fictitious company that sells computer hardware including storage, motherboard, RAM, video card, and CPU. The company maintains the product information such as name, description standard cost, list price, and product line. It also tracks the inventory information for all products including warehouses where products are available. Because the company operates globally, it has warehouses in various locations around the world, The company records all customer information including name, address, and website. Each customer has at least one contact person with detailed information including name, email, and phone. The company also places a credit limit on each customer to limit the amount that customer can owe. Whenever a customer issues a purchase order, a sales order is created in the database with the pending status, When the company ships the order, the order status becomes shipped. In case the customer cancels an order, the order status becomes canceled. In addition to the sales information, the employee data is recorded with some basic information such as name, email, phone, job title, manager, and hire date. The following illustrates the sample database diagram: CUSTOMERS CUSTOMER_D NAME ADDRESS WEBSITE CREDIT LIMIT REGIONS REGION_ID REGION NAME to CONTACTS - CONTACT_ID FIRST NAME LAST_NAME EMAIL PHONE CUSTOMER ID COUNTRIES COUNTRY_ID COUNTRY_NAME REGIONUD ORDERS ORDERJD CUSTOMER ID STATUS SALESMANLID ORDER_DATE EMPLOYEES EMPLOYEEJO FIRST NAME LAST_NAME EMAL PHONE HIRE_DATE MANAGER JD JOB_TITLE 19 LOCATIONS LOCATION D ADORESS POSTAL_CODE CITY STATE COUNTRY ID ORDER ITEMS ORDERJO " ITEMID PRODUCT_ID QUANTITY UNIT_PRICE INVENTORIES "PRODUCT_ID * WAREHOUSED QUANTITY WAREHOUSES - WAREHOUSE_ID WAREHOUSE_NAME LOCATION_ID PRODUCTS PRODUCT_ID PRODUCT_NAME DESCRIFTION STANDARD COST LIST_PRICE CATEGORY_ID PRODUCT CATEGORIES CATEGORY_ID CATEGORY_NAME To do the following tasks, you needs to execute the schema.sql to build the database schema and run data.sql to insert the data into the created database, if you are using Oracle database lab environment; If XAMPP with MariaDB lab environment used, it needs to execute the schemaXAMPP.sql and dataXAMPP.sql to build the database. Note: Oracle and MariaDB use different syntax. 2 Task 1.1: [4 Marks Write the SQL query to list the region names and the number of warehouses within the regions, group by countries. Task 1.2: [4 Marks Write the SQL query to find all customers who have made orders from specific Employee List must include the customer ID, customer name, and ordered by their ID values in descending. Task 1.3: [4 Marks Write the SQL query to list all employees who have the sequential letters 'co' in the employee name and in his manager name, List must include the employee' ID, names, manager name and ordered by their names in descending, Task 1.4: [4 Marks] Write the SQL query to list all products' ID, Name and price available in warehouse of countries start with "A". The list must be ordered by the product price. Task 1.5: [5 Marks Write the SQL query to list all the warehouses, their location and total sold price of each warehouse. Here, given a product, the total sold price of the product is calculated by the sold quantity of the product and its unit price. The list must be ordered by the total sold price in the ascending. Note: One product_ID may link to more than one warehouses in the provided data. You can ignore this and just count the sale of the product to all its linked to warehouse. Task 1.6: [4 Marks) Write the SQL query to list the of customer and the amount they spent on orders. The output list must include customer ID, name, and the amount they have spent. The list must be sorted by the amount in the descending order. Marking Guide: Your queries must be functionally correct, properly formatted and of course error-free, you should demonstrate this by screenshot of the result of the query
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
