2 Commands Sqlite
2 Commands Sqlite
Write the SQL Commands to create a database for the following relational
schema:
Customer (Cust-Id, Cust-Name, Annual-Revenue, Cust-Type)
Note - Cust-Id must be between 100 and 10,000
Annual-Revenue defaults to 20,000
Cust-type must be "manufacturer", "wholesaler" or "retailer"
a) Create the database, described above and insert sufficient data in all the relations
3) For each customer, what is the average weight of a package sent by that
customer.
4) For each city, what is the maximum weight of a package sent to that city?
6) List the name and annual revenue of customers whose shipments have been
delivered by truck driver named 'Ramesh'.
7) For each city, with population over 50,000 what is the minimum weight of
a package sent to that city?
8) For those truck numbers, which have taken part in more than 3 shipments, list
the truck numbers, driver names, and the average weight of the shipments.
Note - SALARY must be between 10000 and 20,000 and defaults to 15000
2) List the roll numbers and names of those students, who attended
at least one interview but did not receive any job offers.
3) List the roll numbers of those students, who received offers from
all companies.
4) List the name and roll numbers of students who did not appear
for any interview.
5) For each department, find the average salary offered to the students
of that department.
6) List the roll numbers and names of those students, who got
offers from all the companies in which they appeared for interview.
7) List for each degree, in which more than five students were offered
jobs, the name of the degree and the average offered salary of the
students in this degree programme.
8) List the name and roll number of students, who received maximum
number of job offers.(The result may be the same as the result of query 3
if a student(s) has received offered from all the companies)