Explore topic-wise MCQs in Graduate Aptitude Test (GATE).

This section includes 406 Mcqs, each offering curated multiple-choice questions to sharpen your Graduate Aptitude Test (GATE) knowledge and support exam preparation. Choose a topic below to get started.

151.

Which one of the following is a communication protocol used for email?

A. X.400
B. FTAM
C. SNMP
D. EDI
Answer» B. FTAM
152.

Consider the following SQL query:select distinct al, a2,........., anfrom r1, r2,........, rmwhere P For an arbitrary predicate P, this query is equivalent to which of the following relational algebra expressions ?

A. A
B. B
C. C
D. D
Answer» B. B
153.

Which of the following scenarios may lead to an irrecoverable error in a database system ?

A. A transaction writes a data item after it is read by an uncommitted transaction
B. A transaction reads a data item after it is read by an uncommitted transaction
C. A transaction reads a data item after it is written by a committed transaction
D. A transaction reads a data item after it is written by an uncommitted transaction
Answer» E.
154.

Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below.T1: r1(X); r1(Z); w1(X); w1(Z)T2: r2(Y); r2(Z); w2(Z)T3: r3(Y); r3(X); w3(Y)S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z); w3(Y); w2(Z); r1(Z); w1(X); w1(Z)S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z); r2(Z); w3(Y); w1(X); w2(Z); w1(Z) Which one of the following statements about the schedules is TRUE?

A. Only S1 is conflict-serializable
B. Only S2 is conflict-serializable
C. Both S1 and S2 are conflict-serializable
D. Neither S1 nor S2 is conflict-serializable
Answer» B. Only S2 is conflict-serializable
155.

Which one of the following is NOT a part of the ACID properties of database transactions?

A. Atomicity
B. Consistency
C. Isolation
D. Deadlock-freedom
Answer» E.
156.

Relation R with an associated set of functional dependencies, F is decomposed into BCNF. The redundancy (arising out of functional dependencies) in the resulting set relations is.

A. Zero
B. More than zero but less than that of an equivalent 3NF decomposition
C. Proportional to the size of F+
D. Indeterminate
Answer» B. More than zero but less than that of an equivalent 3NF decomposition
157.

Let r be a relation instance with schema R = (A, B, C, D). We define r1 = ΠA, B, C (r) and r2 = ΠA.D (r). Let s = r1 * r2 where * denotes natural join. Given that the decomposition of r into r1 and r2 is lossy, which one of the following is TRUE?

A. s ⊂ r
B. r ∪ s
C. r ⊂ s
D. r * s = s
Answer» D. r * s = s
158.

From the following instance of a relation scheme R (A, B, C), we can conclude that :A B C1 1 11 1 02 3 22 3 2

A. A functionally determines B and B functionally determines C
B. A functionally determines B and B does not functionally determine C
C. B does not functionally determine C
D. A does not functionally determine B and B does not functionally determine C
Answer» D. A does not functionally determine B and B does not functionally determine C
159.

Consider the following relation schema pertaining to a students database:Student (rollno, name, address)Enroll (rollno, courseno, coursename)where the primary keys are rollno,courseno. The number of tuples in the Student and Enroll tables are 120 and 8 respectively. What are the maximum and minimum number of tuples that can be present in (Student * Enroll), where '*' denotes natural join ?

A. 8, 0
B. 120, 8
C. 960, 8
D. 960, 120
Answer» B. 120, 8
160.

Consider the following two phase locking protocol. Suppose a transaction T accesses (for read or write operations), a certain set of objects {O1,...,Ok}. This is done in the following manner: Step 1. T acquires exclusive locks to O1, . . . , Ok in increasing order of their addresses. Step 2. The required operations are performed. Step 3. All locks are released. This protocol will

A. guarantee serializability and deadlock-freedom
B. guarantee neither serializability nor deadlock-freedom
C. guarantee serializability but not deadlock-freedom
D. guarantee deadlock-freedom but not serializability
Answer» B. guarantee neither serializability nor deadlock-freedom
161.

Given the following two statements: S1: Every table with two single-valued attributes is in 1NF, 2NF, 3NF and BCNF. S2: AB->C, D->E, E->C is a minimal cover for the set of functional dependencies AB->C, D->E, AB->E, E->C. Which one of the following is CORRECT?

