Professional Documents
Culture Documents
Aim :
Databases serve as structured repositories for organising and storing data, enabling efficient
retrieval, manipulation, and management of information. They play a pivotal role in various
applications ranging from simple data storage to complex business operations and decision-
making processes. Understanding databases is essential for individuals involved in software
development, data analysis, and information technology sectors.
• Data modelling: A DBMS provides tools for creating and modifying data models, which
define the structure and relationships of the data in a database.
• Data storage and retrieval: A DBMS is responsible for storing and retrieving data from
the database, and can provide various methods for searching and querying the data.
• Data integrity and security: A DBMS provides tools for enforcing data integrity and
security constraints, such as constraints on the values of data and access controls that
restrict who can access the data.
• Backup and recovery: A DBMS provides mechanisms for backing up and recovering
the data in the event of a system failure.
• DBMS can be classified into two types: Relational Database Management System
(RDBMS) and Non-Relational Database Management System (NoSQL or Non-SQL)
• RDBMS: Data is organised in the form of tables and each table has a set of rows and
columns. The data are related to each other through primary and foreign keys.
• NoSQL: Data is organised in the form of key-value pairs, documents, graphs, or column-
based. These are designed to handle large-scale, high-performance scenarios.
A database is a collection of interrelated data which helps in the efficient retrieval, insertion,
and deletion of data from the database and organises the data in the form of tables, views,
schemas, reports, etc. For Example, a university database organises the data about students,
faculty, admin staff, etc. which helps in the efficient retrieval, insertion, and deletion of data
from it.
• Relational DBMS (RDBMS): An RDBMS stores data in tables with rows and columns,
and uses SQL (Structured Query Language) to manipulate the data.
• NoSQL DBMS: A NoSQL DBMS stores data in non-relational data structures, such as
key-value pairs, document-based models, or graph models.
Discussion :
The introduction to databases provides a foundational understanding of their role in
managing information effectively. It sets the stage for further exploration into database
management systems and related concepts. In conclusion, a Database Management System
(DBMS) employs the 3-Tier Architecture, a tried-and-true structure that separates an
application into three main layers: Presentation, Application Logic, and Data. This
architectural technique is increasingly popular for creating dependable and maintainable
software systems that communicate with databases because it improves the modularity,
scalability, security, reusability, and flexibility of applications.
Aim :
1. Oracle Database: Oracle Database is a widely used RDBMS known for its scalability,
security, and comprehensive feature set. It offers robust support for data management,
high availability, and advanced analytics capabilities.
2. MySQL: MySQL is a popular open-source RDBMS that is known for its simplicity,
speed, and ease of use. It is widely used in web applications and is known for its
scalability, reliability, and compatibility with various platforms.
5. IBM Db2: IBM Db2 is an enterprise-level RDBMS designed for high-performance and
scalability. It offers advanced data management capabilities, support for large-scale
deployments, and integration with other IBM products and technologies.
These are just a few examples of the types of RDBMS available. Each RDBMS has its own
strengths, features, and use cases, so the choice of the RDBMS depends on factors such as
specific requirements, scalability needs, budget, and preferences of the organisation or
application developer.
Discussion :
Understanding the different types of relational database systems helps in selecting the most
suitable option based on specific project requirements, performance considerations, and
compatibility needs.
Aim :
Creation of a Databases and writing SQL queries to retrieve information from the database.
Code :
// Creation of database
// Creation of a Table
mysql> CREATE TABLE EMPLOYEE
-> (Fname VARCHAR(15) NOT NULL,
-> Minit CHAR,
-> Lname VARCHAR(15) NOT NULL,
-> Ssn CHAR(9) NOT NULL,
-> Bdate DATE,
-> Address VARCHAR(30),
-> Sex CHAR,
-> Salary DECIMAL(10,2),
-> Super_ssn CHAR(9),
-> Dno INT NOT NULL,
-> PRIMARY KEY (Ssn),
-> FOREIGN KEY (Super_ssn) REFERENCES EMPLOYEE(Ssn),
-> FOREIGN KEY (Dno) REFERENCES DEPARTMENT(Dnumber));
//Description of the table
mysql> DESCRIBE EMPLOYEE;
+-----------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------------+------+-----+---------+-------+
| Fname | varchar(15) | NO | | NULL | |
| Minit | char(1) | YES | | NULL | |
| Lname | varchar(15) | NO | | NULL | |
| Ssn | char(9) | NO | PRI | NULL | |
| Bdate | date | YES | | NULL | |
| Address | varchar(30) | YES | | NULL | |
| Sex | char(1) | YES | | NULL | |
| Salary | decimal(10,2) | YES | | NULL | |
| Super_ssn | char(9) | YES | | NULL | |
| Dno | int | NO | | NULL | |
+—————+---------------+------+-----+---------+-------+
Output :
Finally displaying the table ‘EMPLOYEE’ created with in ‘Office’ database:
Discussion :
This experiment demonstrates the basic operations of creating a database, defining tables,
inserting data, showing tables in a database, and using the desired database and querying
data using SQL.
Aim :
Code :
// Creation of a Table
mysql> CREATE TABLE STUDENT
-> (Fname VARCHAR(15) NOT NULL,
-> Lname VARCHAR(15) NOT NULL,
-> Rollno INT NOT NULL,
-> Branch VARCHAR(5) NOT NULL,
-> Sex CHAR,
-> PRIMARY KEY (Rollno));
Before alteration:
After alteration :
Discussion :
DDL commands are essential for managing the structure of databases. This experiment
demonstrates how to create, alter, drop, and truncate tables using DDL commands.
Aim :
Code :
Before updation:
After updation :
After deletion :
Discussion :
DML commands are crucial for manipulating data in a database. This experiment
demonstrates how to insert, select, update, and delete data using DML commands.