All questions of Database Design (Integrity Constraints, Normalization) for Computer Science Engineering (CSE) Exam

Consider the following set of functional dependency on the schema (A, B,C)
A→BC, B→C, A→B, AB→C
The canonical cover for this set is:
  • a)
    A->BC and B->C
  • b)
    A->BC and AB->C
  • c)
    A->BC and A->B
  • d)
    A->B and B->C
Correct answer is option 'A'. Can you explain this answer?

Gate Gurus answered
All of the FDs are implied by the FDs {A->BC, B->C}
From option b: A+=BC (hence A->BC, A->b and AB->Care implied by FDs set given in option b)
   B+=BC (hence B->C is implied by FDs set given in option b)

What is the canonical cover of the following set F of functional dependencies on the schema(A, B,C)?
A → BC 
B → C 
A → B
AB → C
  • a)
    A → BC
  • b)
    A → B
    B → C
  • c)
    AB → C
    A → B
  • d)
    A → B
Correct answer is option 'B'. Can you explain this answer?

Gate Gurus answered
There are two functional dependencies with the same set of attributes on the left side of the arrow:
A → BC
A → B
We can combine these functional dependencies into A → BC.
A is extraneous in AB → C. This is true because B → C is already there in the given set of functional dependencies. 
C is extraneous in A → BC because it is logically implied by A → B and B → C.
Thus, the canonical cover is:
A → B
B → C

Consider a schema R(A,B,C,D) and functional dependencies A->B and C->D. Then the decomposition of R into R1(AB) and R2(CD) is
  • a)
    dependency preserving and lossless join
  • b)
    lossless join but not dependency preserving
  • c)
    dependency preserving but not lossless join
  • d)
    not dependency preserving and not lossless join
Correct answer is option 'C'. Can you explain this answer?

Nisha Das answered
Dependency Preserving Decomposition:
Decomposition of R into R1 and R2 is a dependency preserving decomposition if closure of functional dependencies after decomposition is same as closure of of FDs before decomposition.
A simple way is to just check whether we can derive all the original FDs from the FDs present after decomposition.
In the above question R(A, B, C, D) is decomposed into R1 (A, B) and R2(C, D) and there are only two FDs A -> B and C -> D. So, the decomposition is dependency preserving
Lossless-Join Decomposition:
Decomposition of R into R1 and R2 is a lossless-join decomposition if at least one of the following functional dependencies are in F+ (Closure of functional dependencies)
R1 ∩ R2 → R1
OR
R1 ∩ R2 → R2
In the above question R(A, B, C, D) is decomposed into R1 (A, B) and R2(C, D), and R1 ∩ R2 is empty. So, the decomposition is not lossless.

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
Correct answer is option 'C'. Can you explain this answer?

Uday Saha answered
Background :
  • Lossless-Join Decomposition:
    Decomposition of R into R1 and R2 is a lossless-join decomposition if at least one of the following functional dependencies are in F+ (Closure of functional dependencies)
R1 ∩ R2 → R1
OR
R1 ∩ R2 → R2
  • dependency preserving :
    Decomposition of R into R1 and R2 is a dependency preserving decomposition if closure of functional dependencies after decomposition is same as closure of of FDs before decomposition.
    A simple way is to just check whether we can derive all the original FDs from the FDs present after decomposition.
Question : We know that for lossless decomposition common attribute should be candidate key in one of the relation. A) A->B, B->CD R1(AB) and R2(BCD) B is the key of second and hence decomposition is lossless. B) A->B, B->C, C->D R1(AB) , R2(BC), R3(CD) B is the key of second and C is the key of third, hence lossless. C) AB->C, C->AD R1(ABC), R2(CD) C is key of second, but C->A violates BCNF condition in ABC as C is not a key. We cannot decompose ABC further as AB->C dependency would be lost.D) A ->BCD Already in BCNF. Therefore, Option C AB->C, C->AD is the answer.

In an entity relationship, y is the dominant entity and x is a subordinate entity. Which of the following is/are incorrect?
  • a)
    Operationally , if y is deleted, so is x
  • b)
    x is existence dependent on y 
  • c)
    Operationally x is deleted, so is y
  • d)
    Operationally, x is deleted, y remains the same
Correct answer is option 'C'. Can you explain this answer?

Abhiram Goyal answered
1. y is dominant entity.
2. x is subordinate entity..
Since, y is dominant entity. So does not depend on any other and x is subordinate. So x is existence dependent on y and deletion of x does not effect y, So, x is detected, so y is incorrect.

