0% found this document useful (0 votes)
5 views12 pages

DBMS Lab

A database is an organized electronic collection of data that allows for efficient storage, retrieval, and manipulation. Key characteristics include structured data, persistent storage, efficient access, scalability, and security. SQL is the language used for managing relational databases, encompassing various operations such as data querying, manipulation, and definition.

Uploaded by

GARIMA SINGH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views12 pages

DBMS Lab

A database is an organized electronic collection of data that allows for efficient storage, retrieval, and manipulation. Key characteristics include structured data, persistent storage, efficient access, scalability, and security. SQL is the language used for managing relational databases, encompassing various operations such as data querying, manipulation, and definition.

Uploaded by

GARIMA SINGH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

What is Database

 A database is an organized collection of data that is stored, managed, and accessed


electronically. It allows users to efficiently store, retrieve, and manipulate data for various
purposes.
Key Characteristics of a Database
1. Structured Data: Data is organized into tables, rows, and columns, which makes it easier to retrieve and manage.

2. Persistent Storage: Data remains available and is stored persistently even after the application using it is closed.

3. Efficient Access: Databases are optimized to retrieve and modify data quickly.

4. Scalability: Databases can handle large amounts of data as they grow.

5. Security: Databases provide mechanisms for controlling access to data, ensuring privacy and security.
What is Database

Why Use a Database?


• To store and organize large amounts of data systematically.
• To ensure data consistency and accuracy.
• To facilitate quick retrieval and updates.
• To allow multiple users to access data simultaneously.
• To secure sensitive information.
SQL Category
1. Data Query Language (DQL) - used to query data
2. Data Manipulation Language (DML) – used to create/modify/destroy data
3. Data Definition Language (DDL) – used to define database schema
4. Data Control Language (DCL) – used for security and access control
Most Important SQL Statements
• SELECT - extracts data from a database (DQL)
• UPDATE - updates data in a database (DML)
• DELETE - deletes data from a database (DML)
• INSERT - inserts new data into a database (DML)
• CREATE DATABASE - creates a new database (DDL)
• CREATE TABLE - creates a new table (DDL)
• DROP TABLE - deletes a table (DDL)

02/03/2025 SCC Research Data Metrics 4


Some Keywords Used in SQL
• SELECT • NOT • != • INTO
•* • WHERE • INSERT • VALUES
• FROM • LIMIT • UPDATE • DROP
• ORDER BY • DISTINCT • DELETE
• ASC • AS • CREATE
• DESC • GROUP BY • TABLE
• AND • INNER JOIN • LIKE
• OR • ON • %
• What is SQL?
• Structured Query Language for managing relational databases.
• Used for creating, updating, retrieving, and deleting data.
• Key Features
• Data definition (DDL): Create, Alter, Drop.
• Data manipulation (DML): Insert, Update, Delete.
• Data querying (DQL): Select statements.
• Constraints and filters.
Understanding Tables
• What is a Table?
• A collection of rows and columns to store structured data.
• Components of a Table
• Columns: Define the schema (e.g., Rno, Name, DOB).
• Rows: Contain the actual data records.
Most Important SQL Statements
• SELECT - extracts data from a database (DQL)
• UPDATE - updates data in a database (DML)
• DELETE - deletes data from a database (DML)
• INSERT - inserts new data into a database (DML)
• CREATE DATABASE - creates a new database (DDL)
• CREATE TABLE - creates a new table (DDL)
• DROP TABLE - deletes a table (DDL)

02/03/2025 SCC Research Data Metrics 8


DDL Operations
• CREATE TABLE
• Used to define a new table.
• Syntax:

CREATE TABLE Student (Rno NUMBER, Name VARCHAR2(50), DOB DATE, Gender CHAR(1),
Class VARCHAR2(20), College VARCHAR2(50), City VARCHAR2(50), Marks NUMBER);

• DESCRIBE TABLE
• Displays the structure of a table (columns and data types).
• Syntax:
DESCRIBE Table_Name;
DML Operations
• INSERT INTO ……
• Adds new rows to the table.
• Syntax:

INSERT INTO TableName (Column1, Column2, ...) VALUES (Value1, Value2, ...);
INSERT INTO Student (Rno, Name, DOB, Gender, Class, College, City, Marks) VALUES (1, 'Aman', TO_DATE('2001-05-12', 'YYYY-MM-
DD'), 'M', '12th', 'ABC College', 'Patiala', 85);

• UPDATE
• Modifies existing records.
• Syntax:
UPDATE TableName SET Column = Value WHERE Condition;
UPDATE Student SET Marks = 89 WHERE Rno = 5;
• DELETE
• Removes rows from the table.
• Syntax:
• DELETE FROM TableName WHERE Condition;
Querying Data
• SELECT Statement
• Retrieves data from the table.
• Syntax:
• SELECT Column1, Column2, ... FROM TableName WHERE Condition;
• ORDER BY Clause
• Sorts the result set.
• Example:
• SELECT * FROM TableName ORDER BY ColumnName ASC;
• Filtering with WHERE
• Filters data based on conditions.
Common Functions and Concepts
• TO_DATE()
• Converts a string to a date format in Oracle.
• Example:
TO_DATE('2025-01-01', 'YYYY-MM-DD');
• Filters
• Use logical operators: AND, OR, NOT.
• Use comparison operators: =, <, >, <=, >=, !=.
• Sorting
• ASC (Ascending), DESC (Descending).

You might also like