A. S1 is TRUE and S2 is FALSE
B. Both S1 and S2 are TRUE
C. S1 is FALSE and S2 is TRUE
D. Both S1 and S2 are FALSE
Answer» B. Both S1 and S2 are TRUE
162.

Which of the following command is used to delete a table in SQL?

A. delete
B. truncate
C. remove
D. drop
Answer» E.
163.

Consider the following relational schema: employee(empId, empName, empDept) customer(custId, custName, salesRepId, rating) salesRepId is a foreign key referring to empId of the employee relation. Assume that each employee makes a sale to at least one customer. What does the following query return?SELECT empName FROM employee E WHERE NOT EXISTS (SELECT custId FROM customer C WHERE C.salesRepId = E.empId AND C.rating <> ’GOOD’);

A. Names of all the employees with at least one of their customers having a ‘GOOD’ rating.
B. Names of all the employees with at most one of their customers having a ‘GOOD’ rating.
C. Names of all the employees with none of their customers having a ‘GOOD’ rating.
D. Names of all the employees with all their customers having a ‘GOOD’ rating.
Answer» E.
164.

Consider the following relational schemes for a library database: Book (Title, Author, Catalog_no, Publisher, Year, Price) Collection (Title, Author, Catalog_no) with in the following functional dependencies:I. Title Author --> Catalog_noII. Catalog_no --> Title, Author, Publisher, YearIII. Publisher Title Year --> Price Assume {Author, Title} is the key for both schemes. Which of the following statements is true?

A. Both Book and Collection are in BCNF
B. Both Book and Collection are in 3NF only
C. Book is in 2NF and Collection is in 3NF
D. Both Book and Collection are in 2NF only
Answer» D. Both Book and Collection are in 2NF only
165.

Consider the relation X(P, Q, R, S, T, U) with the following set of functional dependenciesF = { {P, R} → {S,T}, {P, S, U} → {Q, R} }Which of the following is the trivial functional dependency in F+ is closure of F?

A. {P,R}→{S,T}
B. {P,R}→{R,T}
C. {P,S}→{S}
D. {P,S,U}→{Q}
Answer» D. {P,S,U}→{Q}
166.

Which option is true about the SQL query given below?SELECT firstName, lastName FROM Employee WHERE lastName BETWEEN 'A%' AND 'D%';

A. It will display all the employees having last names starting with the alphabets 'A' till 'D' inclusive of A and exclusive of D.
B. It will throw an error as BETWEEN can only be used for Numbers and not strings.
C. It will display all the employees having last names starting from 'A' and ending with 'D'.
D. It will display all the employees having last names in the range of starting alphabets as 'A' and 'D' excluding the names starting with 'A' and 'D'.
Answer» B. It will throw an error as BETWEEN can only be used for Numbers and not strings.
167.

Let R (A, B, C, D, E, P, G) be a relational schema in which the following functional depen­dencies are known to hold: AB → CD, DE → P, C → E, P → C and B → G. The relational schema R is

A. in BCNF
B. in 3NF, but not in BCNF
C. in 2NF, but not in 3NF
D. not in 2NF
Answer» E.
168.

Given the following relation instance.x y z1 4 21 5 31 6 33 2 2 Which of the following functional dependencies are satisfied by the instance? (GATE CS 2000)

A. XY -> Z and Z -> Y
B. YZ -> X and Y -> Z
C. YZ -> X and X -> Z
D. XZ -> Y and Y -> X
Answer» C. YZ -> X and X -> Z
169.

With regard to the expressive power of the formal relational query languages, which of the following statements is true?

A. Relational algebra is more powerful than relational calculus
B. Relational algebra has the same power as relational calculus
C. Relational algebra has the same power as safe relational calculus
D. None of the above
Answer» D. None of the above
170.

What is the min and max number of tables required to convert an ER diagram with 2 entities and 1 relationship between them with partial participation constraints of both entities?

A. Min 1 and max 2
B. Min 1 and max 3
C. Min 2 and max 3
D. Min 2 and max 2
Answer» D. Min 2 and max 2
171.

Relation R is decomposed using a set of functional dependencies, F and relation S is decomposed using another set of functional dependencies G. One decomposition is definitely BCNF, the other is definitely 3NF, but it is not known which is which. To make a guaranteed identification, which one of the following tests should be used on the decompositions? (Assume that the closures of F and G are available).

