Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Customers
- =========
- CID (pk)
- fname
- lname
- ---------
- Addresses
- =========
- AID (pk)
- CID (fk)
- address
- ---------
- Orders
- =========
- OID (pk)
- PID (fk)
- AID (fk)
- SID (fk)
- date
- s_cost
- price
- total
- ---------
- S_Options
- =========
- SID (pk)
- name
- ---------
- Products
- =========
- PID (pk)
- name
- price
- ---------
- 1) SELECT CID,fname,lname FROM Customers;
- 2) SELECT address FROM Addresses WHERE CID=64;
- 3)
- a.
- SELECT fname,lname,address FROM Orders
- INNER JOIN Addresses ON Orders.AID=Addresses.AID
- INNER JOIN Customers ON Addresses.CID=Customers.CID
- WHERE Orders.OID=64;
- b.
- SELECT fname,lname,address FROM Orders
- INNER JOIN Addresses ON Orders.AID=Addresses.AID
- INNER JOIN Customers ON Addresses.CID=Customers.CID
- WHERE Orders.OID=64;
- c.
- SELECT name,total FROM Orders
- INNER JOIN Addresses ON Orders.AID=Addresses.AID
- INNER JOIN Customers ON Addresses.CID=Customers.CID
- WHERE Orders.OID=64;
- 4)
- 5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement