0% found this document useful (0 votes)
67 views

DBMS1 MCQ

The document contains 40 multiple choice questions related to database management systems (DBMS). The questions cover topics like entity-relationship diagrams, relational algebra, relational calculus, SQL, keys, and more. The questions are in a multiple choice format with options A, B, C or D for each question.

Uploaded by

barunduari
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

DBMS1 MCQ

The document contains 40 multiple choice questions related to database management systems (DBMS). The questions cover topics like entity-relationship diagrams, relational algebra, relational calculus, SQL, keys, and more. The questions are in a multiple choice format with options A, B, C or D for each question.

Uploaded by

barunduari
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

JECA

MCQ on DBMS

1. Which of the following gives a logical structure of the database graphically?


a) Entity-relationship diagram
b) Entity diagram
c) Database diagram
d) Architectural representation

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

3. The Relations bring from an E-R model will usually be in :


(A). Third normal form
(B). Second normal form
(C). First normal form
(D). Fourth normal form

4. The entity relationship set is represented in E-R diagram as


a) Double diamonds
b) Undivided rectangles
c) Dashed lines
d) Diamond

5. The Rectangles divided into two parts represents


a) Entity set
b) Relationship set
c) Attributes of a relationship set
d) Primary key

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

7.  Weak entity set is represented as


a) Underline
b) Double line
c) Double diamond
d) Double rectangle
8. Relational Algebra is a __________ query language that takes two relations as input and produces
another relation as an output of the query.
a) Relational
b) Structural
c) Procedural
d) Fundamental

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

11. Which is a unary operation:


a) Selection operation
b) Primitive operation
c) Projection operation
d) Generalized selection

12. In precedence of set operators, the expression is evaluated from


a) Left to left
b) Left to right
c) Right to left
d) From user specification

13.  In Relational Algebra, queries are performed using ___.


A. Entities
B. Relationships
C. Operators
D. Objects
14. Which of the following is NOT a type of relational operation?
A. Select Operation
B. Set Difference
C. Set Update
D. Cartesian Product
15. Using the select operation, you can select ___ that satisfy certain criteria.
A. Tuples
B. Attributes
C. Operators
D. None
16. If there are 2 types of tuples, A & B, the ___ operation contains all the tuples that are either in A or B
or both in A & B.
A. Project
B. Select
C. Union
D. Rename

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

20. Relational Calculus is :


A Programming language
B Functional language
C Procedural language
D Non-procedural language

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

22.  What is the notation to denote Tuple Relational Calculus?


A. {T | P (T)}
B. {P (T) | T}
C. {P (T)}
D. {T}

23. What is the T in Tuple Relational Calculus's Notation?


A. Input Tuples
B. Resulting Tuples
C. Both A and B
D. None of the above
24. Find the ID, name, dept name, salary for instructors whose salary is greater than $80,000 .
a) {t | t ε instructor ∧ t[salary] > 80000}
b) Э t ∈ r (Q(t))
c) {t | Э s ε instructor (t[ID] = s[ID]∧ s[salary] > 80000)}
d) None of the mentioned

25. An expression in the domain relational calculus is of the form


a) {P(x1, x2, . . . , xn) | < x1, x2, . . . , xn > }
b) {x1, x2, . . . , xn | < x1, x2, . . . , xn > }
c) { x1, x2, . . . , xn | x1, x2, . . . , xn}
d) {< x1, x2, . . . , xn > | P(x1, x2, . . . , xn)}

26. {t | Э s ε instructor (t[name] = s[name] ∧ Э u ε department (u[dept name] = s[dept name] ∧


u[building] = “Anex”))}
Which of the following best describes the query?
a) Finds the names of all instructors whose department is in the Anex building
b) Finds the names of all department is in the Anex building
c) Finds the name of the dapartment whose instructor and building is Anex
d) Returns the building name of all the departments

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}

28. In domain relaional calculus “there exist” can be expressed as


a) (P1(x))
b) (P1(x)) Э x
c) V x (P1(x))
d) Э x (P1(x))

29. A set of possible data values is called


a) Attribute
b) Degree
c) Tuple
d) Domain

30. Which of the following is not a valid SQL type?

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

32. Which of the following statement is true?


a) DELETE does not free the space containing the table and TRUNCATE free the space containing the
table
b) Both DELETE and TRUNCATE free the space containing the table
c) Both DELETE and TRUNCATE does not free the space containing the table
d) DELETE free the space containing the table and TRUNCATE does not free the space containing the
table

33. Which of the following is not Constraint in SQL?

1. Primary Key
2. Not Null
3. Check
4. Union

34. Which datatype can store unstructured data in a column?

1. CHAR
2. RAW
3. NUMERIC
4. VARCHAR

35. Which of the following is the correct order of a SQL statement?

1. SELECT, GROUP BY, WHERE, HAVING


2. SELECT, WHERE, GROUP BY, HAVING
3. SELECT, HAVING, WHERE, GROUP BY
4. SELECT, WHERE, HAVING, GROUP BY

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?

I. Minimal super key is a candidate key


II. Only one candidate key can be a primary key
III. All super keys can be a candidate key
IV. We cannot find a primary key from the candidate key

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?

1. SELECT * FROM student WHERE name LIKE '%p%';


2. SELECT * FROM student WHERE name LIKE 'p%';
3. SELECT * FROM student WHERE name LIKE '_p%';
4. SELECT * FROM student WHERE name LIKE '%p';

43. Evaluate the SQL statement:

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;  

Which of the following statement is correct?

a. The statement gives an error at line 1.


b. The statement gives an error at line 6.
c. The statement produces the employee name, salary, department ID, and maximum salary earned
in the employee department for all departments that pay less salary than the maximum salary paid
in the company.
d. The statement produces the employee name, salary, department ID, and maximum salary earned
in the employee department for all employees who earn less than the maximum salary in their
department.

You might also like