0% found this document useful (0 votes)
19 views28 pages

Database Normalization and SQL Queries Guide

The document covers various database concepts including Cartesian products, normal forms (BCNF, 2NF, 3NF), SQL commands for creating tables and querying data, and the differences between natural and conditional joins. It explains attributes, including single-valued and multi-valued, as well as integrity constraints like entity and referential integrity. Additionally, it discusses the Three-Schema Architecture of DBMS and provides SQL examples for practical application.

Uploaded by

Somalika Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views28 pages

Database Normalization and SQL Queries Guide

The document covers various database concepts including Cartesian products, normal forms (BCNF, 2NF, 3NF), SQL commands for creating tables and querying data, and the differences between natural and conditional joins. It explains attributes, including single-valued and multi-valued, as well as integrity constraints like entity and referential integrity. Additionally, it discusses the Three-Schema Architecture of DBMS and provides SQL examples for practical application.

Uploaded by

Somalika Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

If a relation A has m rows and p columns while relation B has n rows and q

columns then the number of rows and columns in the cartesian product of A
and B will be respectively ________ and _________.
m×n, p+q

A relation is in Boyce-Codd Normal Form (BCNF) if and only if for every


functional dependency X → Y, X is a __________.
super key

The _________ command is used to add a new attribute to an existing table.


ALTER TABLE

A super key that has the minimum number of attributes required to uniquely
identify a tuple is called a __________.
candidate key

The process of decomposing a relation into multiple relations to remove


redundancy is called __________.
Normalization

If a relation contains a multivalued attribute, it violates __________ normal


form.
First Normal Form (1NF)

If the closure of an attribute set is the entire relation then the attribute set is a
__________.
super key
In a relation R (A, B, C, D), the set of FDs, F = {AB → C, C → D} holds. What is the
highest normal form of R?
Second Normal Form (2NF)

An all key relation is in ___________ normal form.


Sixth Normal Form (6NF)

A candidate key that has not been chosen as the primary key is called
___________.
alternate key

A relation is in Third Normal Form (3NF) if it is in 2NF and does not have
__________ dependencies.
Transitive

If in a relation, X and Y are sets of attributes where X ⊆ Y then we can infer


_________.
Y→X

1. Consider the following tables and write queries to create the tables
assuming the primary keys and the foreign keys. Employee (EmpID, EmpName,
BirthDate, Salary, DeptNo), Department (DeptID, DeptName, Location),
Dependent (DepID, Name, BirthDate, EmpID), Project (ProjID, ProjName,
StartDate, EndDate, DeptID, ProjManager)
2. Consider the tables given in question 1 and write the following queries:
a. Select the projects along with their department names.
b. Select department name wise average salary paid to an employee.
c. List the projects that have taken more than one year to complete.
d. Find the department name and dependents born after 2005 along with the
employee they are dependent on.
e. Select names of pairs of all employees who are in the same department,
along with the department number.
f. List the departments that have no projects.
g. Select the projects that have not completed yet.
h. Find the details of employees who earn more than the average salary of
his/her department.
i. Select names and IDs of employees who have more than one dependent.
j. List the employees who are working as manager in two projects.

Here are the SQL queries for creating the tables and solving the given queries:

1. Creating the Tables with Primary and Foreign Keys


CREATE TABLE Department (
DeptID INT PRIMARY KEY,
DeptName VARCHAR(100) NOT NULL,
Location VARCHAR(100)
);

CREATE TABLE Employee (


EmpID INT PRIMARY KEY,
EmpName VARCHAR(100) NOT NULL,
BirthDate DATE,
Salary DECIMAL(10,2),
DeptNo INT,
FOREIGN KEY (DeptNo) REFERENCES Department(DeptID) ON DELETE SET
NULL
);

CREATE TABLE Dependent (


DepID INT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
BirthDate DATE,
EmpID INT,
FOREIGN KEY (EmpID) REFERENCES Employee(EmpID) ON DELETE CASCADE
);

CREATE TABLE Project (


ProjID INT PRIMARY KEY,
ProjName VARCHAR(100) NOT NULL,
StartDate DATE,
EndDate DATE,
DeptID INT,
ProjManager INT,
FOREIGN KEY (DeptID) REFERENCES Department(DeptID) ON DELETE SET
NULL,
FOREIGN KEY (ProjManager) REFERENCES Employee(EmpID) ON DELETE SET
NULL
);