Which of the following is true given 2 schemes F & G
F : {A → BC, B → C, AC → B}
G : {AB → C, A → B, A → C}
  • a)
    F covers G
  • b)
    G covers F
  • c)
    F & G cover each other
  • d)
    None of these
Correct answer is option 'A'. Can you explain this answer?

Gate Gurus answered
i) Check for if F covers G :
checking FDs of F :-
{AB+} = {ABC}
{A+} = {ABC}
∴ F covers G
ii) check for it G covers F :
Cheeking FDs of G:-
{A+} = {ABC}
{B+} = {B} ⇒ B → C not covered
{AC+} = {ABC}
∴ G doesn’t covers F
Hence, a is the correct answer.

A functional dependency of the form X → Y is trivial if
  • a)
  • b)
  • c)
     
  • d)
Correct answer is option 'C'. Can you explain this answer?

Aaditya Ghosh answered
A trivial functional dependency is a database dependency that occurs when describing a functional dependency of an attribute or of a collection of attributes that includes the original attribute.
So, Option c is correct answer.

Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F = {CH -> G, A -> BC, B -> CFH, E -> A, F -> EG} is a set of functional dependencies (FDs) so that F+ is exactly the set of FDs that hold for R. How many candidate keys does the relation R have?
  • a)
    3
  • b)
    4
  • c)
    5
  • d)
    6
Correct answer is option 'B'. Can you explain this answer?

Baishali Bajaj answered
Here we can see that D is not part of any FD's , hence D must be part of the candidate key.

Now D+ ={ D}.

 Hence we have to add A,B,C,E,F,G,H  to D and check which of them are Candidate keys of size 2.

We can proceed as 

AD+= {A,B,C,D,E,F,G,H}

Similarly we see BD+ , ED+ and FD+ also gives us all the attributes.Hence AD,BD,ED,FD are definitely the candidate keys.

But CD+ , GD+ and HD+ doesnt give all the attributes hence CD,GD and HD are not candidate keys.

Now we need to check the candidate keys of size 3 . Since AD , BD, ED, FD are all candidate keys hence we can't find candidate keys by adding elements to them as they will give us superkeys as they are already minimal. Hence we have to proceed with CD,GD and HD.

 Also we can't add any of {A,B,E,F} to CD, GD, HD as they will again give us superset of {AD,BD,ED,FD} . 

Hence we can only add among {C,G,H} to CD, GD, HD.

Adding C to GD and HD we get GCD , HCD. Taking closure and we will see they are not candidate keys.

Adding H to GD we get GHD which is also not a candidate key.(no more options with 3 attributes possible)

Now we need to check for candidate keys with 4 attributes . Since only remaining options are CGH and we have to add D only possible key of size 4 is CGHD whose closure also doesn't give us all of the attributes in the relation(All possible options covered)

Hence no of candidate keys are 4 : AD,BD,ED,FD.

Third normal form is inadequate in situations where the relation
  • a)
    Has multiple candidate keys
  • b)
    Has candidate keys that are composite
  • c)
    Has overlapped candidate keys
  • d)
    All of the above
Correct answer is option 'D'. Can you explain this answer?

Sanya Agarwal answered
Third normal form is considered adequate for relational database design, it is inadequate in all situations with the relation having multiple, composes or overlapped candidate keys.

The left side and the right side of a functional dependency are sometimes called __________and __________, respectively.
  • a)
    Determinant; Dependent
  • b)
    Domain; Attributes
  • c)
    Tuple, Relation
  • d)
    Range; Table
Correct answer is option 'A'. Can you explain this answer?

Vertex Academy answered
The left side and the right side of a functional dependency are sometimes called "determinant" and "dependent", respectively.
In a functional dependency, the determinant is the set of one or more attributes that determine the values of another set of attributes, called the dependent attributes. The determinant is typically on the left-hand side of the functional dependency arrow (→), while the dependent attributes are on the right-hand side.
For example, if we have a functional dependency A→B, it means that the values of attribute B are determined by the values of attribute A. In this case, A is the determinant and B is the dependent attribute.
The other options listed are not typically used to describe the left and right sides of a functional dependency. Here is a brief explanation of each:
  • Domain; Attributes - The domain refers to the set of all possible values that an attribute can take, while attributes are the specific properties of an entity or relation. These terms are not typically used to describe the left and right sides of a functional dependency.
  • Tuple; Relation - A tuple is a single row or record in a relation, while a relation is a set of tuples that share the same attributes. These terms are not typically used to describe the left and right sides of a functional dependency.
  • Range; Table - The range is the set of all possible output values of a function, while a table is a collection of related data stored in rows and columns. These terms are not typically used to describe the left and right sides of a functional dependency.
 
