DBMS1 MCQ
DBMS1 MCQ
MCQ on DBMS
2. The number of entities to which another entity can be related through a relationship set is called?
(A). Cardinality
(B). Entity
(C). Schema
(D). Attributes
6. An entity set that does not have sufficient attributes to form a primary key is termed a __________
a) Strong entity set
b) Variant set
c) Weak entity set
d) Variable set
9. Which of the following is used to denote the selection operation in relational algebra?
a) Pi (Greek)
b) Sigma (Greek)
c) Lambda (Greek)
d) Omega (Greek)
10. For select operation the ________ appear in the subscript and the ___________ argument appears in
the paranthesis after the sigma.
a) Predicates, relation
b) Relation, Predicates
c) Operation, Predicates
d) Relation, Operation
17. In ___ products, the rows in one table are combined with the rows in another table.
A. Cross
B. Cartesian
C. Both A and B
D. None of the above
18. The operation of a relation X, produces Y, such that Y contains only selected attributes of X. Such an
operation is :
A Projection
B Intersection
C Union
D Difference
19. Which of the following is not valid unary operation in the relational algebra ?
A select
B min
C project
D rename
21. Consider the join of a relation R with a relation S. If R has m tuples and S has n tuples. Then the
maximum and minimum size of the join respectively are :
A m+n and 0
B m+n and [m-n]
C mn and 0
D mn and m+n
27. Find the names of all instructors in the Physics department together with the course id of all courses
they teach:
a)
{< c > | Э s (< c, a, s, y, b, r, t >ε section ∧s = “Fall” ∧ y = “2009” ∨Эu (< c, a, s, y, b, r, t >ε section ∧s
= “Spring” ∧ y = “2010”
b)
{< n, c > | Э i, a (< i, c, a, s, y > ε teaches ∧ Э d, s (< i, n, d, s > ε instructor ∧ d = “Physics”))}
c)
{< n > | Э i, d, s (< i, n, d, s > ε instructor ∧ s > 80000)}
d)
{< i, n, d, s > | < i, n, d, s > ε instructor ∧ s > 80000}
a. FLOAT
b. NUMERIC
c. DECIMAL
d. CHARACTER
31. If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default
______________
a) ASC
b) DESC
c) There is no default value
d) None of the mentioned
1. Primary Key
2. Not Null
3. Check
4. Union
1. CHAR
2. RAW
3. NUMERIC
4. VARCHAR
36. What is the difference between a PRIMARY KEY and a UNIQUE KEY?
1. Primary key can store null value, whereas a unique key cannot store null value.
2. We can have only one primary key in a table while we can have multiple unique keys
3. Primary key cannot be a date variable whereas unique key can be
4. None of these
37. Which operator is used to compare the NULL values in SQL?
1. Equal
2. IN
3. IS
4. None of Above
38. Which of the following statement is correct regarding the difference between TRUNCATE, DELETE
and DROP command?
I. DELETE operation can be rolled back but TRUNCATE and DROP operations cannot be rolled back.
II. TRUNCATE and DROP operations can be rolled back but DELETE operations cannot be rolled back.
III. DELETE is an example of DML, but TRUNCATE and DROP are examples of DDL.
IV. All are an example of DDL.
1. I and III
2. II and III
3. II and IV
4. II and IV
39. Which of the following options are correct regarding these three keys (Primary Key, Super Key, and
Candidate Key) in a database?
1. I and II
2. II and III
3. I and III
4. II and IV
40. Find the cities name with the condition and temperature from table 'weather' where condition = sunny
or cloudy but temperature >= 60.
1. SELECT city, temperature, condition FROM weather WHERE condition = 'cloudy' AND
condition = 'sunny' OR temperature >= 60
2. SELECT city, temperature, condition FROM weather WHERE condition = 'cloudy' OR condition
= 'sunny' OR temperature >= 60
3. SELECT city, temperature, condition FROM weather WHERE condition = 'sunny' OR condition
= 'cloudy' AND temperature >= 60
4. SELECT city, temperature, condition FROM weather WHERE condition = 'sunny' AND
condition = 'cloudy' AND temperature >= 60
41. Which of the following statement is correct to display all the cities with the condition, temperature,
and humidity whose humidity is in the range of 60 to 75 from the 'whether' table?
1. SELECT * FROM weather WHERE humidity IN (60 to 75)
2. SELECT * FROM weather WHERE humidity BETWEEN 60 AND 75
3. SELECT * FROM weather WHERE humidity NOT IN (60 AND 75)
4. SELECT * FROM weather WHERE humidity NOT BETWEEN 60 AND 75
42. Which statement is used to get all data from the student table whose name starts with p?
SELECT a.emp_name, a.sal, a.dept_id, b.maxsal FROM employees a,
(SELECT dept_id, MAX(sal) maxsal FROM employees GROUP BY dept_id) b
WHERE a.dept_id = b.dept_id AND a.sal < b.maxsal;