2. Queries on the Given Tables


(a) Select the projects along with their department names.
SELECT [Link], [Link]
FROM Project P
JOIN Department D ON [Link] = [Link];

(b) Select department name-wise average salary paid to an employee.


SELECT [Link], AVG([Link]) AS AvgSalary
FROM Employee E
JOIN Department D ON [Link] = [Link]
GROUP BY [Link];

(c) List the projects that have taken more than one year to complete.
SELECT ProjName
FROM Project
WHERE DATEDIFF(EndDate, StartDate) > 365;

(d) Find the department name and dependents born after 2005 along with
the employee they are dependent on.
SELECT [Link], [Link] AS DependentName, [Link],
[Link] AS EmployeeName
FROM Dependent Dep
JOIN Employee E ON [Link] = [Link]
JOIN Department D ON [Link] = [Link]
WHERE YEAR([Link]) > 2005;
(e) Select names of pairs of all employees who are in the same department,
along with the department number.
SELECT [Link] AS Employee1, [Link] AS Employee2, [Link]
FROM Employee E1
JOIN Employee E2 ON [Link] = [Link] AND [Link] < [Link];

(f) List the departments that have no projects.


SELECT [Link]
FROM Department D
LEFT JOIN Project P ON [Link] = [Link]
WHERE [Link] IS NULL;

(g) Select the projects that have not completed yet.


SELECT ProjName
FROM Project
WHERE EndDate IS NULL OR EndDate > CURDATE();

(h) Find the details of employees who earn more than the average salary of
his/her department.
SELECT E.*
FROM Employee E
JOIN (
SELECT DeptNo, AVG(Salary) AS AvgSalary
FROM Employee
GROUP BY DeptNo
) AS DeptAvg ON [Link] = [Link]
WHERE [Link] > [Link];

(i) Select names and IDs of employees who have more than one dependent.
SELECT [Link], [Link]
FROM Employee E
JOIN Dependent D ON [Link] = [Link]
GROUP BY [Link], [Link]
HAVING COUNT([Link]) > 1;
(j) List the employees who are working as manager in two projects.
SELECT [Link], [Link]
FROM Employee E
JOIN Project P ON [Link] = [Link]
GROUP BY [Link], [Link]
HAVING COUNT([Link]) >= 2;

3. What are read only and updatable views? What are the conditions for a view
to be updatable?
3. Read-Only and Updatable Views
Read-Only Views:
A read-only view is a SQL view that does not allow INSERT, UPDATE, or DELETE
operations. These views are typically created using complex queries involving
joins, aggregations, or DISTINCT clauses.
Example:
CREATE VIEW ReadOnlyView AS
SELECT EmpID, EmpName, Salary FROM Employee;
Since there is no primary key in the view, it is read-only.
Updatable Views:
An updatable view allows modifications to the underlying table through
INSERT, UPDATE, or DELETE.
Conditions for a View to Be Updatable:
It should be based on a single table (or certain simple joins).
It must include the primary key of the base table.
It should not use aggregate functions, DISTINCT, GROUP BY, or HAVING.
Example:
CREATE VIEW UpdatableView AS
SELECT EmpID, EmpName, Salary FROM Employee WHERE DeptNo = 101;
Since it includes the primary key (EmpID), this view is updatable.

4. Compare Natural Join & Conditional Join with suitable examples.


4. Natural Join vs. Conditional Join

Feature Natural Join Conditional Join

Joins tables using a specific


Joins tables based on
Definition condition (not necessarily on
common attribute names.
common attributes).
Feature Natural Join Conditional Join

Condition Implicit (on common


Explicit (ON or WHERE clause).
Used attribute names).

Column Common attribute appears Both tables’ columns appear unless


Output only once. explicitly selected.

SELECT * FROM Employee E JOIN


SELECT * FROM Employee
Example Department D ON [Link] =
NATURAL JOIN Department;
[Link];