Therefore, the correct answer is "Determinant; Dependent".

Which one of the following attribute can be taken as a primary key?
  • a)
    Name
  • b)
    Street
  • c)
    Id
  • d)
    Department
Correct answer is option 'C'. Can you explain this answer?

Sudhir Patel answered
The attributes name, street and department can repeat for some tuples. But the id attribute has to be unique. So it forms a primary key.

Which of the following is not an integrity constraint?
  • a)
    Not null
  • b)
    Positive
  • c)
    Unique
  • d)
    Check ‘predicate’
Correct answer is option 'B'. Can you explain this answer?

Aashna Sen answered
Integrity Constraints in Database
Integrity constraints in a database ensure the accuracy and consistency of data stored in the database. They define the rules that data must follow in order to maintain data integrity.

Types of Integrity Constraints
- Not Null: This constraint ensures that a column cannot have a NULL value. It enforces the presence of a value in the column.
- Unique: This constraint ensures that all values in a column are unique, i.e., no duplicate values are allowed.
- Check 'predicate': This constraint allows you to specify a condition that must be met for the data to be entered or updated in a table.

Explanation of Option B
- Positive: The term "positive" is not an integrity constraint in database management. It does not define any rule or condition related to data integrity. Therefore, option B is not an integrity constraint.
In conclusion, while options a), c), and d) are examples of integrity constraints that help maintain the integrity of data in a database, option b) (Positive) is not a valid integrity constraint.

Suppose the adjacency relation of vertices in a graph is represented in a table Adj(X,Y). Which of the following queries cannot be expressed by a relational algebra expression of constant length?
  • a)
    List of all vertices adjacent to a given vertex
  • b)
    List all vertices which have self loops
  • c)
    List all vertices which belong to cycles of less than three vertices
  • d)
    List all vertices reachable from a given vertex
Correct answer is option 'D'. Can you explain this answer?

Avi Kulkarni answered
(A) This is simple query as we need to find (X, Y) for a given X. (B) This is also simple as need to find (X, X) (C) :-> Cycle < 3 . Means cycle of length 1 & 2. Cycle of length 1 is easy., Same as self loop. Cycle of length 2 is is also not too hard to compute. Though it'll be little complex, will need to do like (X,Y) & (Y, X ) both present & X != Y,. We can do this with constant RA query. (D) :-> This is most hard part. Here we need to find closure of vertices. This will need kind of loop. If the graph is like skewed tree, our query must loop for O(N) Times. We can't do with constant length query here. Answer is :-> D

Entity set TRANSACTION has the attributes transaction number, date, amount. Entity set ACCOUNT has the attributes account number, customer name, balance.
Q. Which is the primary key of the weak entity?
  • a)
    Account number
  • b)
    {Account number, transaction number}
  • c)
    {Account number, date}
  • d)
    {Transaction number, date}
Correct answer is option 'B'. Can you explain this answer?

Krithika Gupta answered
In order to identify each transaction of any account the key of strong entity with the addition of the discriminator of weak entity can be taken. Here [Account number, transaction number] act as the primary key of weak entity. This is because weak entity has no existence without strong entity.

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
Correct answer is option 'A'. Can you explain this answer?

Gauri Banerjee answered
First Normal Form A relation is in first normal form if every attribute in that relation is singled valued attribute. Second Normal Form A relation is in 2NF iff it has No Partial Dependency, i.e.no non-prime attribute (attributes which are not part of any candidate key) is dependent on any proper subset of any candidate key of the table. This table has Partial Dependency f1->f3, f2-> f4 given (F1,F2) is Key So answer is A

Find the minimal set of FDs.
R(A, B, C, D)
F : { A -> B, C -> B, D -> ABC, AC -> D}
  • a)
    F : { A -> B, C -> B, D -> AB, AC -> D}
  • b)
    F : { A -> B, C -> B, D -> AC, AC -> D}
  • c)
    F : { A -> B, C -> B, D -> BC, AC -> D}
  • d)
    None
Correct answer is option 'B'. Can you explain this answer?

Gate Gurus answered
C → B
A → B
AC → D
D → ABC
Given that, D → ABC
Case I:
B functionally dependent on  A so we replace
B to A
D → AAC
D → AC
Case II:
B functionally dependent on C, so we replace
B to C
D → ACC
D → AC

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
Correct answer is option 'C'. Can you explain this answer?

