Q#1: Write the two types of Completeness Constraints? (2 Marks)
Answer:
There are two types of completeness constraints:
- Total Completeness Constraint
- Partial Completeness Constraint
Q#2: Define the main functionality of subtype discriminator? (2 Marks)
Answer:
Subtype discriminator is a technique used to identify which subtype an instance of a supertype belongs to.
Q#3: If we have two entities, how can we make a one-to-one relationship? (2 Marks)
Answer:
In a one-to-one relationship, the primary key of one entity is used as a foreign key in the other entity to link the two tables.
Q#4: What is the difference between relation and relationship? (2 Marks)
Answer:
- Relationship: It is a concept of the ER data model that shows association between entities.
- Relation: It is a table structure in the relational data model consisting of rows and columns.
Q#5: If we map a unary relationship into a relation and ERD has one-to-one cardinality, what will be the mapping procedure? (3 Marks)
Answer:
In unary one-to-one mapping, the primary key of the relation is included as a foreign key in the same relation to represent the relationship.
Q#6: Make relation between two tables using a foreign key with example. (3 Marks)
Answer:
Example:
EMP (empId, empName, qual, depId)
DEPT (depId, depName, numEmp)
- Primary Key of EMP: empId
- Primary Key of DEPT: depId
- Foreign Key: depId in EMP refers to depId in DEPT.
Q#7: What do you know about cardinalities of relationship? (2 Marks)
Answer:
Cardinality defines the number of entity instances that can participate in a relationship with another entity.
Q#8: What is Data Type? (2 Marks)
Answer:
A data type defines the type of values that can be stored in a column or variable, such as integer, character, float, etc.
Q#9: How to implement one-to-one relationship while designing tables? (3 Marks)
Answer:
In a one-to-one relationship, the primary key of one table is placed as a foreign key in the other table.
Q#10: Name three anomalies eliminated through normalization. (3 Marks)
Answer:
- Insertion Anomaly
- Deletion Anomaly
- Update Anomaly
Q#11: Describe Procedural DML and Non-Procedural DML. (5 Marks)
Answer:
Procedural DML:
In procedural DML, the user specifies what data is needed and how to retrieve it step by step.
Non-Procedural DML:
In non-procedural DML, the user specifies only what data is required, and the system decides how to retrieve it.
Q#12: When is a functional dependency said to be minimal? (5 Marks)
Answer:
A functional dependency is minimal if:
- The right side has only one attribute.
- No attribute can be removed from the left side without changing the dependency.
- There are no redundant dependencies.
Q#13: What is Partial Dependency? (2 Marks)
Answer:
Partial dependency occurs when a non-key attribute depends on only part of a composite primary key.
Q#14: Define Domain of an Attribute. (2 Marks)
Answer:
Domain is the set of all possible values that an attribute can have.
Q#15: Define Relationship Type. (3 Marks)
Answer:
A relationship type is a set of relationships among entities that share the same attributes.
Q#16: What is the Difference Operation in Relational Algebra? (3 Marks)
Answer:
The difference operation returns tuples that exist in relation R but not in relation S, and it is represented by R − S.
Q#17: Explain Foreign Key with Example. (5 Marks)
Answer:
A foreign key is an attribute in one table that references the primary key of another table to create a relationship.
Example:
Faculty (Fac_Id, department, rank, name)
Class (Class_No, Fac_Id, Schedule, room)
Here Fac_Id in Class is a foreign key referencing Fac_Id in Faculty.
Q#18: What is First Normal Form (1NF)? (3 Marks)
Answer:
A relation is in First Normal Form if each attribute contains only single (atomic) values and there are no repeating groups.
Q#19: Write five properties of relational tables. (5 Marks)
Answer:
- Each cell contains a single value.
- Each column has a unique name.
- Values in a column come from the same domain.
- The order of columns is not important.
- Each row is unique.
Q#20: What is Data Definition Language (DDL)? (2 Marks)
Answer:
DDL is the part of SQL used to create, modify, and delete database objects such as tables and indexes.
Q#21: What is Referential Integrity? (3 Marks)
Answer:
Referential integrity ensures that a foreign key value must match a primary key value in another table or be NULL.
Q#22: What is Intersection Operation in Relational Algebra? (3 Marks)
Answer:
Intersection returns tuples that are common in both relations R and S.
It is represented as R ∩ S.
Q#23: Name four basic operations in relational algebra. (5 Marks)
Answer:
- SELECT
- PROJECT
- UNION
- SET DIFFERENCE
- CARTESIAN PRODUCT
Q#24: What is Insertion Anomaly? (2 Marks)
Answer:
Insertion anomaly occurs when data cannot be inserted into a table without adding unrelated data.
Q#25: What is the significance of normalization? (3 Marks)
Answer:
Normalization organizes data in a database to:
- Remove redundancy
- Improve data integrity
- Ensure logical data dependencies