A. Dependency-preservation
B. Lossless-join
C. BCNF definition
D. 3NF definition
Answer» D. 3NF definition
172.

Which level of locking provides the highest degree of concurrency in a relational data base?

A. Page
B. Table
C. Row
D. Page, table and row level locking allow the same degree of concurrency
Answer» D. Page, table and row level locking allow the same degree of concurrency
173.

Consider the following transaction involving two bank accounts x and y.read(x); x := x – 50; write(x); read(y); y := y + 50; write(y) The constraint that the sum of the accounts x and y should remain constant is that of

A. Atomicity
B. Consistency
C. Isolation
D. Durability
Answer» C. Isolation
174.

Consider a relation scheme R = (A, B, C, D, E, H) on which the following functional dependencies hold: {A–>B, BC–>D, E–>C, D–>A}. What are the candidate keys of R?

A. AE, BE
B. AE, BE, DE
C. AEH, BEH, BCH
D. AEH, BEH, DEH
Answer» E.
175.

The following table has two attributes A and C where A is the primary key and C is the foreign key referencing A with on-delete cascade.A C-----2 43 44 35 27 29 56 4 The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple (2,4) is deleted is:

A. (3,4) and (6,4)
B. (5,2) and (7,2)
C. (5,2), (7,2) and (9,5)
D. (3,4), (4,3) and (6,4)
Answer» D. (3,4), (4,3) and (6,4)
176.

A Relation R with FD set {A->BC, B->A, A->C, A->D, D->A}. How many candidate keys will be there in R?

A. 1
B. 2
C. 3
D. 4
Answer» D. 4
177.

Which of the given options define a transaction correctly?

A. A transaction consists of DDL statements on the database schema.
B. A transaction consists of COMMIT or ROLLBACK in a database session.
C. A transaction consists of either a collection of DML statements or a DDL or DCL or TCL statement to form a logical unit of work in a database session.
D. A transaction consists of collection of DML and DDL statements in different sessions of the database.
Answer» D. A transaction consists of collection of DML and DDL statements in different sessions of the database.
178.

Which of the following is TRUE?

A. Every relation in 3NF is also in BCNF
B. A relation R is in 3NF if every non-prime attribute of R is fully functionally dependent on every key of R
C. Every relation in BCNF is also in 3NF
D. No relation can be in both BCNF and 3NF
Answer» D. No relation can be in both BCNF and 3NF
179.

Consider the following ordering of transactions:

A. It is a strict schedule
B. Cascade less schedule
C. Irrecoverable
D. Recoverable
Answer» C. Irrecoverable
180.

Which of the following is NOT a superkey in a relational schema with attributes V, W, X, Y, Z and primary key V Y ?

A. V X Y Z
B. V W X Z
C. V W X Y
D. V W X Y Z
Answer» C. V W X Y
181.

A relational database contains two tables student and department in which student table has columns roll_no, name and dept_id and department table has columns dept_id and dept_name. The following insert statements were executed successfully to populate the empty tables:Insert into department values (1, 'Mathematics')Insert into department values (2, 'Physics')Insert into student values (l, 'Navin', 1)Insert into student values (2, 'Mukesh', 2)Insert into student values (3, 'Gita', 1)How many rows and columns will be retrieved by the following SQL statement?Select * from student, department

A. 0 row and 4 columns
B. 3 rows and 4 columns
C. 3 rows and 5 columns
D. 6 rows and 5 columns
Answer» E.
182.

R(A,B,C,D) is a relation. Which of the following does not have a lossless join, dependency preserving BCNF decomposition?

A. A->B, B->CD
B. A->B, B->C, C->D
C. AB->C, C->AD
D. A ->BCD
Answer» D. A ->BCD
183.

Consider the relation "enrolled(student, course)" in which (student, course) is the primary key, and the relation "paid(student, amount)" where student is the primary key. Assume no null values and no foreign keys or integrity constraints. Given the following four queries:Query1: select student from enrolled where student in (select student from paid)Query2: select student from paid where student in (select student from enrolled)Query3: select E.student from enrolled E, paid P where E.student = P.studentQuery4: select student from paid where exists (select * from enrolled where enrolled.student = paid.student) Which one of the following statements is correct?