Meghana Tiwari answered
Statement: Relational algebra has the same power as safe relational calculus.

Explanation:
To understand the expressive power of the formal relational query languages, let's first define what each of these languages is:

1. Relational Algebra:
Relational algebra is a procedural query language used to query relational databases. It consists of a set of operations that manipulate relations to produce desired results. The operations in relational algebra include selection, projection, union, set difference, Cartesian product, join, and division.

2. Relational Calculus:
Relational calculus is a non-procedural query language used to query relational databases. It specifies what data to retrieve from the database without specifying how to retrieve it. There are two types of relational calculus: tuple relational calculus (TRC) and domain relational calculus (DRC).

Now, let's analyze the given statements:

a) Relational algebra is more powerful than relational calculus:
This statement is false. Relational algebra and relational calculus are two different query languages with different approaches. Neither is more powerful than the other in terms of expressive power.

b) Relational algebra has the same power as relational calculus:
This statement is false. Relational algebra and relational calculus have different expressive powers. Relational calculus can express more complex queries, including existential and universal quantifiers, which cannot be expressed in relational algebra.

c) Relational algebra has the same power as safe relational calculus:
This statement is true. Safe relational calculus is a subset of relational calculus that excludes certain unsafe operations such as division and difference. Relational algebra and safe relational calculus have the same expressive power, meaning that any query expressible in one language can be expressed in the other.

d) None of the above:
This statement is false. As explained above, statement c is true, which means that none of the other statements are true.

In conclusion, the correct answer is option c) "Relational algebra has the same power as safe relational calculus." This means that relational algebra and safe relational calculus have the same expressive power, while relational calculus (including unsafe operations) can express more complex queries.

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'.
Correct answer is option 'A'. Can you explain this answer?

Explanation:
The given SQL query is selecting the columns `firstName` and `lastName` from the table `Employee` based on a condition. Let's break down the query and analyze each part.

SELECT firstName, lastName:
This part of the query specifies the columns that should be selected and displayed in the result. In this case, it is the `firstName` and `lastName` columns.

FROM Employee:
This part of the query specifies the table from which the data should be retrieved. In this case, it is the `Employee` table.

WHERE lastName BETWEEN A% AND D%:
This part of the query specifies the condition that needs to be satisfied for a row to be included in the result. The condition is that the `lastName` should be between `A%` and `D%`.

Explanation of Option A:
Option A states that the query will display all the employees having last names starting with the alphabets A till D inclusive of A and exclusive of D. Let's analyze if this is true based on the given query.

- The condition `lastName BETWEEN A% AND D%` uses the `BETWEEN` operator to specify a range.
- In SQL, the `BETWEEN` operator is used to select values within a range. The range is specified using two values, the start value and the end value.
- In this case, the start value is `A%` and the end value is `D%`. The `%` is a wildcard character that matches any number of characters.
- Therefore, the condition `lastName BETWEEN A% AND D%` will select all the last names that start with the alphabets A, B, or C. It will exclude the last names starting with the alphabet D.
- Since the query only selects the `firstName` and `lastName` columns, it will display all the employees satisfying the condition.

Based on this analysis, it is clear that option A is the correct answer. The query will display all the employees having last names starting with the alphabets A till D inclusive of A and exclusive of D.

 A _________ Fc for F is a set of dependencies such that F logically implies all dependencies in Fc, and Fc logically implies all dependencies in F.
  • a)
    Canonical cover
  • b)
    Complete cover
  • c)
    Canonical dependency
  • d)
    Canonical clause
Correct answer is option 'A'. Can you explain this answer?

Naina Shah answered
Understanding Canonical Cover
A canonical cover is an essential concept in database theory, particularly in the context of functional dependencies. It serves to simplify a set of functional dependencies while preserving their meaning.
Definition of Canonical Cover
- A canonical cover for a set of functional dependencies \( F \) is a minimal set \( Fc \) such that:
- Logical Implication: \( F \models Fc \) (meaning every dependency in \( Fc \) is implied by \( F \)).
- Equivalence: \( Fc \models F \) (meaning every dependency in \( F \) is implied by \( Fc \)).
Importance of Canonical Cover
- Simplification: It reduces redundancy in the set of functional dependencies. By having a minimal set, it becomes easier to analyze and implement.
- Efficiency: Working with a canonical cover can lead to more efficient database design and normalization processes.
Characteristics of Canonical Cover
- Minimality: No functional dependency in \( Fc \) can be removed without altering the meaning of the set.
- Irreducibility: Each dependency in \( Fc \) should not be expressible as a union of other dependencies.
Conclusion
In summary, option A, "Canonical cover," is the correct answer because it encapsulates the properties of dependencies in a manner that maintains both logical implication and equivalence between the original set \( F \) and the reduced set \( Fc \). This makes it a vital tool in database normalization and the management of functional dependencies.

