Starting from:

$25

CS313- Lab 3 Worksheet Solved

Do the following using psql only: (no pgadmin)
Q1. create user and schema called lab3

(instructions for creating user and database are given at the last section of this page)

Q2. create the following tables.The attributes with id mentioned are keys for the respective tables.:

part - containing part-no ( id ), part-name, colour, weight
supplier - containing supplier-no ( id ), sup-name, city, bank
shipment - containing shipment-no ( id ),part-no, supplier-no, date, quantity, price (per unit)
(Shipment contains data about parts supplied by various suppliers)

Q3. Add one tuple in each table interactively using psql insert statement.

Q4. Create a .sql file to load more data in these tables so that they have at least 3 parts, 2 suppliers, and 4 shipments for each part.

(instructions for creating .sql file are given at the last section of this document)

Q5. Execute the following queries.

list supplier who have supplied red parts
get total cost of shipments for all suppliers for making payments to them list suppliers who have supplied all parts.

More products