0% found this document useful (0 votes)
1 views3 pages

SQL Notes

The document provides an overview of SQL (Structured Query Language) and its categories, including DDL (Data Definition Language), DML (Data Manipulation Language), and TCL (Transaction Control Language). It outlines key commands for each category, such as CREATE, INSERT, and COMMIT, along with their functions in managing database structures and data. A summary table is included to highlight common commands and their uses.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views3 pages

SQL Notes

The document provides an overview of SQL (Structured Query Language) and its categories, including DDL (Data Definition Language), DML (Data Manipulation Language), and TCL (Transaction Control Language). It outlines key commands for each category, such as CREATE, INSERT, and COMMIT, along with their functions in managing database structures and data. A summary table is included to highlight common commands and their uses.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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

You might also like