Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write SQL queries to answer the following questions. 1.What agents (aid, aname) placed an order (or orders) for razor? aid | aname -----+------- a06 |

Write SQL queries to answer the following questions. 

1.What agents (aid, aname) placed an order (or orders) for "razor"?
aid | aname
-----+-------
a06 | Smith
a03 | Brown
a05 | Otasi
(3 rows)

 

2.What products (pid, pname) are supplied by "Lambda Supply"? (Hint:
tblSuppliers, tblProductSupplier,
and tblProducts. You do not need tblOrders.
pid | pname
-----+-------
p04 | pen
p02 | brush
(2 rows)

 

3.What products (pid, pname) have no orders? (Childless Parent query)
(Show only the requested information.)
pid | pname
-----+--------
p08 | floppy
(1 row)

 

4.Find all invalid foreign keys in tblProductSupplier. (Remember, it has a
two-field PK)
This one will take two queries: one on tblProducts (parent) ---
tblProductSupplier (child)
and one on tblSuppliers (parent) --- tblProductSupplier (child)

 

 

pid
-----
p09
(1 row)
sid
-----
s08
(1 row)

 

Step by Step Solution

3.32 Rating (137 Votes )

There are 3 Steps involved in it

Step: 1

Here are the SQL queries to answer the provided questions 1 What agents aid aname placed an order or ... blur-text-image

Get Instant Access with AI-Powered 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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

Graph one period of each function. y = 4 cos x

Answered: 1 week ago

Question

Do we have the resources to implement the solution?

Answered: 1 week ago