A. All queries return identical row sets for any database
B. Query2 and Query4 return identical row sets for all databases but there exist databases for which Query1 and Query2 return different row sets.
C. There exist databases for which Query3 returns strictly fewer rows than Query2
D. There exist databases for which Query4 will encounter an integrity violation at runtime.
Answer» B. Query2 and Query4 return identical row sets for all databases but there exist databases for which Query1 and Query2 return different row sets.
184.

Suppose three are 3 transactions T22, T23, T24 with timestamps 10, 20, 30. Now T23 occupies a data item that is required by T22 and T24. Among the four possibilities what will be true in wait–die schema?

A. If T22 request the data item, T22 will wait
B. If T24 request the data item, T24 will wait
C. If T22 request the data item, T23 will wait
D. If T24 request the data item, T23 will wait
Answer» B. If T24 request the data item, T24 will wait
185.

Consider the following relational schema:Suppliers(sid:integer, sname:string, city:string, street:string)Parts(pid:integer, pname:string, color:string)Catalog(sid:integer, pid:integer, cost:real)(sid,pid are primary keys)Assume that, in the suppliers relation above, each supplier and each street within a city has a unique name, and (sname, city) forms a candidate key. No other functional dependencies are implied other than those implied by primary and candidate keys. Which one of the following is TRUE about the above schema?

A. The schema is in BCNF
B. The schema is in 3NF but not in BCNF
C. The schema is in 2NF but not in 3NF
D. The schema is not in 2NF
Answer» B. The schema is in 3NF but not in BCNF
186.

The employee information in a company is stored in the relationEmployee (name, sex, salary, deptName)(name is primary key )Consider the following SQL queryselect deptName from Employee where sex = 'M' group by deptName having avg (salary) > (select avg (salary) from Employee)It returns the names of the department in which

A. the average salary is more than the average salary in the company
B. the average salary of male employees is more than the average salary of all male employees in the company
C. the average salary of male employees is more than the average salary of employees in the same department
D. the average salary of male employees is more than the average salary in the company
Answer» E.
187.

Consider a simple checkpointing protocol and the following set of operations in the log.(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7);(checkpoint);(start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3); (write, T3, z, 7, 2); If a crash happens now and the system tries to recover using both undo and redo operations, what are the contents of the undo list and the redo list

A. Undo: T3, T1; Redo: T2
B. Undo: T3, T1; Redo: T2, T4
C. Undo: none; Redo: T2, T4, T3; T1
D. Undo: T3, T1, T4; Redo: T2
Answer» B. Undo: T3, T1; Redo: T2, T4
188.

The relation scheme Student Performance (name, courseNo, rollNo, grade) has the following functional dependencies:name, courseNo → graderollNo, courseNo → gradename → rollNorollNo → name The highest normal form of this relation scheme is

A. 2 NF
B. 3 NF
C. BCNF
D. 4NF
Answer» C. BCNF
189.

A clustering index is defined on the fields which are of type

A. non-key and ordering
B. non-key and non-ordering
C. key and ordering
D. key and non-ordering
Answer» B. non-key and non-ordering
190.

Consider the following functional dependencies in a database: Data_of_Birth → Age Age → Eligibility Name → Roll_number Roll_number → Name Course_number → Course_name Course_number → Instructor (Roll_number, Course_number) → GradeThe relation (Roll_number, Name, Date_of_birth, Age) is:

A. In second normal form but not in third normal form
B. In third normal form but not in BCNF
C. In BCNF
D. None of the above
Answer» E.
191.

Consider the following transactions with data items P and Q initialized to zero:T1: read (P) ; read (Q) ; if P = 0 then Q : = Q + 1 ; write (Q) ;T2: read (Q) ; read (P) ; if Q = 0 then P : = P + 1 ; write (P) ;Any non-serial interleaving of T1 and T2 for concurrent execution leads to

A. A serializable schedule
B. A schedule that is not conflict serializable
C. A conflict serializable schedule
D. A schedule for which a precedence graph cannot be drawn
Answer» C. A conflict serializable schedule
192.

Consider the relation account (customer, balance) where customer is a primary key and there are no null values. We would like to rank customers according to decreasing balance. The customer with the largest balance gets rank 1. ties are not broke but ranks are skipped: if exactly two customers have the largest balance they each get rank 1 and rank 2 is not assignedQuery1: select A.customer, count(B.customer) from account A, account B where A.balance <=B.balance group by A.customerQuery2: select A.customer, 1+count(B.customer) from account A, account B where A.balance < B.balance group by A.customer Consider these statements about Query1 and Query2.1. Query1 will produce the same row set as Query2 for some but not all databases.2. Both Query1 and Query2 are correct implementation of the specification3. Query1 is a correct implementation of the specification but Query2 is not4. Neither Query1 nor Query2 is a correct implementation of the specification5. Assigning rank with a pure relational query takes less time than scanning in decreasing balance order assigning ranks using ODBC. Which two of the above statements are correct?

