Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the Assign 1 database, populate the database with sufficient data to test your queries ( See Note below ) . Develop and document the

Using the Assign1 database, populate the database with sufficient data to test your queries (See Note below). Develop and document the SQL queries necessary to satisfy the following. Only show in the output the details required by the specifics of the query. No unnecessary or debug columns.
--1. List the details for all orders for the customer named "Charlie" that contained sales for the item "Apples"
--2. List the order no. for orders that have placed more than 2 sale items in 2022
--3. List the customers details for customers who have placed orders items in the "Fruit" (FR) or "Vegetable" (VG) catgeory in 2022. Show each customer only once
--4. List the id , description and category of items where the QOH is less than the reorder level. Sequence by item id within category
--5. List the details for the items that have been sold at a discount on any order (Where the sale price less than list price).
--6. List the details for all customers that have ordered items with characters "Bananas" anywhere in its description.
--7. List the maximum quantity on hand for any item in the "Fruit" (FR) category
--8. List the total quantity sold for the item with the description "Green Bananas" in Ontario in 2022
--9. List the item details for all sold items in 2019 Sequence the output by item description.
--10. Count the number of times an item in the vegetable (VG) category has appeared on an order in 2022
--11. Count the number of different item categories represented by sales in Quebec in August 2019
--12. List the details for the customers that purchased the item "Broccoli" in 2022. Show each customer only once and sequence alphabetically by customer name
--13. List for each item by item id, the highest sale value (sale price * qty sold ) appearing on any order.
--14. List the total value of sales (sale price * qty sold) for each item category in 2022. Order the output by greatest value to lowest value
--15. List the customer id for the Ontario customers that have placed 2 or more orders in 2022
--16. List in alphabetic sequence by item description the details of any items ordered by the customer named "Jones". Show each item only once
--17. List the customer details for those customers who have bought broccoli in 2022 and who reside in either Ontario or Quebec
--18. Show by item id the total value (sale price * qty sold) for each sale item in August 2022 where that item appeared on at least 2 orders in that same time period
--19. List the total inventory value (item cost * qty on hand ) for each item in the "VG" category
--20. Write the following commands. I must be able to test run i), ii) and iii) below in sequence.
--20 a). Add a new item to the database
--20 b). Update the qtyonhand by adding 50 new units (Use a formula. Don't directly hard code the new value)
--20 c) Delete the item
--Note: I must be able to test run i), ii) and iii) above in sequence.
Note: Queries that do not return sufficient data will be marked as wrong
i) All queries must generate some output
ii) Queries with explicit sequencing must return a minimum of 3 rows
iii) An aggregate query must have at least one row of output that is using at least 2 input rows (e.g. a count of 2, not 0 or 1)
iv) Use column aliases where appropriate.
v) Suppress duplicate rows where appropriate for output based on your actual data even if not specifically requested in the question.

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

Step: 3

blur-text-image

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

Database And Expert Systems Applications Dexa 2022 Workshops 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 In Computer And Information Science 33

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Alfred Taudes ,Atif Mashkoor ,Johannes Sametinger ,Jorge Martinez-Gil ,Florian Sobieczky ,Lukas Fischer ,Rudolf Ramler ,Maqbool Khan ,Gerald Czech

1st Edition

3031143426, 978-3031143427

More Books

Students also viewed these Databases questions

Question

1. How do most insects respire ?

Answered: 1 week ago

Question

Who is known as the father of the indian constitution?

Answered: 1 week ago

Question

1.explain evaporation ?

Answered: 1 week ago