Aspirant Academy

MCQ

Database MCQ - Practice Questions with Answers

Solve 15 Database questions for RAS/RPSC preparation.

Practice questions

Q1Which of the following statement contains an error?

A Select * from emp where empid = 10003;
B Select empid from emp where empid = 1006;
C Select empid from emp;
D Select empid where empid = 10009 and last name = ‘GELLER’;
Explanation

A SELECT query that retrieves table columns normally identifies the source table in the FROM clause, and SQL identifiers with spaces must be delimited. Option D omits the FROM clause and also writes last name as two unquoted tokens. Therefore D is the erroneous statement.

Q2If SQL command DELETE FROM EMPLOYEE; is executed on relation EMPLOYEE having ‘n’ tuple in it, ____________ will be deleted from relation EMPLOYEE.

A Zero tuples
B Only first tuple
C All ‘n’ tuples
D Only last tuple
Explanation

A DELETE statement removes rows that satisfy its WHERE clause; if the WHERE clause is absent, all rows in the table are deleted and the table remains empty. Therefore DELETE FROM EMPLOYEE; deletes every one of the n tuples from EMPLOYEE. Hence C is correct.

Q3In tuple relational calculus P₁ → P₂ is equivalent to -

A ¬ P₁ ∨ P₂
B P₁ ∨ P₂
C P₁ ∧ P₂
D P₁ ∧ ¬ P₂
Explanation

In logic, an implication P₁ → P₂ is false only when P₁ is true and P₂ is false. Therefore it is equivalent to ¬P₁ ∨ P₂, which is option A. The other forms change the truth condition of implication.

Q4To maintain materialized view in RDBMS, we use -

A Trigger
B Pointer
C Clone object
D None
Explanation

A materialized view stores a query result physically, so it must be maintained when the base tables change. A trigger can fire automatically on insert, update, or delete events and apply the required maintenance logic. Pointers or clone objects do not provide this automatic view-maintenance mechanism.

Q5In relational database minimal super keys is known as -

A Primary keys
B Foreign keys
C Candidate keys
D Reference keys
Explanation

A candidate key is defined as a minimal superkey: it uniquely identifies a tuple, and no proper subset of it can still be a superkey. Primary keys are selected from candidate keys, while foreign keys reference keys in another relation. Therefore minimal superkeys are candidate keys, so C is correct.

You've seen 5 of 15 sample questions

Unlimited practice on Database comes with the RAS Test Series + Practice pack or Gate Pass.

More questions

6Which of the operations constitute a basic set of operations for manipulating relational data?

APredicate calculus
BRelational calculus
CRelational algebra
DNone of these

7Match the following - List - I (a) DDL (b) DML (c) TCL (d) Binary operation List - II (i) LOCK TABLE (ii) COMMIT (iii) Natural Difference (iv) REVOKE

Aa-(ii), b-(i), c-(iii), d-(iv)
Ba-(i), b-(ii), c-(iv), d-(iii)
Ca-(iii), b-(ii), c-(i), d-(iv)
Da-(iv), b-(i), c-(ii), d-(iii)

8Which of the following is valid pair of schema change statements in SQL?

ADELETE, ALTER
BDROP, UPDATE
CDROP, ALTER
DDELETE, UPDATE

9In SQL ............is an aggregate function.

ASELECT
BCREATE
CAVG
DMODIFY

10Which of the following database object does not physically exist?

ABase table
BIndex
CView
DNone of the above

11Which is not a type of NoSQL?

ACouchDB
BMongoDB
CHBase
DQBase

12In context with Relational Algebra, which of the following are Unary operators? 1. Select 2. Project 3. Union 4. Product

A1 and 3 only
B2 and 4 only
C1 and 2 only
DAll are binary

13A relation in which every non-key attribute is fully functionally dependent on the primary key and which has no transitive dependencies is in -

A5NF
B3NF
C4NF
DBCNF

14Consider the following statements regarding key – (I) A super key is an attribute or combination of attributes that uniquely identifies records in a RDBMS table. (II) A candidate key is a subset of a super key. (III) All super keys are candidate keys but vice versa is not true.

AOnly (I) is true
BOnly (II) is true
C(I) and (III) are true
D(I) and (II) are true

15Which of the following is not a super key in a relational schema with attributes V, W, X, Y, Z and primary key VY?

AVXYZ
BVWXZ
CVWXY
DVWXYZ

More topics in DBMS, SAD & IoT (Basic CI)

Explore other subjects