Databases questions — page 2 of 6

Q22

GATE CS 2024 CS-1Relational DesignMSQ1 mark
Which of the following statements about a relation R in first normal form (1NF) is/are TRUE ?
More than one option can be correct.
Show answer without attempting

Answer: A, C

Q35

GATE CS 2024 CS-1Relational QueriesNAT1 mark
Consider the following two relations, R(A,B) and S(A,C):

The total number of tuples obtained by evaluating the following expression
σB<C(R⋈R.A=S.AS)\sigma_{B<C}(R \bowtie_{R.A=S.A} S)
is _________
Question figure
Question figure
Show answer without attempting

Answer: 2

Q44

GATE CS 2024 CS-1Relational DesignMSQ2 marks
The symbol →\to indicates functional dependency in the context of a relational database. Which of the following options is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: B, C, D

Q46

GATE CS 2024 CS-1TransactionsMSQ2 marks
Consider the following read-write schedule SS over three transactions T1,T2T_1, T_2, and T3T_3, where the subscripts in the schedule indicate transaction IDs:
S:r1(z);w1(z);r2(x);r3(y);w3(y);r2(y);w2(x);w2(y)S: r_1(z); w_1(z); r_2(x); r_3(y); w_3(y); r_2(y); w_2(x); w_2(y);
Which of the following transaction schedules is/are conflict equivalent to SS?
More than one option can be correct.
Show answer without attempting

Answer: B, C, D

Q19

GATE CS 2024 CS-2TransactionsMCQ1 mark−1/3 if wrong
Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called
Show answer without attempting

Answer: A

Q20

GATE CS 2024 CS-2Data ModelsMCQ1 mark−1/3 if wrong
In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?
Show answer without attempting

Answer: A

Q26

GATE CS 2024 CS-2Storage and IndexingMSQ1 mark
Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?
More than one option can be correct.
Show answer without attempting

Answer: A, B

Q27

GATE CS 2024 CS-2TransactionsMSQ1 mark
Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: A, C, D

Q45

GATE CS 2024 CS-2Relational QueriesMCQ2 marks−2/3 if wrong
The relation schema, Person(pid, city)\text{Person(pid, city)}, describes the city of residence for every person uniquely identified by pid\text{pid}. The following relational algebra operators are available: selection, projection, cross product, and rename.

To find the list of cities where at least 3 persons reside, using the above operators, the minimum number of cross product operations that must be used is
Show answer without attempting

Answer: B

Q53

GATE CS 2024 CS-2Storage and IndexingNAT2 marks
Consider a disk with the following specifications: rotation speed of 6000 RPM, average seek time of 5 milliseconds, 500 sectors/track, 512-byte sectors.
A file has content stored in 3000 sectors located randomly on the disk. Assuming average rotational latency, the total time (in seconds, rounded off to 2 decimal places) to read the entire file from the disk is _________
Show answer without attempting

Answer: 29.50 to 30.50

Q56

GATE CS 2024 CS-2Relational DesignNAT2 marks
A functional dependency F:X→YF: X \to Y is termed as a useful functional dependency if and only if it satisfies all the following three conditions:
- XX is not the empty set.
- YY is not the empty set.
- Intersection of XX and YY is the empty set.

For a relation RR with 4 attributes, the total number of possible useful functional dependencies is ________
Show answer without attempting

Answer: 50

Q16

GATE CS 2023 CSData ModelsMCQ1 mark−1/3 if wrong
Which one of the options given below refers to the degree (or arity) of a relation in relational database systems?
Show answer without attempting

Answer: A

Q61

GATE CS 2023 CSRelational QueriesNAT2 marks
Consider the following table named Student in a relational database. The primary key of this table is rollNum.

Student
rollNumnamegendermarks
1NamanM62
2AliyaF70
3AliyaF80
4JamesM82
5SwatiF65
The SQL query below is executed on this database.
SELECT *
FROM Student
WHERE gender = ‘F’ AND
      marks > 65;
The number of rows returned by the query is ____________.
Show answer without attempting

Answer: 2

Q62

