Databases questions

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

0/30 correct0 marks

Related topics in GATE CS