5. Explain the following with suitable examples: single valued and multi valued
attributes, stored and derived attributes.
5. Single-Valued vs. Multi-Valued Attributes & Stored vs. Derived Attributes
Single-Valued Attribute: An attribute that holds only one value per entity.
Example: Employee's EmpID or EmpName.
Multi-Valued Attribute: An attribute that can hold multiple values for a single
entity.
Example: A student's PhoneNumbers (multiple contact numbers).
Stored Attribute: An attribute directly stored in the database.
Example: BirthDate of an employee.
Derived Attribute: An attribute that is computed from other attributes.
Example: Age (calculated from BirthDate).
Example:
SELECT EmpName, BirthDate, YEAR(CURDATE()) - YEAR(BirthDate) AS Age
FROM Employee;
Here, Age is a derived attribute calculated from BirthDate.
6. Explain the concept of Attribute Inheritance with a suitable example.
6. Attribute Inheritance in Databases
Concept: In an ER model, subclasses inherit attributes from their parent
(superclass).
Example:
Employee(EmpID, EmpName, Salary)
Manager(EmpID, Bonus) → inherits from Employee
SQL Implementation (Using Inheritance via Foreign Key):
CREATE TABLE Employee (
EmpID INT PRIMARY KEY,
EmpName VARCHAR(100),
Salary DECIMAL(10,2)
);

CREATE TABLE Manager (


EmpID INT PRIMARY KEY,
Bonus DECIMAL(10,2),
FOREIGN KEY (EmpID) REFERENCES Employee(EmpID)
);
7. Explain the outer joins with suitable examples.
7. Outer Joins (Left, Right, Full) with Examples
Left Outer Join: Returns all rows from the left table and matching rows from
the right.
SELECT [Link], [Link]
FROM Employee E LEFT JOIN Department D ON [Link] = [Link];
Right Outer Join: Returns all rows from the right table and matching rows
from the left.
SELECT [Link], [Link]
FROM Employee E RIGHT JOIN Department D ON [Link] = [Link];
Full Outer Join: Returns all rows from both tables, matching where possible.
SELECT [Link], [Link]
FROM Employee E FULL OUTER JOIN Department D ON [Link] = [Link];

8. State the Armstrong’s axioms. Prove the augmentation rule and the
transitive rule.
8. Armstrong’s Axioms & Proof of Augmentation and Transitivity
Axioms:
Reflexivity: If Y ⊆ X, then X → Y.
Augmentation: If X → Y, then XZ → YZ for any attribute Z.
Transitivity: If X → Y and Y → Z, then X → Z.
Proof of Augmentation:
Given X → Y, we need to prove XZ → YZ.
Since X → Y, adding Z on both sides does not change dependency.
Therefore, XZ → YZ holds.
Proof of Transitivity:
Given X → Y and Y → Z, we need to prove X → Z.
X determines Y, and Y determines Z.
Therefore, X determines Z.

9. Explain the second normal form with a suitable example. Explain how
decomposition to 2NF removes anomalies.

9. Second Normal Form (2NF) & Decomposition


A relation is in 2NF if:
It is in 1NF (no multi-valued attributes).
It has no partial dependencies (no non-key attribute depends on only a part of
a composite key).
Example of 1NF (Not 2NF):

OrderID ProductID ProductName Quantity

1 101 Laptop 2

1 102 Mouse 1

Here, ProductName depends only on ProductID, not the whole primary key
(OrderID, ProductID).
Decomposition to 2NF:
Orders(OrderID, Quantity)
Products(ProductID, ProductName)
This removes partial dependency.

10. Explain BCNF with a suitable example. Why is BCNF called a stricter 3NF
10. BCNF (Boyce-Codd Normal Form) & Why It’s Stricter than 3NF
A relation is in BCNF if:
It is in 3NF.
For every functional dependency X → Y, X is a super key.
Example (Not in BCNF):

EmpID Dept DeptManager

1 HR A

2 IT B

Dept → DeptManager (but Dept is not a super key).


Solution: Decompose into:
Employee(EmpID, Dept)
Department(Dept, DeptManager)
Why BCNF is Stricter than 3NF?
3NF allows functional dependencies where the left side is not a super key but
the right side is a prime attribute.
BCNF removes all anomalies by ensuring every determinant is a super key.

1. Describe the Three-Schema Architecture of DBMS.


Describe the Three-Schema Architecture of DBMS
Here’s a more justified version of your answers, maintaining some bullet points
for clarity while improving readability and coherence.

