Question: Please, I am using APEX ORACLE as the platform to write queries . ESPECIALLY QUESTION 9 IS VERY DIFFICULT. Write SQL queries to answer the
Please, I am using APEX ORACLE as the platform to write queries ESPECIALLY QUESTION IS VERY DIFFICULT.
Write SQL queries to answer the following questions:
List the total number of customers.
For each order, list the order ID customer ID customer name, and store ID
For the products that are ordered by both Fred Fontain and Judy Evans, list the product
ID and product name.
Select ccustomerid cfullname, ccustomerid cfullname, ilineitemid
From customers c orders o orderitems i customers c orders o orderitems i
Where ccustomeridocustomerid and oorderidiorderid and
Ccustomeridocustomerid and oorderidiorderid and
Ccustomerid ccustomerid and ilineitemidilineitemid;
Retrieve the names of the products that are ordered in store London;
IFSC Database SystemInformation Architecture
For each store, list the store name, and total number of orders it received.
List the name of the store that received the greatest number of orders.
List the names of the customers who bought the Boys Shirt White
For the customers who bought Girls Jeans, list their names and the names of stores that they
bought those jeans.
extra credit points List the name of the customer who spent the highest amount of money
in all orders.
view Create a view ORDERINFO, whose schema is as follows:
ORDERINFOORDERID LINEITEMID PRODUCTID UNITPRICE, QUANTITY, subtotal
Here, subtotal is the total cost of a specific product of an order, and is calculated as
unitprice quantity
Data analysis
Assume you are a business analyst, and you need to analyze sales from different angles so that you
can answer the following questions.
Note that if it is hard to write a single SQL query to answer the question, then you may try to use
subquery, views, anonymous block, stored functionsprocedure cursor, etc. You only need to
submit the SQL andor PLSQL codes for each question.
a Which products are sold below the listed unit price in PRODUCT table What is the total
loss of revenue incurred by the sales of the products?
b Which product has the lowest sales number ie the total number of items sold
c For each store, list the name of the customer who spent the highest amount of money.
d For each store, list the products that generated the highest sales in dollar amount.
e What are the sales in total number of products of each store by month? List the store id
store name, month, and total sales.
Extra credit: points each, points in total: pick any two questions.
a What is the total sales in dollar amount by country
b What is the total sales in dollar amount by different type of products you may infer the type
of products by product names and have your definition of product types points
c For each type of products, which store generates the highest sales in dollar amount?
d For each type of products, which month has the highest sales in dollar amount?
e Which product has the highest total sales in dollar amount?
f What is the total sales in dollar amount from the US stores?
points Relative support of itemset.
IFSC Database SystemInformation Architecture
For each product, list the product ID and its relative support. Note the relative support of a product
equals
The number of orders contain the producttotal number of orders
For this question, you can either
write a SQL query for this question, or
write a stored function, which takes a product ID as an input, and returns the relative
support of the product. Then write a SQL query to list product IDs along with their relative
support measures.
Orderitem Table with COLUMN TITLES
OrderTable with COLUMN TITLES
ProductionTable with COLUMN TITLES
StoreTable with COLUMN TITLES
CustomerTable with COLUMN TITLES
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
