content

Previous Year Paper(Oct 2022)

Total = 60 marks

(8 + 20 + 32)

Section A(2m x 4q = 8)

Q1. Define Database and Database Management system.

A database is a structured collection of data that is stored and accessed in a computer system

A database management system (DBMS) is a software tool that allows users to create, manage, and manipulate databases:

Q2. What is data model? Name three categories of data model.

Data models are conceptual representations of how data is organized and structured.

Q4. List data types allowed in SQL.

Common Datatypes in SQL are:

Types:

Section B(5m x 4q = 20)

Q7. Explain the main characteristics of Database approach.

Q8. What is data independence? Explain briefly about the types of data independence.

Data independence is a property of a database management system by which we can change the database schema at one level of the database system without changing the database schema at the next higher level.

It has two types:

GeeksForGeeks

Q9. What is an ER diagram? Explain different notations used in drawing ER diagram.

The Entity Relationship Diagram explains the relationship among the entities present in the database.

ER Notations

BinaryTerms

Q10. Create an employee table using the following fields.

| Field name | Data type | | ———- | ——— | | EMPNO | NUMBER | | ENAME | CHAR | | DOB | Date | | Dept | String | | Salary | Real |

  1. Create the Table.
  2. Insert 5 tuples.
  3. Find the sum of salaries.
  4. Find department wise count of Employees
  5. Display the tuples in the order of average salaries of Employees.

Ans.

Create the Table:

CREATE TABLE Employee(EMPNO NUMBER Primary Key, ENAME VARCHAR(100), DOB Date, DEPT VARCHAR(100), SALARY Real);

Insert Data:

INSERT INTO Employee VALUES(101, 'Souhrud', TO_DATE('27-06-2005', 'DD-MM-YYYY'),'Electronics', 32000);

INSERT INTO Employee VALUES(102, 'Nanda', TO_DATE('6-11-2004', 'DD-MM-YYYY'), 'Design', 34000);

INSERT INTO Employee VALUES(103, 'Joel', TO_DATE('30-06-2005', 'DD-MM-YYYY'), 'Software', 29500);

INSERT INTO Employee VALUES(104, 'Nikhil', TO_DATE('6-01-2005', 'DD-MM-YYYY'), 'Hardware', 30000);

INSERT INTO Employee VALUES(105, 'Varun', TO_DATE('16-03-2005', 'DD-MM-YYYY'), 'Software', 29000);

Display Once to Verify:

SELECT * FROM Employee;

| EMPNO | ENAME | DOB | DEPT | SALARY | | — | — | — | — | — | | 101 | Souhrud | 27-JUN-05 | Electronics | 32000 | | 102 | Nanda | 06-NOV-04 | Design | 34000 | | 103 | Joel | 30-JUN-05 | Software | 29500 | | 104 | Nikhil | 06-JAN-05 | Hardware | 30000 | | 105 | Varun | 16-MAR-05 | Software | 29000 |

Show Sum Of Salary:

SELECT SUM(SALARY) As TOTAL_SALARY FROM Employee;

|TOTAL_SALARY | | — | |154500 |

Department Count:

SELECT DEPT, COUNT(*) As Employee_Count 
FROM Employee 
GROUP BY DEPT;

| DEPT | EMPLOYEE_COUNT | | — | — | | Electronics | 1 | | Software | 2 | | Design | 1 | | Hardware | 1 |

Order by Average:

SELECT DEPT, AVG(SALARY) As Avg_Salary 
FROM Employee 
GROUP BY DEPT 
ORDER BY Avg_Salary;

| DEPT | AVG_SALARY | | — | — | | Software | 29250 | | Hardware | 30000 | | Electronics | 32000 | | Design | 34000 |

Q11. What is a transaction? Explain ACID properties of a transaction.

A transaction is a single logical unit of work that accesses and possibly modifies the contents of a database.

The acronym ACID stands for Atomicity, Consistency, Isolation, and Durability. ACID Can be broken down to:

ACID Properties

(GeeksForGeeks)

Q12. Write a short note on database backup and database recovery.

Database Backup and Recovery

Database backup and recovery are critical components of database management that ensure data integrity and availability in the event of data loss, corruption, or system failure.

Database Backup: A database backup is a copy of the database that can be used to restore the original after a data loss event. Backups can be full, incremental, or differential:

Backups can be stored on various media, including local disks, external drives, or cloud storage. Regular backups are essential to protect against data loss due to hardware failures, accidental deletions, or disasters.

Database Recovery: Database recovery is the process of restoring a database from a backup to bring it back to a consistent state after a failure. Recovery strategies can vary based on the type of failure:

Recovery procedures must be well-documented and tested to ensure that they can be executed quickly and effectively when needed.

Section C(8m x 4q = 32)

Q13. Explain three schema architecture with a neat diagram.

The three schema architecture is also called ANSI/SPARC architecture or three-level architecture.

3 Schema Arch. In the above diagram:

JavaTPoint

Q14. Discuss the different types of indexes.

Indexing enhances database performance by reducing the number of disk visits needed to execute a query. It is a data structure technique that uses key fields to create indexes, with the main or candidate key appearing as the Search key in the first column, often sorted for faster retrieval. While sorting is not mandatory, it aids in efficiency. The second column, known as the Data Reference or Pointer, contains pointers to the disk block addresses where the corresponding key values are stored.

  1. Primary Indexing Primary indexing is applied to the primary key of a table, ensuring that data can be accessed quickly without scanning the entire table.
  2. Secondary Indexing Secondary indexing provides an additional access path to data stored in a table, allowing for efficient searches based on non-primary key columns.
  3. Clustered Index: A clustered index determines the physical order of data in a table. When a clustered index is created, the rows are sorted and stored according to the values of the indexed column(s).

GeeksforGeeks

Q15. Draw an ER diagram for Bank Database with 5 entities and 5 attributes for each entity. Specify the cardinality ratio on each of the relationships existing between entities.

TODO: Solve

Q16. Explain different relational algebra operations.

Relational algebra is a procedural query language, which takes instances of relations as input and yields instances of relations as output. It uses operators to perform queries.

An operator can be either unary or binary. They accept relations as their input and yield relations as their output.

Types:

Q17. What is Normalization? Differentiate between 3NF and BCNF.

BCNF Normalization is the process of minimizing redundancy from a relation or set of relations.

Levels of Normalization:

Explanation:

(GeeksForGeeks, Explanation) (GeeksForGeeks, Forms)

Q18. Explain different states of a transaction with a neat diagram.

Transaction in DBMS is a set of logically related operations executed as a single unit.

Transaction States

GeeksForGeeks