1. Three-Schema Architecture of DBMS


The Three-Schema Architecture provides a structured approach to database
abstraction by separating concerns across three levels:
Internal Schema (Physical Level): Defines how data is physically stored in files,
including indexing mechanisms and data structures. Example: An Employee
table stored using a B+ tree index for efficient access.
Conceptual Schema (Logical Level): Represents the overall database structure,
including entity relationships, constraints, and data types. Example: The logical
definition of Employee(EmpID, EmpName, Salary, DeptNo).
External Schema (View Level): Defines user-specific views to control access
and improve usability. Example: HR personnel accessing only specific columns
using CREATE VIEW HR_View AS SELECT EmpName, Salary FROM Employee;.
This architecture ensures data independence, meaning changes at one level do
not necessarily affect others.

2. Compare Natural Join & Conditional Join with suitable examples.


Natural Join vs. Conditional Join
Here's a tabular comparison of Natural Join and Conditional Join with suitable
examples:

Feature Natural Join Conditional Join (Theta Join)

Joins tables based on common Joins tables using an explicitly


Definition
attribute names automatically. defined condition.

Condition Implicit (automatically detects Explicit (specified using ON or


Type common columns). WHERE).

Duplicate Eliminates duplicate columns in Retains all columns, even if they


Columns the result. have the same name.

Less flexible since it relies on More flexible as it allows joining


Flexibility
common attribute names. on any condition.

Employee(EmpID, EmpName, Employee(EmpID, EmpName,


Example DeptNo) and DeptNo) and
Tables Department(DeptNo, Department(DeptID,
DeptName). DeptName).

sql SELECT * FROM Employee E


SQL sql SELECT * FROM Employee
JOIN Department D ON
Example NATURAL JOIN Department;
[Link] = [Link];

When table attributes are well- When joining tables with


Use Case structured with consistent different attribute names or
naming. complex conditions.
3. Describe the concept of Entity Integrity and Referential Integrity.
Entity Integrity and Referential Integrity
Entity Integrity ensures that each table has a unique, non-null primary key. This
prevents duplicate or missing records.
CREATE TABLE Employee (
EmpID INT PRIMARY KEY,
EmpName VARCHAR(100)
);
Here, EmpID must be unique and cannot be null, ensuring data consistency.
Referential Integrity maintains valid foreign key relationships between tables.
A foreign key in one table must reference a valid primary key in another table.
CREATE TABLE Employee (
EmpID INT PRIMARY KEY,
EmpName VARCHAR(100),
DeptID INT,
FOREIGN KEY (DeptID) REFERENCES Department(DeptID)
);
This prevents orphaned records and maintains data integrity across
relationships.

4. Explain single-valued and multi-valued attributes with examples. Explain


Attribute

Single-Valued & Multi-Valued Attributes & Attribute Inheritance


Single-Valued Attribute: Holds only one value per entity. Example: EmpID
uniquely identifies an employee.
Multi-Valued Attribute: Stores multiple values for a single entity. Example: An
employee having multiple phone numbers:
CREATE TABLE EmployeePhones (
EmpID INT,
PhoneNumber VARCHAR(15),
FOREIGN KEY (EmpID) REFERENCES Employee(EmpID)
);
Attribute Inheritance: In hierarchical relationships, a subclass inherits
attributes from its superclass.
Example: A Manager entity inheriting EmpID from Employee.
CREATE TABLE Manager (
EmpID INT PRIMARY KEY,
Bonus DECIMAL(10,2),
FOREIGN KEY (EmpID) REFERENCES Employee(EmpID)
);
This approach avoids redundancy while maintaining relationships.

5. SQL Queries for Table Creation

SQL Queries to Create Tables


CREATE TABLE Student (
StudID INT PRIMARY KEY,
StudName VARCHAR(100),
BirthDate DATE,
StudAdd VARCHAR(255),
CourseNo INT
);
CREATE TABLE Course (
CourseID INT PRIMARY KEY,
CourseName VARCHAR(100),
Duration INT
);

CREATE TABLE Enrollment (


CourseID INT,
StartDate DATE,
StudID INT,
PRIMARY KEY (CourseID, StudID),
FOREIGN KEY (CourseID) REFERENCES Course(CourseID),
FOREIGN KEY (StudID) REFERENCES Student(StudID)
);
This ensures proper entity relationships and maintains referential integrity.

