GATE 2025
65 questions
MCQ 35 · MSQ 18 · NAT 121-mark 30 · 2-mark 35
Questions 56–60 of 65
Consider the following two relations, named and , in a database:
Which of the following statements is/are correct?
Person (
aadhaar CHAR(12) PRIMARY KEY,
name VARCHAR(32));
Customer (
name VARCHAR(32),
email VARCHAR(32) PRIMARY KEY,
phone CHAR(10),
aadhaar CHAR(12),
FOREIGN KEY (aadhaar) REFERENCES Person(aadhaar)); Which of the following statements is/are correct?
One or more options are correct.
Answer: (B), (C)
,
"aadhaar is a candidate key in Customer" is false. In Customer it is only a foreign key. The schema does not make it unique there. Only is the primary key.
"phone can be NULL in Customer" is true. For there is no NOT NULL or key constraint.
"aadhaar is a candidate key in Person" is true. It is declared as the primary key of Person, and every primary key is a candidate key by definition.
"aadhaar can be NULL in Person" is false. A primary key can never be NULL under the standard SQL constraint.
Answer: phone can be NULL in Customer; and aadhaar is a candidate key in Person.
"aadhaar is a candidate key in Customer" is false. In Customer it is only a foreign key. The schema does not make it unique there. Only is the primary key.
"phone can be NULL in Customer" is true. For there is no NOT NULL or key constraint.
"aadhaar is a candidate key in Person" is true. It is declared as the primary key of Person, and every primary key is a candidate key by definition.
"aadhaar can be NULL in Person" is false. A primary key can never be NULL under the standard SQL constraint.
Answer: phone can be NULL in Customer; and aadhaar is a candidate key in Person.
Consider a database relation with attributes , and having the following functional dependencies:
Which of the following statements is/are correct?
Which of the following statements is/are correct?
One or more options are correct.
Answer: (B), (D)
Given with , , .
Keys.
: gives . Then adds , so all 7 attributes. is a candidate key, because it is a single attribute.
: gives , and then the closure of is everything. So is a superkey. It is minimal because and (neither determines anything). So is a candidate key.
, so is not a key.
No other candidate key exists. can be obtained only from itself or from , and and can be obtained only from . So every key contains or contains both and , and every such set contains or . The candidate keys are exactly and .
Options. (A) is false because is also a key. (B) is true. (C) is false because is not a key.
BCNF. For , is not a superkey, since all attributes. So this dependency breaks BCNF, and R is not in BCNF. (D) is true.
Answer: (B), (D)
Keys.
: gives . Then adds , so all 7 attributes. is a candidate key, because it is a single attribute.
: gives , and then the closure of is everything. So is a superkey. It is minimal because and (neither determines anything). So is a candidate key.
, so is not a key.
No other candidate key exists. can be obtained only from itself or from , and and can be obtained only from . So every key contains or contains both and , and every such set contains or . The candidate keys are exactly and .
Options. (A) is false because is also a key. (B) is true. (C) is false because is not a key.
BCNF. For , is not a superkey, since all attributes. So this dependency breaks BCNF, and R is not in BCNF. (D) is true.
Answer: (B), (D)
Let be a simple, unweighted, and undirected graph. A subset of the vertices and edges of are shown below.
It is given that is a shortest path between and is a shortest path between and is a shortest path between and . Which of the following is/are NOT the edges of ?
It is given that is a shortest path between and is a shortest path between and is a shortest path between and . Which of the following is/are NOT the edges of ?
One or more options are correct.
Answer: (A), (C), (D)
The edges shown are a-b, b-c, c-d, a-f, e-f, f-c, f-g, c-h, g-h. Each given path has length and is a shortest path. An extra edge cannot exist if it gives a path shorter than between one of these pairs.
- (b,d): has length , shorter than the shortest path of length . Cannot exist.
- (b,h): has length , shorter than the shortest path of length . Cannot exist.
- (e,g): has length , shorter than the shortest path of length . Cannot exist.
- (b,g): the new route has length , equal to , so the shortest distance stays . No path through shortens or either. So this edge can exist.
Answer: (A), (C), (D)
- (b,d): has length , shorter than the shortest path of length . Cannot exist.
- (b,h): has length , shorter than the shortest path of length . Cannot exist.
- (e,g): has length , shorter than the shortest path of length . Cannot exist.
- (b,g): the new route has length , equal to , so the shortest distance stays . No path through shortens or either. So this edge can exist.
Answer: (A), (C), (D)
Let be such that for all . Then ______ (Answer in integer)
Answer: 0
We are given for all . Take any two points and divide the interval into equal parts using the points . Now use the triangle inequality:
When , the right side goes . The value is a fixed number that is not negative, and it is smaller than every positive number. So it has to be exactly . This gives for every pair , so is constant.
Answer: 0
When , the right side goes . The value is a fixed number that is not negative, and it is smaller than every positive number. So it has to be exactly . This gives for every pair , so is constant.
Answer: 0
Let be a dataset of observations where each . It is given that . The covariance matrix computed from has eigenvalues , . Let be the direction of maximum variance with .
The value of ______
(Answer in integer)
The value of ______
(Answer in integer)
Answer: 100
The data has zero mean (). So the covariance matrix is simply . For any unit vector we get:
Here is the direction of maximum variance. This means it is the top eigenvector of the covariance matrix, so the quantity equals the largest eigenvalue.
The eigenvalues are . The largest one is at :
Answer: 100
Here is the direction of maximum variance. This means it is the top eigenvector of the covariance matrix, so the quantity equals the largest eigenvalue.
The eigenvalues are . The largest one is at :
Answer: 100