Consider the relation:
Employee (Emp-No, Emp-name, salary, project- no, due-date)
(Assuming an 1-1 relationship between project and employees)
Project-no is functionally dependent on
  • a)
    Emp-name
  • b)
    Emp-no
  • c)
    Due -date
  • d)
    None of these
Correct answer is option 'B'. Can you explain this answer?

Sarthak Desai answered
The relation EMPLOYEE has one to one relation b/w project and employee i.e. each employee has being assigned a project and each project is associated with only one employee, hence project- number is functionally dependent on Emp-no.

Consider the following set of functional dependencies on the scheme (A, B, C).
A —> BC, B —> C, A —> B ,A B —> C
The canonical cover for this set is
  • a)
    A → B and B → C
  • b)
    A → BC and AB → C
  • c)
    A → BC and A → B
  • d)
    A → BC and B → C
Correct answer is option 'A'. Can you explain this answer?

 
In the given FDs,

1) Convert elements on LHS as singleton

           Thus, A -> BC can be written as A-> B and A->C

2) Remove composite attributes from LHS

           Here, AB -> C can be written as A -> C, because we have an FD {A -> B}.

3) Remove redundant attributes

        We have FD = {A -> B, A -> C , B -> C}

       this is a transitive depenency A -> B -> C. After remove redundancy, we get A->B, B->C.

Option A is the required answer

Consider the following set of functional dependencies F on the schema S(P, Q, R)
F = {P → QR, PQ → R, Q → R, P → Q}
The canonical cover of the above given set is 
  • a)
    P → QR and PQ → R
  • b)
    P → QR and P → Q
  • c)
    P → Q and Q → R
  • d)
    P → QR and Q → R
Correct answer is option 'C'. Can you explain this answer?

Varun Sen answered
→ Q, Q → R}

This set of functional dependencies implies that:

- For any two tuples in the relation, if they have the same value for P, then they must also have the same value for Q (since P → Q).
- For any two tuples in the relation, if they have the same value for Q, then they must also have the same value for R (since Q → R).

We can use these functional dependencies to check for redundancies and anomalies in the relation. For example:

- Redundancy: If we have a tuple with values (1, 2, 3) and another tuple with values (1, 2, 4), we can see that the value of Q (2) is repeated unnecessarily. We could instead have a single tuple with values (1, 2, 3, 4). This is known as a functional dependency preservation, and we can use it to normalize the relation.
- Anomaly: If we have a tuple with values (1, 2, NULL) and another tuple with values (1, NULL, 4), we cannot determine the value of R for the tuple (1, 2, 4). This is known as a functional dependency violation, and we need to ensure that such anomalies do not occur in the relation. This can be achieved by enforcing constraints on the values allowed in the relation.

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.

Q. 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.
Correct answer is option 'A'. Can you explain this answer?

Abhiram Goyal answered
S1: Every table with two single-valued
attributes is in 1NF, 2NF, 3NF and BCNF.
A relational schema R is in BCNF iff in Every non-trivial Functional Dependency X->Y, X is Super Key. If we can prove the relation is in BCNF then by default it would be in 1NF, 2NF, 3NF also. Let R(AB) be a two attribute relation, then
  1. If {A->B} exists then BCNF since {A}+ = AB = R
  2. If {B->A} exists then BCNF since {B}+ = AB = R
  3. If {A->B,B->A} exists then BCNF since A and B both are Super Key now.
  4. If {No non trivial Functional Dependency} then default BCNF.
Hence it's proved that a Relation with two single - valued attributes is in BCNF hence its also in 1NF, 2NF, 3NF. Hence S1 is true.
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.
As we know Minimal Cover is the process of eliminating redundant Functional Dependencies and Extraneous attributes in Functional Dependency Set. So each dependency of F = {AB->C, D->E, AB->E, E->C} should be implied in minimal cover. As we can see AB->E is not covered in minimal cover since {AB}+ = ABC in the given cover {AB->C, D->E, E->C} Hence, S2 is false.

A _________ integrity constraint requires that the values appearing in specified attributes of any tuple in the referencing relation also appear in specified attributes of at least one tuple in the referenced relation.
  • a)
    Referential
  • b)
    Referencing
  • c)
    Specific
  • d)
    Primary