6. State Armstrong's Axioms & Prove Augmentation and Transitivity Rules.


Armstrong’s Axioms & Proof of Rules
7. Discuss weak entity sets & identifying relationships with examples.
Weak Entity Sets & Identifying Relationships
A Weak Entity Set lacks a primary key and depends on a strong entity for
identification. It requires an Identifying Relationship, where a strong entity
provides uniqueness.
Example: A Dependent entity depends on Employee, using EmpID as an
identifying attribute.
CREATE TABLE Dependent (
DepID INT,
Name VARCHAR(100),
BirthDate DATE,
EmpID INT,
PRIMARY KEY (DepID, EmpID),
FOREIGN KEY (EmpID) REFERENCES Employee(EmpID)
);
The composite primary key (DepID, EmpID) ensures uniqueness while
maintaining dependency.

8. Explain the concept of Generalization and Specialization.


Generalization & Specialization
Generalization: Combines multiple entities into a higher-level entity. Example:
Car and Truck generalizing into Vehicle.
Specialization: Breaks down a general entity into subtypes. Example: Employee
specializing into Manager and Engineer.
Both techniques help in designing hierarchical relationships in databases.

9. Explain 2NF with a suitable example.


Second Normal Form (2NF) & Anomalies Removal
Second Normal Form (2NF) and Anomaly Removal
Definition:
A table is in Second Normal Form (2NF) if:
It is in First Normal Form (1NF) (i.e., no repeating groups or multi-valued
attributes).
No partial dependency exists, meaning every non-key attribute is fully
functionally dependent on the entire primary key.
Example & Anomaly Removal
Consider the following table:

OrderID ProductID ProductName SupplierID SupplierName Quantity

1 101 Pen 501 ABC Corp 10

1 102 Notebook 502 XYZ Ltd 5

2 101 Pen 501 ABC Corp 15

Problems (Anomalies) in 1NF:


Insertion Anomaly: Cannot add a new product without an order.
Update Anomaly: If ProductName changes, multiple rows need updating.
Deletion Anomaly: Deleting OrderID = 2 removes product details.
Decomposing to 2NF
Since (OrderID, ProductID) is the primary key, but ProductName, SupplierID,
and SupplierName depend only on ProductID, we split the table:
1. Orders Table (Eliminates partial dependency)

OrderID ProductID Quantity

1 101 10

1 102 5

2 101 15
2. Products Table (Stores product details separately)

ProductID ProductName SupplierID

101 Pen 501

102 Notebook 502

3. Suppliers Table (Further normalization)

SupplierID SupplierName

501 ABC Corp

502 XYZ Ltd

Benefits of 2NF:
Removes partial dependencies, ensuring data consistency.
Prevents redundancy, reducing storage wastage.
Eliminates anomalies, making insertion, deletion, and updates efficient.
Thus, 2NF improves database design by structuring data logically while
preserving integrity.

10. SQL Queries for HOTEL Database


SQL Queries for HOTEL Database
SQL Queries for the Given HOTEL Database
Given the tables:
HOTEL(hotelno, name, address)
ROOM(roomno, hotelno, type, price_pn)
BOOKING(hotelno, guestno, dateform, dateto, roomno)
GUEST(guestno, name, address)
Here are the required SQL queries:
(a) List all hotels situated in Kolkata
SELECT * FROM HOTEL WHERE address = 'Kolkata';
This query retrieves all hotel details where the address is Kolkata.
(b) List all single rooms with a charge below Rs. 1000 per night
SELECT * FROM ROOM WHERE type = 'Single' AND price_pn < 1000;
This selects single rooms (type = 'Single') with a price per night below 1000.
(c) List the names of all guests staying at ITC Hotel from 25th December
SELECT [Link]
FROM GUEST G
JOIN BOOKING B ON [Link] = [Link]
JOIN HOTEL H ON [Link] = [Link]
WHERE [Link] = 'ITC Hotel' AND [Link] >= '2025-12-25';
This retrieves guest names who have a booking at ITC Hotel starting on or
after December 25th.
(d) List the price per night and type of all rooms at Grand Hotel
SELECT R.price_pn, [Link]
FROM ROOM R
JOIN HOTEL H ON [Link] = [Link]
WHERE [Link] = 'Grand Hotel';
This query fetches room types and prices for Grand Hotel.
(e) List all guests currently staying at Taj Hotel
SELECT [Link]
FROM GUEST G
JOIN BOOKING B ON [Link] = [Link]
JOIN HOTEL H ON [Link] = [Link]
WHERE [Link] = 'Taj Hotel' AND CURDATE() BETWEEN [Link] AND
[Link];
This retrieves guest names who are staying at Taj Hotel at the current date.
These queries efficiently extract the required information while maintaining
data integrity.

