Here are possible viva voce questions and their answers for each experiment, based on the
provided document.
Experiment 1: Concept Design with E-R Model
1. Q: What are the main components of an ER Model?
○ A: Entities, Attributes, and Relationships. 1
2. Q: How are entities represented in an ER diagram?
○ A: Entities are represented by rectangles. 2
3. Q: What does a diamond symbol represent in an ER diagram?
○ A: A diamond symbol represents relationships among entities. 3
4. Q: What is the purpose of an ER diagram?
○ A: ER diagrams are used to model the logical view of a system from a data
perspective. 4
5. Q: What is a multi-valued attribute, and how is it represented?
○ A: A multi-valued attribute can have multiple values, and it is represented by a
double ellipse. 5
Experiment 2: Convert ER Diagram into Relational Model
1. Q: How do you convert entities from an ER diagram into a relational model?
○ A: Entities are converted into separate relations (tables). 66666
2. Q: How is a relationship set converted into a relation in the relational model?
○ A: A relationship set is converted into a relation with foreign keys pointing to the
participating entity relations, and it can also have its own attributes. 7777777
3. Q: What is a primary key?
○ A: A primary key is an attribute or set of attributes that uniquely identifies each
record in a table. For example, EmpNo is the primary key for the Employee
relation. 8
4. Q: What is a foreign key?
○ A: A foreign key is a column or a set of columns in a table that refers to the
primary key of another table,9 establishing a link between them.10 For example,
EmpNo and D_id are foreign keys in the WorksIn relation. 11
Experiment 3: Normalization
1. Q: What is 1NF (First Normal Form)?
○ A: A table is in 1NF if all columns contain atomic values and each row has a unique
identifier. 12
2. Q: What is the condition for a relation to be in 2NF (Second Normal Form)?
○ A: A relation is in 2NF if it is in 1NF and all non-prime attributes are fully
functionally dependent on the primary key, meaning there are no partial
dependencies. 13
3. Q: What is the condition for a relation to be in 3NF (Third Normal Form)?
○ A: A relation is in 3NF if it is in 2NF and no transitive dependencies exist, meaning
non-prime attributes do not depend on other non-prime attributes. 14
4. Q: What is BCNF (Boyce-Codd Normal Form)?
○ A: A relation is in BCNF if, for every functional dependency, the left-hand side is a
superkey. 15
5. Q: What is a functional dependency?
○ A: A functional dependency describes a relationship where one attribute or set of
attributes determines another attribute. For example, ProjId determines ProjName.
16
Experiment 4: Practicing DDL Commands
1. Q: What is DDL?
○ A: DDL stands for Data Definition Language, which consists of commands used to
define, modify, or remove database structures. 17
2. Q: Name three DDL commands.
○ A: CREATE, ALTER, and DROP. 18
3. Q: What is the purpose of the TRUNCATE command?
○ A: TRUNCATE removes all records from a table but keeps the table structure
intact. 19
4. Q: How do you add a new column to an existing table?
○ A: You use the ALTER TABLE command, for example: ALTER TABLE Students ADD
Email VARCHAR(100);. 20
Experiment 5: Practicing DML Commands
1. Q: What is the purpose of the INSERT command?
○ A: The INSERT command is used to add new records into a table. 21
2. Q: What is the ROLLBACK command used for?
○ A: ROLLBACK is used to undo changes made in a transaction, restoring the
database to its state before the transaction began. 22222222
3. Q: How do you add a primary key constraint to an existing table column?
○ A: You use the ALTER TABLE command, for example: ALTER TABLE employee ADD
PRIMARY KEY(EID);. 23
4. Q: What is a savepoint?
○ A: A savepoint is a point within a transaction to which you can later roll back,
allowing for partial transaction rollbacks. 24242424
5. Q: What is the COMMIT command used for?
○ A: The COMMIT command is used to make all changes performed in the current
transaction permanent in the database. 25252525
Experiment 6: Querying (using ANY, ALL, UNION, INTERSECT, JOIN,
Constraint set c.)
1. Q: What is the purpose of the JOIN clause in SQL?
○ A: The JOIN clause is used to combine rows from two or more tables based on a
related column between them. 26
2. Q: What is a nested query (subquery)?
○ A: A nested query, or subquery, is a query embedded inside another SQL query. 27
3. Q: How do you find distinct values in a column?
○ A: You use the DISTINCT keyword with the SELECT statement, for example:
SELECT DISTINCT [Link] FROM Reserves r;. 28
4. Q: Explain the difference between IN and NOT IN in SQL queries.
○ A: IN is used to check if a value matches any value in a list or subquery, while NOT
IN checks if a value does not match any value in the list or subquery.
292929292929292929
Experiment 7: Queries using Aggregate Functions, GROUP BY,
HAVING, and Creation and Dropping of Views
1. Q: Name three aggregate functions in SQL.
○ A: MIN(), MAX(), COUNT(), AVG(). 30303030
2. Q: What is the GROUP BY clause used for?
○ A: The GROUP BY clause groups rows that have the same values in specified
columns into summary rows. 31
3. Q: What is the difference between WHERE and HAVING clauses?
○ A: WHERE is used to filter individual rows before grouping, while HAVING is used
to filter groups of rows after aggregation. 32323232
4. Q: What is a VIEW in SQL?
○ A: A VIEW is a virtual table based on the result-set of an SQL query. It does not
store data itself but rather the query that creates it. 33
5. Q: How do you remove a view from the database?
○ A: You use the DROP VIEW command, for example: DROP VIEW HighRatedSailors;.
34
Experiment 8: Triggers (Creation of insert trigger, delete trigger,
update trigger)
1. Q: What is a database trigger?
○ A: A database trigger is a special type of stored procedure that automatically
executes or "fires" when a specific event occurs in the database, such as an
INSERT, UPDATE, or DELETE operation. 35
2. Q: What is the purpose of FOR EACH ROW in a trigger definition?
○ A: FOR EACH ROW specifies that the trigger body will execute once for each row
affected by the triggering statement. 3636
3. Q: What are :NEW and :OLD in triggers?
○ A: :NEW refers to the new values of the columns after an INSERT or UPDATE
operation, while :OLD refers to the old values of the columns before a DELETE or
UPDATE operation. 37373737
4. Q: When would you use a BEFORE trigger versus an AFTER trigger?
○ A: A BEFORE trigger fires before the DML event and is often used for validation or
modifying data before it's written. An AFTER trigger fires after the DML event and
is typically used for auditing or cascading operations. 38383838
Experiment 9: Procedures and Functions
1. Q: What is a stored procedure?
○ A: A stored procedure is a prepared SQL code that you can save and reuse. It can
accept input parameters and return output parameters. 39393939
2. Q: What is a function in SQL/PLSQL?
○ A: A function is a named PL/SQL block that returns a single value. It can be used
in SQL queries. 404040404040
3. Q: What is the difference between a PROCEDURE and a FUNCTION?
○ A: A procedure typically performs an action and can return multiple or no values
(using OUT parameters), while a function is designed to compute and return a
single value and can be used within SQL expressions. 41414141414141414141414141414141
4. Q: What is SQLERRM used for in an exception block?
○ A: SQLERRM is a built-in SQL/PLSQL function that returns the error message
associated with the current SQL error. 42424242
Experiment 10: Usage of Cursors
1. Q: What is a cursor in PL/SQL?
○ A: A cursor is a pointer or a control structure that enables traversal over the
records in a database. It allows PL/SQL programs to process rows returned by a
query one at a time. 43
2. Q: What are the four steps involved in using an explicit cursor?
○ A: Declare the cursor, Open the cursor, Fetch data from the cursor, and Close the
cursor. 44
3. Q: What is SQL%ROWCOUNT and what does it indicate?
○ A: SQL%ROWCOUNT is an implicit cursor attribute that returns the number of
rows affected by the most recent INSERT, UPDATE, or DELETE statement. 45
4. Q: What is an implicit cursor?
○ A: An implicit cursor is automatically created by Oracle for all SQL statements
(DML and single-row SELECT statements) not explicitly associated with a cursor.
46
Experiment 11: HR Package
1. Q: What is a package in PL/SQL?
○ A: A package is a schema object that groups related PL/SQL types, items, and
subprograms (procedures and functions). It consists of a specification and a
body. 4747474747474747
2. Q: What is the purpose of a package specification?
○ A: The package specification declares the public items that are accessible from
outside the package, such as procedures, functions, variables, and types. 48
3. Q: What is the purpose of a package body?
○ A: The package body contains the implementation details of the items declared in
the package specification, as well as any private items that are not exposed
outside the package. 49494949
4. Q: What are the benefits of using packages in PL/SQL?
○ A: Benefits include modularity, information hiding, reusability, and improved
performance (due to less parsing and compilation).