A. 2 and 5
B. 1 and 3
C. 1 and 4
D. 3 and 5
Answer» D. 3 and 5
193.

Consider the following relation Cinema (theater, address, capacity) Which of the following options will be needed at the end of the SQL querySELECT P1. addressFROM Cinema P1 Such that it always finds the addresses of theaters with maximum capacity?

A. WHERE P1. Capacity> = All (select P2. Capacity from Cinema P2)
B. WHERE P1. Capacity> = Any (select P2. Capacity from Cinema P2)
C. WHERE P1. Capacity > All (select max(P2. Capacity) from Cinema P2)
D. WHERE P1. Capacity > Any (select max (P2. Capacity) from Cinema P2)
Answer» B. WHERE P1. Capacity> = Any (select P2. Capacity from Cinema P2)
194.

Let E1 and E2 be two entities in an E/R diagram with simple single-valued attributes. R1 and R2 are two relationships between E1 and E2, where R1 is one-to-many and R2 is many-to-many. R1 and R2 do not have any attributes of their own. What is the minimum number of tables required to represent this situation in the relational model?

A. 2
B. 3
C. 4
D. 5
Answer» C. 4
195.

The statement that is executed automatically by the system as a side effect of the modification of the database is

A. backup
B. assertion
C. recovery
D. trigger
Answer» E.
196.

In a schema with attributes A, B, C, D and E following set of functional dependencies are givenA → B A → C CD → E B → D E → AWhich of the following functional dependencies is NOT implied by the above set?

A. CD → AC
B. BD → CD
C. BC → CD
D. AC → BC
Answer» C. BC → CD
197.

Given the following input (4322, 1334, 1471, 9679, 1989, 6171, 6173, 4199) and the hash function x mod 10, which of the following statements are true?1. 9679, 1989, 4199 hash to the same value2. 1471, 6171 hash to the same value3. All elements hash to the same value4. Each element hashes to a different value

A. 1 only
B. 2 only
C. 1 and 2 only
D. 3 or 4
Answer» D. 3 or 4
198.

Student (school-id, sch-roll-no, sname, saddress)School (school-id, sch-name, sch-address, sch-phone)Enrolment(school-id sch-roll-no, erollno, examname)ExamResult(erollno, examname, marks)What does the following SQL query output?SELECT sch-name, COUNT (*)FROM School C, Enrolment E, ExamResult RWHERE E.school-id = C.school-idANDE.examname = R.examname AND E.erollno = R.erollnoANDR.marks = 100 AND S.school-id IN (SELECT school-id FROM student GROUP BY school-id HAVING COUNT (*) > 200)GROUP By school-id

A. for each school with more than 200 students appearing in exams, the name of the school and the number of 100s scored by its students
B. for each school with more than 200 students in it, the name of the school and the number of 100s scored by its students
C. for each school with more than 200 students in it, the name of the school and the number of its students scoring 100 in at least one exam
D. nothing; the query has a syntax error
Answer» E.
199.

Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to a mortgage payment and then apply a 5% interest. 1. T1 start 2. T1 B old=12000 new=10000 3. T1 M old=0 new=2000 4. T1 commit 5. T2 start 6. T2 B old=10000 new=10500 7. T2 commit Suppose the database system crashes just before log record 7 is written. When the system is restarted, which one statement is true of the recovery procedure?

A. We must redo log record 6 to set B to 10500
B. We must undo log record 6 to set B to 10000 and then redo log records 2 and 3
C. We need not redo log records 2 and 3 because transaction T1 has committed
D. We can apply redo and undo operations in arbitrary order because they are idempotent
Answer» C. We need not redo log records 2 and 3 because transaction T1 has committed
200.

A table has fields Fl, F2, F3, F4, F5 with the following functional dependencies   F1 → F3   F2→ F4   (F1 . F2) → F5 In terms of Normalization, this table is in

A. 1 NF
B. 2 NF
C. 3 NF
D. none of the above
Answer» B. 2 NF