11. SQL Queries for Employee Database

SQL Queries for Employee Database


-- a) Employees earning more than the average salary of their department
SELECT * FROM Employee E WHERE Salary >
(SELECT AVG(Salary) FROM Employee WHERE DeptNo = [Link]);

-- b) Employees with more than one dependent


SELECT EmpID, EmpName FROM Employee
WHERE EmpID IN (SELECT EmpID FROM Dependent GROUP BY EmpID HAVING
COUNT(*) > 1);

-- c) Pairs of employees in the same department


SELECT [Link] AS Employee1, [Link] AS Employee2, [Link]
FROM Employee E1, Employee E2
WHERE [Link] = [Link] AND [Link] < [Link];

-- d) Department-wise average salary


SELECT DeptNo, AVG(Salary) AS AvgSalary FROM Employee GROUP BY DeptNo;

-- e) Department name and dependents born after 2005


SELECT [Link], [Link], [Link], [Link]
FROM Employee E JOIN Department D ON [Link] = [Link]
JOIN Dependent Dep ON [Link] = [Link]
WHERE [Link] > '2005-01-01';

12. Explain Functional Dependency, Partial FD, Fully FD, Transitive


Dependency, Multi-Valued Dependency.
Functional Dependencies & Types
A Functional Dependency (FD) is a constraint between two sets of attributes,
where one attribute uniquely determines another.
Partial FD: When a part of a composite key determines a non-key attribute.
Full FD: When the entire composite key is required to determine a non-key
attribute.
Transitive Dependency: If A → B and B → C, then A → C.
Multivalued Dependency: When an attribute depends on a key but is
independent of others.

Find Candidate Keys, Prime & Non-Prime Attributes for given relation

To determine Candidate Keys, Prime Attributes, and Non-Prime Attributes for


a given relation, follow these steps:
1. Candidate Keys (CK)
A candidate key is a minimal set of attributes that can uniquely identify all
tuples in a relation.
Find Functional Dependencies (FDs) (if given).
Determine Closure of Attributes to check which sets can uniquely determine all
attributes.
Ensure minimality (removing any attribute from the set should make it non-
unique).
2. Prime Attributes (PA)
A prime attribute is an attribute that is part of at least one candidate key.
3. Non-Prime Attributes (NPA)
A non-prime attribute is an attribute that is not part of any candidate key.

Step 1: Identify Given Information


Relation: R(A, B, C, D)
Functional Dependencies (FDs):
A→B
C→D
A, C → D

Step 2: Find the Candidate Keys


A candidate key is a minimal set of attributes that uniquely determine all
attributes in the relation.

Find Attribute Closure for Possible Keys

1⃣ Find Closure of {A}

A → B ⟹ {A} → {A, B} (does not cover C and D)

{A} is not a candidate key.

2⃣ Find Closure of {C}

C → D ⟹ {C} → {C, D} (does not cover A and B)


{C} is not a candidate key.

3⃣ Find Closure of {A, C}

A → B ⟹ {A, C} → {A, B, C}

C → D ⟹ {A, C} → {A, B, C, D} (covers all attributes)

{A, C} is a Candidate Key.

Step 3: Identify Prime and Non-Prime Attributes


Prime Attributes: Attributes that are part of at least one candidate key.

Candidate Key: {A, C}

Prime Attributes = {A, C}

Non-Prime Attributes: Attributes that are not part of any candidate key.

Attributes in R = {A, B, C, D}

Prime Attributes: {A, C}

Non-Prime Attributes = {B, D}

Final Answer
� Candidate Key: {A, C}

� Prime Attributes: {A, C}

� Non-Prime Attributes: {B, D}

You might also like