Hyderabad Institute of Technology and
Management
Structured Query Batch No:13
Language
Farooq Hassian - 21E51A6250
Kaushik -
21E51A6214
CH Likith - 21E51A6208
Prabath Vishnu - 21E51A6213
Gowdavelli Village, Medchal Mandal & District, Telangana | www.hitam.org
© Copyrights 2018 HITAM. All rights reserved. 1
What is SQL?
● SQL (Structured Query Language) is the standard language used to interact with
relational databases.
● Developed in the 1970s by IBM, SQL allows users to:
○ Create and manage databases and tables
○ Insert, update, and delete data
○ Retrieve specific data via queries
● It is used by all major RDBMS like MySQL, PostgreSQL, Oracle, and Microsoft SQL
Server.
© Copyrights 2018 HITAM. All rights reserved. 2
Types of SQL languages
● DDL (Data Definition Language) – Defines structure of database objects:
○ CREATE: Create new tables, databases, etc.
○ ALTER: Modify existing tables
○ DROP: Delete tables or databases
● DML (Data Manipulation Language) – Used to manipulate data:
○ SELECT: Retrieve data
○ INSERT: Add new records
○ UPDATE: Modify existing data
○ DELETE: Remove data
© Copyrights 2018 HITAM. All rights reserved. 3
Types of SQL languages
● DCL (Data Control Language) – Manages permissions:
○ GRANT: Provide access rights
○ REVOKE: Remove access rights
● TCL (Transaction Control Language) – Manages transactions:
○ COMMIT: Save changes permanently
○ ROLLBACK: Undo changes
○ SAVEPOINT: Define points for rollback
© Copyrights 2018 HITAM. All rights reserved. 4
Why Use SQL?
● Advantages of using SQL:
○ Easy to learn and use
○ Powerful querying capabilities
○ Standardized across most RDBMS
○ Supports complex joins and nested queries
○ Ideal for structured data management
○ Crucial for careers in software engineering, data science, and database
administration
© Copyrights 2018 HITAM. All rights reserved. 5
Setting Up MySQL
1. Download & Install:
○ Visit the official MySQL website: https://dev.mysql.com/downloads/
○ Download MySQL Installer (includes Server and Workbench)
2. Installation Steps:
○ Choose Full or Custom setup
○ Set the root password (used for admin access)
○ Select TCP/IP settings (usually default port 3306)
3. Verify Installation:
○ Open MySQL Workbench
○ Connect to local MySQL server using the root account
○ Run test queries like SELECT VERSION();
© Copyrights 2018 HITAM. All rights reserved. 6
CREATE TABLE Statement
Syntax: CREATE TABLE table_name ( column1 datatype, column2 datatype, … );
Example: CREATE TABLE students ( id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100), age INT, course VARCHAR(50) );
● CREATE TABLE defines a new table and its columns.
● AUTO_INCREMENT auto-generates a unique ID.
● PRIMARY KEY uniquely identifies each record.
● Data types like INT, VARCHAR, etc. specify data format.
© Copyrights 2018 HITAM. All rights reserved. 7
CREATE TABLE Statement
© Copyrights 2018 HITAM. All rights reserved. 8
INSERT INTO Statement
Syntax: INSERT INTO table_name (column1, column2, ...) VALUES (value1,
value2, ...);
Example: INSERT INTO students (name, age, course) VALUES ('Alice', 21, 'Computer
Science');
● The INSERT INTO command is used to add new records (rows) into an existing
table.
● Adds new records to a table.
● Column list should match value order.
© Copyrights 2018 HITAM. All rights reserved. 9
INSERT INTO Statement
© Copyrights 2018 HITAM. All rights reserved. 10
DELETE FROM Statement
Syntax: DELETE FROM table_name WHERE condition;
Example: DELETE FROM students WHERE name = 'Alice';
● Deletes the row where the name is 'Alice'.
● WHERE is used to apply conditions.
● Not giving conditions leads to deletion of all records in tht table.
© Copyrights 2018 HITAM. All rights reserved. 11
DELETE FROM Statement
© Copyrights 2018 HITAM. All rights reserved. 12
Thank You !
© Copyrights 2018 HITAM. All rights reserved. 13