PT Test-1
PT Test-1
1. In MYSQL database, if a table, Alpha has degree 5 and cardinality 3, and another table, Beta has
degree 3 and cardinality 5, what will be the degree and cardinality of the Cartesian product of Alpha
and Beta?
a. 5,3 b. 8,15 c. 3,5 d. 15,8
2. Which of the following statements is FALSE about keys in a relational database?
a. Any candidate key is eligible to become a primary key.
b. A primary key uniquely identifies the tuples in a relation.
c. A candidate key that is not a primary key is a foreign key.
d. A foreign key is an attribute whose value is derived from the primary key of another relation.
3. ______________ is number of relation in a table
a. Attribute b. Degree c. Domain d. cardinality
4. ________________clause used with SELECT statement to display data in sorted form with respect to
a specified column
a. WHERE b. ORDER BY c.HAVING d.DISTINCT
5. _________ statement of SQL is used to insert new records in a table.
(a) ALTER (b) UPDATE (c) INSERT (d) CREATE
6. Explain the concept of “ALTERNATE KEY” in a Relational Database Management System with an
appropriate example
7. Differentiate between CHAR and VARCHAR data types in SQL with appropriate example.
8. Name any 2 DDL and DML commands.
9. Differentiate between delete and drop commands.
10. Differentiate between count () and count (*) .
11. Explain the usage of HAVING clause in GROUP BY command in RDBMS with the help of an
example.
12. Consider the table CLUB given below and write the output of the SQL queries that follow.
(i) SELECT COUNT(DISTINCT SPORTS) FROM CLUB;
(ii) SELECT CNAME, SPORTS FROM CLUB WHERE DOAPP<"2006-04-30" AND CNAME LIKE
"%NA";
(iii) SELECT CNAME, AGE, PAY FROM CLUB WHERE GENDER = "MALE" AND PAY BETWEEN
1000 AND 1200;
Based on the given table, write SQL queries for the following:
(i) Increase the salary by 5% of personals whose allowance is known.
(ii) Display Name and Total Salary (sum of Salary and Allowance) of all personals. The column
heading ‘Total Salary’ should also be displayed.
(iii) Delete the record of personals who have salary greater than 25000
14. A) Consider the following tables –LOAN and BORROWER:
b)
15. A) Write the outputs of the SQL queries (i) to (iv) based on the relations COMPUTER and SALES
given below
16. A) Which of the following is NOT a DML command
DELETE, DROP, INSERT UPDATE
B)