Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Examine the following relations which are part of a database for a company selling horse accessories. The corresponding case study and ER diagram is

image text in transcribedimage text in transcribed

Examine the following relations which are part of a database for a company selling horse accessories. The corresponding case study and ER diagram is given in Appendix A. Product Product_No Supply Warehouse_No Description Price (PK) (FK) P001 Riding Hat 50 W010 P002 Jodhpurs 20 W020 P003 Back Support 60 W015 P004 Riding Boots 100 W010 P005 Jacket 150 W025 Warehouse Warehouse_No Location Address (PK) W010 London 10 New Road W015 Cambridge 23 Hills Road W020 York 456 Long Road W025 Bedford 45 Old Street W040 Nottingham 56 Bar Hill Customer Customer_No CName Address (PK) Warehouse No (FK) Credit_Limit C001 Joan Black 10 London Road W010 1000 C002 John Smith 57 High Street W020 500 C003 Sam Green 102 Blackwell Street W015 2000 C004 Peter Coldwell 23 Cambridge Road W010 1500 Ann C005 345 Hendon Way W025 2500 Greenman COrder COrder_No Customer_No Date Placed (PK) (FK) CO101 C001 10 August 2020 CO102 C005 23 July 2020 CO103 C004 19 June 2020 CO104 C002 19 June 2020 CO105 C003 5 May 2020 Date_Delivered 14 August 2020 25 July 2020 25 June 2020 30 June 2020 9 May 2020 OLine COrder_No (PK)(FK) Product No (PK)(FK) Quantity CO101 P001 CO102 P005 1 3 CO103 P003 2 CO104 P001 1 CO105 P002 4 The code to create the above table is given in the HorseDB.sql file. Download the file and execute it. Use this database to answer the questions below: For each question below, write a SQL statement to: 16.1. List the customer number and name for all customers who have orders delivered from the warehouse with warehouse number of W010. 16.2. List the full details of all products that are not 'Jackets' and cost over 100. 16.3. List the product number and description of all products that cost between 50 and 100. The between command should be used. 16.4. List the warehouse number and address of all warehouses which are in a location beginning with 'Y'. 16.5. List the full details of all products that are not in the following list: (Riding Hat', 'Riding Boots').

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 Systems A Practical Approach to Design Implementation and Management

Authors: Thomas Connolly, Carolyn Begg

6th Edition Global

132943263, 978-0132943260

More Books

Students also viewed these Programming questions

Question

What are the APPROACHES TO HRM?

Answered: 1 week ago