0% found this document useful (0 votes)
20 views9 pages

Basics of SQL

SQL, or Structured Query Language, is the standard language for managing and communicating with relational databases. Key SQL commands include SELECT, INSERT, UPDATE, DELETE, CREATE, and DROP, each serving specific functions for data manipulation. Additional clauses like WHERE, ORDER BY, GROUP BY, HAVING, and LIMIT enhance data retrieval and organization.

Uploaded by

vaishnavi m
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)
20 views9 pages

Basics of SQL

SQL, or Structured Query Language, is the standard language for managing and communicating with relational databases. Key SQL commands include SELECT, INSERT, UPDATE, DELETE, CREATE, and DROP, each serving specific functions for data manipulation. Additional clauses like WHERE, ORDER BY, GROUP BY, HAVING, and LIMIT enhance data retrieval and organization.

Uploaded by

vaishnavi m
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

Basics of SQL

An Introduction to Structured Query


Language
What is SQL?
• SQL stands for Structured Query Language.
• It is used to communicate with databases.
• SQL is the standard language for Relational
Database Management Systems (RDBMS).
• It is used for storing, manipulating, and
retrieving data in databases.
Common SQL Commands
• SELECT – retrieve data from a database
• INSERT – insert new data into a table
• UPDATE – modify existing data
• DELETE – remove data
• CREATE – create new tables or databases
• DROP – delete tables or databases
SELECT Statement
• Used to retrieve data from a table:
• Syntax:
• SELECT column1, column2 FROM table_name;
• Example:
• SELECT name, age FROM employees;
WHERE Clause
• Used to filter records:
• Syntax:
• SELECT * FROM table_name WHERE
condition;
• Example:
• SELECT * FROM employees WHERE age > 30;
INSERT INTO Statement
• Used to add new rows to a table:
• Syntax:
• INSERT INTO table_name (column1, column2)
VALUES (value1, value2);
• Example:
• INSERT INTO employees (name, age) VALUES
('Alice', 28);
UPDATE Statement
• Used to modify existing records:
• Syntax:
• UPDATE table_name SET column1 = value1
WHERE condition;
• Example:
• UPDATE employees SET age = 29 WHERE name
= 'Alice';
DELETE Statement
• Used to remove existing records:
• Syntax:
• DELETE FROM table_name WHERE condition;
• Example:
• DELETE FROM employees WHERE name =
'Alice';
SQL Clauses
• WHERE – filters records
• ORDER BY – sorts results
• GROUP BY – groups rows sharing properties
• HAVING – filters groups
• LIMIT – restricts the number of rows returned

You might also like