SQL Query Paper
SQL Query Paper
1) ___________________ helps to enforce the integrity and identify the relationship between tables.
a) Row b) Columns c) Key d) None of these
2) The MAX() function finds the ___________
a) Maximum number of records entered in a table
b) Maximum number of rows allowed to be entered
c) Maximum value of the selected column
d) None of these
3) Number of attributes in a relation is called__________
a) size b) degree c) cardinality d) weight
4) __________is used to refer to a row.
a) attribute b) tuple c) field d) instance
5) How do you select only one column ‘Name’ from a table named ‘Employee’?
a) Select {all} from Employee;
b) Select ‘Name’ from Employee;
c) Select Name from Employee;
d) Select from Employee Name
Q6 and 7 are ASSERTION AND REASONING based questions. Mark the correct choice as
Reason (R): Attributes of the entity are represented as rows and data about the entities as columns
(i) To display the details of all those students who have PE as their optional subject.
(ii) To display name, stream and optional of all those students whose name starts with ‘S’.
(iii) To display name of all those students who have average less than 80.
(iv) To display name of all those students who have average in the range of 80 to 90.
(v) To display the details of all those students whose stream is either Humanities or Commerce.
(vi) To display distinct stream available in the table.
(vii) To display the Name,Stream and Average of all those students who are from Commerce stream and Average
is not above 80.
(viii) To display details of all students other then ‘Aditya’ and ‘Prashant’.
(ix) To change average = 70 where average is null.
(x) On the basis of the Table NewStudent, write the output (s) produced by executing the following queries:
1. Select Stream from NewStudent where Name not Name like “%tosh”;
2. Select name from NewStudent where optional IN (‘Maths’,’Ent’);