Correct answer is option 'A'. Can you explain this answer?

Sudhir Patel answered
A relation, say r1, may include among its attributes the primary key of another relation, say r2. This attribute is called a foreign key from r1, referencing r2. The relation r1 is also called the referencing relation of the foreign key dependency, and r2 is called the referenced relation of the foreign key.

Consider attributes ID, CITY and NAME. Which one of this can be considered as a super key?
  • a)
    NAME
  • b)
    ID
  • c)
    CITY
  • d)
    CITY, ID
Correct answer is option 'B'. Can you explain this answer?

Nishanth Roy answered

Explanation:

Super Key:

A super key is a set of attributes that uniquely identifies each tuple in a relation. In other words, a super key is a combination of attributes that can uniquely identify a record in a table.

Attributes:

- ID
- CITY
- NAME

Super Key Identification:

- ID:
- Since ID is a unique identifier for each record in a table, it can be considered as a super key.
- Using ID alone, we can uniquely identify each tuple in the relation without any ambiguity.

- CITY:
- City alone may not be a super key as multiple records can have the same city name.
- To uniquely identify a record, we may need to use another attribute along with CITY.

- NAME:
- Name alone may not be a super key as multiple individuals can have the same name.
- To uniquely identify a record, we may need to use another attribute along with NAME.

- CITY, ID:
- The combination of CITY and ID can also be considered as a super key as it uniquely identifies each tuple in the relation.
- However, since ID alone can serve as a super key, the combination of CITY and ID may not be necessary.

Therefore, in this scenario, the attribute ID can be considered as a super key as it uniquely identifies each record in the relation.

Consider the relation scheme R = {E, F, G, H, I, J, K, L, M, M} and the set of functional dependencies {{E, F} -> {G}, {F} -> {I, J}, {E, H} -> {K, L}, K -> {M}, L -> {N} on R. What is the key for R?
  • a)
    {E, F}
  • b)
    {E, F, H}
  • c)
    {E, F, H, K, L}
  • d)
    {E}
Correct answer is option 'B'. Can you explain this answer?

Hiral Nair answered
All attributes can be derived from {E, F, H} To solve these kind of questions that are frequently asked in GATE paper, try to solve it by using shortcuts so that enough amount of time can be saved.
Fist Method: Using the given options try to obtain closure of each options. The solution is the one that contains R and also minimal Super Key, i.e Candidate Key.
A) {EF}+ = {EFGIJ} ≠ R(The given relation)
B) {EFH}+ = {EFGHIJKLMN} = R (Correct since each member of the given relation is determined)
C) {EFHKL}+ = {EFGHIJKLMN} = R (Not correct although each member of the given relation can be determined but it is not minimal, since by the definition of Candidate key it should be minimal Super Key)
D) {E}+ = {E} ≠ R
Second Method:
Since, {EFGHIJKLMN}+ = {EFGHIJKLMN}
{EFGHIJKLM}+ = {EFGHIJKLMN} (Since L -> {N}, hence can replace N by L)
In a similar way K -> {M} hence replace M by K
{EFGHIJKL}+ = {EFGHIJKLMN}
Again {EFGHIJ}+ = {EFGHIJKLMN} (Since {E, H} -> {K, L}, hence replace KL by EH)
{EFGH}+ = {EFGHIJKLMN} (Since {F} -> {I, J})
{EFH}+ = {EFGHIJKLMN} (Since {E, F} -> {G})

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.
Correct answer is option 'C'. Can you explain this answer?

Tanishq Chavan answered
Explanation:

A transaction is a sequence of operations performed on a database that must be treated as a single unit of work. It ensures the consistency, integrity, and durability of the database. The correct definition of a transaction is provided in option C, which states that 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. Let's understand each component mentioned in the option:

DML (Data Manipulation Language) statements:
DML statements are used to retrieve, manipulate, and modify the data stored in the database. Examples of DML statements include SELECT, INSERT, UPDATE, and DELETE. These statements are used to perform operations on the data within a transaction.

DDL (Data Definition Language) statements:
DDL statements are used to define or modify the structure of the database schema. These statements include CREATE, ALTER, and DROP statements. Although DDL statements are not typically part of a transaction, they can be included in a transaction to ensure the atomicity of a set of operations.

DCL (Data Control Language) statements:
DCL statements are used to control access to the database. These statements include GRANT and REVOKE, which are used to grant or revoke permissions on database objects. DCL statements are also not typically part of a transaction, but they can be included if necessary.

