SQL (Structured Query Language) is a
standardized programming language specifically
designed for managing and manipulating
relational databases. It is widely used for
querying, updating, and managing data stored in
relational database management systems
(RDBMS)
Basic SQL Commands
1. Data Definition Language (DDL)
DDL commands are used to define and modify the structure of
database objects such as tables.
2. Data Manipulation Language (DML)
DML commands are used for managing data within database
tables.
DDL
CREATE: Used to create a new table or database
CREATE TABLE Employees (
EmployeeID INT PRIMARY KEY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
BirthDate DATE
);
DDL
ALTER: Used to modify an existing database object, like adding a column to a
table.
ALTER TABLE Employees
ADD Email VARCHAR(100);
DDL
DROP: Used to delete an existing database object.
DROP TABLE Employees;
DML
INSERT: Adds new records to a table.
INSERT INTO Employees (EmployeeID, FirstName,
LastName, BirthDate)
VALUES (1, 'John', 'Doe', '1980-01-01');
DML
SELECT: Retrieves data from one or more tables.
SELECT * FROM Employees;
DML
UPDATE: Modifies existing records
UPDATE Employees
SET Email = 'john.doe@example.com'
WHERE EmployeeID = 1;
DML
DELETE: Removes records from a table.
DELETE FROM Employees
WHERE EmployeeID = 1;

Introduction to SQL for beginners - Beginner Guide

  • 1.
    SQL (Structured QueryLanguage) is a standardized programming language specifically designed for managing and manipulating relational databases. It is widely used for querying, updating, and managing data stored in relational database management systems (RDBMS)
  • 2.
    Basic SQL Commands 1.Data Definition Language (DDL) DDL commands are used to define and modify the structure of database objects such as tables. 2. Data Manipulation Language (DML) DML commands are used for managing data within database tables.
  • 3.
    DDL CREATE: Used tocreate a new table or database CREATE TABLE Employees ( EmployeeID INT PRIMARY KEY, FirstName VARCHAR(50), LastName VARCHAR(50), BirthDate DATE );
  • 4.
    DDL ALTER: Used tomodify an existing database object, like adding a column to a table. ALTER TABLE Employees ADD Email VARCHAR(100);
  • 5.
    DDL DROP: Used todelete an existing database object. DROP TABLE Employees;
  • 6.
    DML INSERT: Adds newrecords to a table. INSERT INTO Employees (EmployeeID, FirstName, LastName, BirthDate) VALUES (1, 'John', 'Doe', '1980-01-01');
  • 7.
    DML SELECT: Retrieves datafrom one or more tables. SELECT * FROM Employees;
  • 8.
    DML UPDATE: Modifies existingrecords UPDATE Employees SET Email = 'john.doe@example.com' WHERE EmployeeID = 1;
  • 9.
    DML DELETE: Removes recordsfrom a table. DELETE FROM Employees WHERE EmployeeID = 1;