The Chintels School, Kalyanpur
Topic – DBMS (Notes) CLASS: X
Subject – Information Technology(402)
VII
Name: _____________________________________ Roll No: ___________ Date: 28 / 05 / 2025
What is SQL?
SQL = Structured Query Language
It helps us to create, insert, change, and view data in databases.
vvvvvv555vvv
SQL Categories vvvvvvVVvvV
VVXii111111
SQL commands are divided into 3 main types:
XIXIXIxiIX_
Type Full Form What it does _IX_
DDL Data Definition Language Creates or changes database structure
DML Data Manipulation Language Adds or changes data inside tables
TCL Transaction Control Language Manages changes made by DML commands
DDL (Data Definition Language)
These commands define the structure of the database (like creating or deleting tables).
1. CREATE
CREATE TABLE Students (
ID INT,
Name VARCHAR(50),
Age INT,
Grade VARCHAR(5)
);
Creates a new table called Students.
2. ALTER
ALTER TABLE Students ADD Email VARCHAR(100);
Adds a new column Email to the table.
3. DROP
DROP TABLE Students;
Deletes the whole table and all its data.
DML (Data Manipulation Language)
These commands change the data inside the tables.
1. INSERT
INSERT INTO Students (ID, Name, Age, Grade)
VALUES (1, 'Alice', 15, '10A');
Adds a new student.
2. SELECT
SELECT * FROM Students;
Views all student data.
3. UPDATE
UPDATE Students
SET Grade = '10B'
WHERE ID = 1;
Changes the grade of the student with ID 1.
4. DELETE
DELETE FROM Students
WHERE ID = 1;
Deletes the student with ID 1.
TCL (Transaction Control Language)
These commands control transactions (groups of operations done together).
1. COMMIT
COMMIT;
Saves all changes made.
2. ROLLBACK
ROLLBACK;
Cancels the changes if something went wrong.
3. SAVEPOINT
SAVEPOINT Save1;
Sets a "save point" to go back to if needed.
Summary Table
Command Type Common Commands Use
DDL CREATE, ALTER, DROP Change table structure
DML INSERT, SELECT, UPDATE, DELETE Change table data
TCL COMMIT, ROLLBACK, SAVEPOINT Control transactions