POD Question Bank Answer
POD Question Bank Answer
Chapter 3:
1. Draw the enhanced E-R diagram for College Management System and show
strong entity set, weak entity set, super class and sub class. (4M)
Ans:
For example: Square, Circle, Triangle are the sub class of Shape super class.
3. Explain Generalization with Example (4M)
Ans: Generalization uses bottom-up approach where two or more lower level
entities combine together to form a higher level new entity if they have
common attributes in common. The new generalized entity can further
combine together with lower level entity to create a further higher level
generalized entity.
Candidate key: A minimal super key is called a candidate key. An entity set
may have more than one candidate key. A candidate key is a column, or set
of columns, in a table that can uniquely identify any database record without
referring to any other data. Each table may have one or more candidate keys,
but one candidate key is special, and it is called the primary key.
Chapter 4:
Example:
CREATE TABLE Employee(
Name VARCHAR(100),
Email VARCHAR(100),
Age NUMBER(3)
);
8. Explain referential constraint with syntax and example. (4M)
Ans: Referential Integrity
Referential integrity ensures the relationship between the Tables. We can
apply this using a Foreign Key constraint.
Foreign Key:
A Foreign Key is a key used to link two tables together. A Foreign
Key is a field (or collection of fields) in one table that refers to the
Primary Key in another table.
If a table contains a primary key then it can be called Parent Table.
If a table contains a foreign key reference then it can be called a Child
Table.
Example:
Check Constrain
CHECK constraint is used to restrict the value of a column between a
range. It performs check on the values, before storing them into the
database. It’s like condition checking before saving data into a column.
Example:
Default:
This constraint is used to provide a default value for the fields. That is, if
at the time of entering new records in the table if the user does not
specify any value for these fields then the default value will be assigned
to them.
Example:
Primary Key:
• Primary key adds features of unique and not null constraints.
• By using primary key we can avoid duplicate and null values for the
column.
• It can be applied on any data types like int, char, etc.
• A table can contain one primary key only.
Example:
Unique Key
• This constraint helps to uniquely identify each row in the table. i.e. for a
particular column, all the rows should have unique values
• Unique constraints are used to avoid duplicate data in a column
• It also applies to any data types.
• A table can contain any number of unique constraints.
Example:
Not Null Key
• It avoids null values from column (accepts duplicate values).
• i.e. if we specify a field in a table to be NOT NULL, then the field will
never accept null value. That is, you will be not allowed to insert a new row
in the table without specifying any value to this field.
• It can apply on any data type.
• A Table can contain any number of not null constraints.
Example:
4. Truncate: It is used to delete all the rows from the table and free the
space containing the table.
5. Rename: It is used to rename the old table name to new table name.
OR
In SQL, the DROP command is used to remove the whole
database or table indexes, data, and more. Whereas the
TRUNCATE command is used to remove all the rows from
the table.
Chapter 5:
Drawbacks of Denormalization:
1. Denormalization speed up retrieval, but it slow down the updates
2. It is application specific.
3. It can increase size of relation .
4. Sometimes the implementation can become complex
20. Describe the second normal form with its example. (4M)
Ans: 2NF:
In the 2NF, relational must be in 1NF.
In the second normal form, all non-key attributes are fully
Functional dependent on the primary key.
Example:
21. Consider following relation student (Roll_No, name, class, total_marks,
percentage, Grade). Find appropriate dependencies and normalize upto 3 NF.
Ans:
Functional Dependencies:
1NF: Student(Roll_no,name.class,total_marks,percentage,Grade).
2NF: To convert It into 2NF, We have to decompose the given table into
two tables with fully functional dependencies and establishing a
referential integrity constraint relationship among the two tables.
Student(Roll_No, name, class )
Marks(Roll_No, total_marks, Percentage, Grade)
3NF: To convert the above tables in 3NF ,We have to decompose them in
three tables satisfying the transitive dependencies property .
Student(Roll_No, name, class )
Marks(Roll_No, total_marks, percentage)
Grade (percentage, Grade)
Example:
Employee Table
23. Describe first normal form with example
Ans: First Normal Form (1NF):
A relation is said to be 1NF if and only if every entry of the relation has at
most a single (atomic) value.
OR
A relation R is said to be in first normal form (1NF) if the domain of all
attributes of R are atomic.
It does not allow multivalued attributes and composite attributes.
Example
Supplier (sno, sname, location, pno, qty)
The above relation is in 1NF as all the domains are having atomic value. But
it is not in 2NF.