TCL (Transaction Control Language) statements:
TCL statements are used to control the transactions in a database session. These statements include COMMIT, ROLLBACK, and SAVEPOINT. COMMIT is used to save the changes made in a transaction, ROLLBACK is used to undo the changes made in a transaction, and SAVEPOINT is used to set a point in the transaction from which it can be rolled back.

Therefore, a transaction can consist of a collection of DML statements to manipulate the data, or a DDL or DCL or TCL statement to modify the database schema or control the transactions. These statements together form a logical unit of work in a database session, ensuring the atomicity, consistency, isolation, and durability properties of a transaction.

Foreign key is the one in which the ________ of one relation is referenced in another relation.
  • a)
    Foreign key
  • b)
    Primary key
  • c)
    References
  • d)
    Check constraint
Correct answer is option 'B'. Can you explain this answer?

Athul Pillai answered
The correct answer is option 'B': Primary key.

A primary key is a unique identifier for a record in a database table. It uniquely identifies each record in a table and ensures that there are no duplicate values. It is used to establish relationships between different tables in a database.

A foreign key is a field in one table that refers to the primary key in another table. It creates a link between the two tables and allows for the establishment of relationships between them. The foreign key in one table is used to reference the primary key in another table.

Here's a detailed explanation of how a foreign key works:

1. Primary Key:
- A primary key is a column or a set of columns in a table that uniquely identifies each record in that table.
- It ensures that each record has a unique identifier and helps in maintaining data integrity.
- Primary keys can be composed of one or more columns, depending on the requirements of the table.
- For example, in a table of students, the primary key could be the "student_id" column.

2. Foreign Key:
- A foreign key is a column or a set of columns in a table that refers to the primary key in another table.
- It establishes a relationship between two tables by linking the foreign key in one table to the primary key in another table.
- The foreign key in one table points to the primary key in another table, creating a link between the two tables.
- For example, in a table of courses, there could be a foreign key column called "student_id" that references the primary key "student_id" in the students table.

3. Relationship between Tables:
- The relationship between two tables is established using the primary key and foreign key.
- In the example mentioned above, the primary key "student_id" in the students table is referenced by the foreign key "student_id" in the courses table.
- This relationship allows for the retrieval of data from both tables based on the shared key.
- For example, to retrieve all the courses taken by a specific student, we can use the foreign key "student_id" in the courses table to find the corresponding records in the students table.

In conclusion, a foreign key is a field in one table that references the primary key in another table. It establishes a relationship between the two tables and allows for data retrieval based on the shared key. The primary key ensures the uniqueness of each record, while the foreign key creates the link between the tables.

If a relation scheme is in BCNF, then it is also in
  • a)
    First normal form
  • b)
    Second normal form
  • c)
    Third normal form
  • d)
    All of the above
Correct answer is option 'D'. Can you explain this answer?

Saanvi Gupta answered
The correct answer is option 'D': All of the above.

• When a relation scheme is in Boyce-Codd Normal Form (BCNF), it automatically satisfies the requirements of First Normal Form (1NF), Second Normal Form (2NF), and Third Normal Form (3NF). Each normal form represents a specific level of normalization in database design.

• First Normal Form (1NF) ensures that each attribute in a relation contains only atomic (indivisible) values, with no repeating groups or arrays of values.

 Second Normal Form (2NF) builds upon 1NF by requiring that every non-key attribute in a relation is functionally dependent on the entire primary key, not just a part of it. This eliminates partial dependencies.

 Third Normal Form (3NF) takes the normalization process further by eliminating transitive dependencies. It ensures that non-key attributes depend solely on the primary key and not on other non-key attributes.

BCNF is an advanced form of normalization that is more restrictive than 3NF. It eliminates all non-trivial dependencies between attributes and ensures that each determinant (a set of attributes determining the values of other attributes) is a candidate key. BCNF is considered the highest level of normalization.

Since BCNF automatically satisfies the requirements of 1NF, 2NF, and 3NF, the correct answer is option 'D': All of the above.
Hence option (d) is correct.

Inst_dept (ID, name, salary, dept name, building, budget) is decomposed into
instructor (ID, name, dept name, salary)
department (dept name, building, budget)

This comes under
  • a)
    Lossy-join decomposition
  • b)
    Lossy decomposition
  • c)
    Both Lossy and Lossy-join decomposition
  • d)
    Lossless-join decomposition
Correct answer is option 'C'. Can you explain this answer?

Anshika Kaur answered
Explanation:

Decomposition is the process of splitting a relation schema into multiple smaller schemas in order to eliminate redundancy and improve the efficiency of the database. There are two types of decomposition: lossless-join decomposition and lossy-join decomposition.

