Professional Documents
Culture Documents
Theory:
A database management system (DBMS) refers to the technology for creating and
managing databases. DBMS is a software tool to organize (create, retrieve,
update, and manage) data in a database.
The main aim of a DBMS is to supply a way to store up and retrieve database
information that is both convenient and efficient. By data, we mean known facts
that can be recorded and that have embedded meaning. Usually, people use
software such as DBASE IV or V, Microsoft ACCESS, or EXCEL to store data in
the form of a database. A datum is a unit of data. Meaningful data combined to
form information. Hence, information is interpreted data - data provided with
semantics. MS. ACCESS is one of the most common examples of database
management software.
Knowledge refers to the useful use of information. As you know, that information
can be transported, stored, and shared without any problems and difficulties, but
the same cannot be said about knowledge. Knowledge necessarily involves
personal experience and practice.
Advantages of DBMS
Components of DBMS
DDL is the short name for Data Definition Language, which deals with
database schemas and descriptions, of how the data should reside in the
database.
• CREATE: to create a database and its objects like (table, index, views, store
procedure, function, and triggers)
• ALTER: alters the structure of the existing database
• DROP: delete objects from the database
• TRUNCATE: remove all records from a table, including all spaces allocated
for the records are removed
• COMMENT: add comments to the data dictionary
• RENAME: rename an object
DML is the short name for Data Manipulation Language which deals with data
manipulation and includes most common SQL statements such SELECT,
INSERT, UPDATE, DELETE, etc., and it is used to store, modify, retrieve,
delete and update data in a database.
• SELECT: retrieve data from a database
• INSERT: insert data into a table
• UPDATE: updates existing data within a table
• DELETE: Delete all records from a database table
• MERGE: UPSERT operation (insert or update)
• CALL: call a PL/SQL or Java subprogram
• EXPLAIN PLAN: interpretation of the data access path
• LOCK TABLE: concurrency Control
DCL is short for Data Control Language which acts as an access specifier to the
database.(basically to grant and revoke permissions to users in the database
• GRANT: grant permissions to the user for running DML(SELECT, INSERT,
DELETE,…) commands on the table
• REVOKE: revoke permissions to the user for running DML(SELECT,
INSERT, DELETE,…) command on the specified table
TCL is short for Transactional Control Language which acts as an manager for
all types of transactional data and all transactions.Some of the command of TCL
are
• Role Back: Used to cancel or Undo changes made in the database
• Commit: It is used to apply or save changes in the database
• Save Point: It is used to save the data on the temporary basis in the database
CREATE
Used to create a Table in the database.
INSERT
UPDATE
It is used to update the existing data from the database.
ALTER Table
It is used to for altering the table structure, such as, to add a column to existing
table, to rename any existing column, to change datatype of anycolumn or to
modify its size and to drop a column from the table.
Learnings/ Conclusion:
THEORY:
1. Oracle database
Pros: Oracle database is revered for its robustness, high performance, and
advanced features like Real Application Clusters (RAC) for fault tolerance
and scalability.
With a comprehensive suite of tools and widespread industry adoption, it’s
a favorite for mission-critical applications in large enterprises.
Additionally, Oracle offers deep integration capabilities with cloud
platforms, facilitating hybrid and cloud-native architectures. Its security
features, like advanced encryption and data masking, further ensure that
sensitive information remains protected, making it a top choice for sectors
requiring stringent data protection.
Cons: While it’s powerful, it might not offer the same performance levels
for specific tasks as some commercial databases. Some users also find its
learning curve slightly steeper.
Additionally, transitioning from other systems to Oracle can be resource-
intensive, and the company’s support structure may sometimes be viewed as
bureaucratic, leading to slower resolution of minor issues.
2. MySQL
Pros: SQL server offers excellent integration with other Microsoft products,
making it a natural choice for businesses invested in the Microsoft
ecosystem. It’s known for its ease of use, strong security features, and
comprehensive toolset.
Additionally, its cloud integration with Azure makes scalability and data
recovery more seamless. Its business intelligence capabilities, integrating
tools like Power BI and SSRS, ensure dynamic reporting and analytics for
businesses.
Cons: Licensing costs can be on the higher side. It’s historically bound to
the Windows platform, though recent versions offer Linux support.
Furthermore, there’s a potential learning curve for those unfamiliar with the
Microsoft ecosystem. The system might also require periodic tuning and
optimisation to handle very large datasets efficiently.
4. PostgreSQL
5. SQLite
Pros: SQLite’s server less and lightweight nature makes it perfect for mobile
applications and embedded systems. Its simplicity and the fact that it’s self-
contained (with no separate server process) can be advantageous for specific
use cases.
Moreover, its zero-configuration setup means that it’s essentially plug-and-
play, eliminating complex initialisation procedures.
Also, given its wide adoption, there’s a rich trove of documentation and
community support available, making problem-solving more
straightforward for developers.
6. MariaDB
Pros: MariaDB, a fork from MySQL, offers features like the Aria storage
engine and better query optimisation. Being open-source, it enjoys
community-driven enhancements and is perceived as more “open” than
MySQL post the oracle acquisition.
Furthermore, its continuous development promises regular updates and
improvements. The transparent and collaborative nature of its development
ensures that user needs and concerns are addressed promptly.
Once the database has been created, you can write SQL queries to retrieve
information from it. Some common SQL queries include:
1. SELECT - used to retrieve data from one or more tables. Example: SELECT
* FROM customers;
3. JOIN - used to combine data from two or more tables based on a related
column between them. Example: SELECT * FROM customers JOIN orders
ON customers.customer_id = orders.customer_id;
5. HAVING - used to filter data after grouping it. Example: SELECT country,
SUM(amount) FROM orders GROUP BY country HAVING SUM(amount)
> 1000;
Code and Result:-
1. Create a Table:-
Learnings/ Conclusion:
1. Create
2. Alter
3. Drop
4. Truncate
Theory:
DDL Statements
DDL or Data Definition Language actually consists of the SQL commands that
can be used to define the database schema. It simply deals with descriptions of
the database schema and is used to create and modify the structure of database
objects in the database.
CREATE
Used to create a Table in the database.
ALTER Table
It is used to for altering the table structure, such as, to add a column to
existing table, to rename any existing column, to change datatype of any
column or to modify its size and to drop a column from the table.
TRUNCATE
In SQL, the TRUNCATE command is used to remove all the rows from the
table. However, the structure of the table and columns remains the same. It is
faster than the DROP command.
Before truncate
After Truncate
DROP Table
In SQL, the DROP command is used to remove the whole database or table
indexes, data, and more. The important part of this command is that it has the
ability to permanently remove the table and its contents.
Learning/ Conclusion
In this experiment, we learnt about Data Definition Language (DDL)
commands.We implemented the commands- created tables, added columns,
inserted data, updated data, deleted rows, dropped tables etc.
Experiment No-5
INSERT
It is used to insert data into the table.
SELECT
It is used to retrieve data from the database.
Select all data from a table
Select particular data from a table
UPDATE
It is used to update the existing data from the database.
DELETE
It is used to delete any existing record from the table.
Learning/ Conclusion
In this experiment, we learnt about DataManipulation Language (DML)
commands. We implemented the commands- created tables, added columns,
inserted data, updated data, deleted rows, dropped tables etc.