Question
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 ...Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started