Test 4 SQL
Test 4 SQL
(i)To display details of all Trains which Start from New Delhi.
(ii) To display the PNR, PNAME, GENDER and AGE of all Passengers whose AGE is
below 50.
(iii) To display total number of MALE and FEMALE Passengers.
(iv)To display details of all Passengers travelling in Trains whose TNO is 12015.
6. Write SQL queries for (i) to (iv)
(i) Display the Trainer Name, City & Salary in descending order of their Hiredate.
(ii) To display the TNAME and CITY of Trainer who joined the Institute in the month of
December 2001.
(iii) To display TNAME, HIREDATE, CNAME, STARTDATE from tables TRAINER
and COURSE of all those courses whose FEES is less than or equal to 10000.
(iv) To display number of Trainers from each city.
(v) What is the degree and cardinality of the COURSE table?
7. Define referential integrity constraint.
8. Define attribute, domain and relation.
9. Write the queries for the i) to iv) based on the given tables.
i) To show firstname, lastname, address and city of all employees living in paris
ii) To display the content of Employees table in descending order of Firstname.
iii) To display the firstname, lastname and totalsalary of all managers from the tables
Employee and empsalary, where totalsalary is calculated as salary+benefits.
iv) To display the maximum salary among managers and clerks from the table
Empsalary.
v) What will be the degree and cardinality of the resultant table when Cartesian product
is performed on the tables-EmpSalary and Employees.
10. Consider the table CD and TYPE given below and answer the questions.
Table : CD
Table : Type
TABLE: ITEMTRAN