Lossless-join decomposition:
Lossless-join decomposition is a decomposition technique that ensures that the original relation can be reconstructed from the smaller decomposed relations without any loss of information. In other words, it preserves all the functional dependencies present in the original relation.

In the given scenario, the relation Inst_dept (ID, name, salary, dept name, building, budget) is decomposed into two smaller relations: instructor (ID, name, dept name, salary) and department (dept name, building, budget). Since the functional dependencies are preserved in the decomposition, it can be considered as a lossless-join decomposition.

Lossy decomposition:
Lossy decomposition is a decomposition technique that may result in the loss of some information from the original relation. It is usually used when the preservation of all functional dependencies is not necessary.

In the given scenario, there is no loss of information in the decomposition of Inst_dept into instructor and department. All the attributes from the original relation are present in the decomposed relations, and the functional dependencies are preserved. Therefore, it can be concluded that this decomposition is not lossy.

Lossy-join decomposition:
Lossy-join decomposition is a combination of lossless-join decomposition and lossy decomposition. It is a decomposition technique that both preserves all the functional dependencies and may result in the loss of some information.

In the given scenario, since the decomposition of Inst_dept into instructor and department is both lossless and not lossy, it can be considered as a lossy-join decomposition.

Conclusion:
The given decomposition of the relation Inst_dept into instructor and department is both lossless and lossy-join decomposition.

Let R (ABCDEFGH) be a relation schema and F be the set of dependencies F = {A → B, ABCD → E, EF → G, EF → H and ACDF →EG}. The minimal cover of a set of functional dependencies is
  • a)
    A → B, ACD → E, EF → G, EF → H and ACDF → G
  • b)
    A → B, ACD → E, EF → G, EF → H and ACDF → E
  • c)
    A → B, ABCD → E, EF → H and EF → G
  • d)
    A → B, ACD → E, EF → G, and EF → H
Correct answer is option 'D'. Can you explain this answer?

Vibhor Goyal answered
Use the union rule to replace
EF → G and EF → H 
EF → GH
F = { A → B  ABCD → E  EF → GH  ACDF → EG }
B is extraneous in ABCD → E because B ∈ ABCD and {A → B, ABCD → E, EF → GH, ACDF → EG}
logically implies {A → B, ACD → E, EF → GH, ACDF → EG}.
This is because every  ACD → E.
This FD can be derived using Armstrong’s Axioms from A → B and ABCD → E via transitivity rule
So remove B from ABCD → E.
F = { A → B ACD → E  EF → GH ACDF → EG }
E is extraneous in ACDF → EG because E ∈ EG and {A → B, ACD → E, EF → GH, ACDF → G}
logically implies {A → B, ACD → E, EF → GH, ACDF → EG}
remove E from ACDF → EG
F = { A → B ACD → E EF → GH ACDF → G}
G is extraneous in ACDF → G. Note that ACDF → G is already implied by ACD → E and EF → GH in F
remove ACDF → G from F.
None of the remaining FD's in F have extraneous attributes so the minimal cover is
A → B, ACD → E, EF → G, EF → H.

For the relation R(ABCDEFGH) with FD's= {CH->G, A->BC, B->CHF, E->A, F->EG such that F+ is exactly the set of FDs that hold for R.} Consider the FDs given in above question. The relation R is
  • a)
    in 1NF, but not in 2NF.
  • b)
    in 2NF, but not in 3NF.
  • c)
    in 3NF, but not in BCNF.
  • d)
    in BCNF
Correct answer is option 'A'. Can you explain this answer?

The table is not in 2nd Normal Form as the non-prime attributes are dependent on subsets of candidate keys. The candidate keys are AD, BD, ED and FD. In all of the following FDs, the non-prime attributes are dependent on a partial candidate key. A -> BC B -> CFH F -> EG

Chapter doubts & questions for Database Design (Integrity Constraints, Normalization) - Database Management System (DBMS) 2025 is part of Computer Science Engineering (CSE) exam preparation. The chapters have been prepared according to the Computer Science Engineering (CSE) exam syllabus. The Chapter doubts & questions, notes, tests & MCQs are made for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests here.

Chapter doubts & questions of Database Design (Integrity Constraints, Normalization) - Database Management System (DBMS) in English & Hindi are available as part of Computer Science Engineering (CSE) exam. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.

Signup to see your scores go up within 7 days!

Study with 1000+ FREE Docs, Videos & Tests
10M+ students study on EduRev