GATE CS 2023 CSStorage and IndexingNAT2 marks
Consider a database of fixed-length records, stored as an ordered file. The database has 25,000 records, with each record being 100 bytes, of which the primary key occupies 15 bytes. The data file is block-aligned in that each data record is fully contained within a block. The database is indexed by a primary index file, which is also stored as a block-aligned ordered file. The figure below depicts this indexing scheme.

Suppose the block size of the file system is 1024 bytes, and a pointer to a block occupies 5 bytes. The system uses binary search on the index file to search for a record with a given key. You may assume that a binary search on an index file of bb blocks takes ⌈log⁡2b⌉\lceil \log_2 b \rceil block accesses in the worst case.

Given a key, the number of block accesses required to identify the block in the data file that may contain a record with the key, in the worst case, is ____________.
Question figure
Show answer without attempting

Answer: 6

Q14

GATE CS 2022 CSRelational DesignMCQ1 mark−1/3 if wrong
In a relational data model, which one of the following statements is TRUE?
Show answer without attempting

Answer: A

Q25

GATE CS 2022 CSRelational QueriesMSQ1 mark
Consider the following three relations in a relational database.

Employee(eId‾,Name),Brand(bId‾,bName),Own(eId‾,bId‾)\text{Employee}(\underline{\text{eId}}, \text{Name}), \text{Brand}(\underline{\text{bId}}, \text{bName}), \text{Own}(\underline{\text{eId}}, \underline{\text{bId}})

Which of the following relational algebra expressions return the set of eIds who own all the brands?
More than one option can be correct.
Show answer without attempting

Answer: A, B

Q31

GATE CS 2022 CSRelational DesignNAT1 mark
Consider a relation R(A,B,C,D,E)R(A, B, C, D, E) with the following three functional dependencies.

AB→CAB \to C; BC→DBC \to D; C→EC \to E;

The number of superkeys in the relation R is _____________.
Show answer without attempting

Answer: 8

Q39

GATE CS 2022 CSTransactionsMCQ2 marks−2/3 if wrong
Let Ri(z)R_i(z) and Wi(z)W_i(z) denote read and write operations on a data element zz by a transaction TiT_i, respectively. Consider the schedule SS with four transactions.

S:R4(x)R2(x)R3(x)R1(y)W1(y)W2(x)W3(y)R4(y)S: R_4(x)R_2(x)R_3(x)R_1(y)W_1(y)W_2(x)W_3(y)R_4(y)

Which one of the following serial schedules is conflict equivalent to SS?
Show answer without attempting

Answer: A

Q56

GATE CS 2022 CSRelational QueriesNAT2 marks
Consider the relational database with the following four schemas and their respective instances.

Student(sNo‾\underline{\text{sNo}}, sName, dNo) Dept(dNo‾\underline{\text{dNo}}, dName)
Course(cNo‾\underline{\text{cNo}}, cName, dNo) Register(sNo‾\underline{\text{sNo}}, cNo‾\underline{\text{cNo}})

Student
sNosNamedNo
S01JamesD01
S02RockyD01
S03JacksonD02
S04JaneD01
S05MilliD02
Dept
dNodName
D01CSE
D02EEE
Course
cNocNamedNo
C11DSD01
C12OSD01
C21DED02
C22PTD02
C23CVD03
Register
sNocNo
S01C11
S01C12
S02C11
S03C21
S03C22
S03C23
S04C11
S04C12
S05C11
S05C21
SQL Query:
SELECT * FROM Student AS S WHERE NOT EXIST
 (SELECT cNo FROM Course WHERE dNo = “D01”
 EXCEPT
 SELECT cNo FROM Register WHERE sNo = S.sNo)
The number of rows returned by the above SQL query is___________.
Show answer without attempting

Answer: 2

Q13

GATE CS 2021 CS-1TransactionsMSQ1 mark
Suppose a database system crashes again while recovering from a previous crash. Assume checkpointing is not done by the database either during the transactions or during recovery.
Which of the following statements is/are correct?
More than one option can be correct.
Show answer without attempting

Answer: A

0/200 correct0 marks

Related topics in GATE CS