0% found this document useful (0 votes)
5 views2 pages

SQL Basics Extended

SQL (Structured Query Language) is essential for managing relational databases, allowing users to perform operations like creating, reading, updating, and deleting data. Key components include the SELECT statement for data retrieval, WHERE clause for filtering, INSERT INTO for adding records, and various clauses like ORDER BY and GROUP BY for sorting and grouping data. Additionally, SQL supports aggregate functions and constraints to enforce data integrity.

Uploaded by

sandymaddala45
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)
5 views2 pages

SQL Basics Extended

SQL (Structured Query Language) is essential for managing relational databases, allowing users to perform operations like creating, reading, updating, and deleting data. Key components include the SELECT statement for data retrieval, WHERE clause for filtering, INSERT INTO for adding records, and various clauses like ORDER BY and GROUP BY for sorting and grouping data. Additionally, SQL supports aggregate functions and constraints to enforce data integrity.

Uploaded by

sandymaddala45
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/ 2

SQL Basics - Extended

SQL Basics

SQL (Structured Query Language) is used to manage and manipulate relational databases. It allows

users to create, read, update, and delete data from databases.

1. SELECT Statement:

Used to retrieve data from one or more tables.

Example: SELECT * FROM customers;

2. WHERE Clause:

Filters records based on conditions.

Example: SELECT * FROM customers WHERE age > 30;

3. INSERT INTO Statement:

Adds new records to a table.

Example: INSERT INTO customers (name, age) VALUES ('John', 28);

4. UPDATE Statement:

Modifies existing data.

Example: UPDATE customers SET age = 29 WHERE name = 'John';

5. DELETE Statement:

Removes records.

Example: DELETE FROM customers WHERE name = 'John';

6. ORDER BY Clause:
Sorts the results.

Example: SELECT * FROM customers ORDER BY age DESC;

7. GROUP BY Clause:

Groups rows that have the same values.

Example: SELECT city, COUNT(*) FROM customers GROUP BY city;

8. Aggregates:

Functions like COUNT, SUM, AVG, MAX, MIN.

Example: SELECT AVG(age) FROM customers;

9. Aliases:

Gives temporary names to tables or columns.

Example: SELECT name AS customer_name FROM customers;

10. SQL Constraints:

Rules enforced on data: PRIMARY KEY, FOREIGN KEY, NOT NULL, UNIQUE, CHECK.

You might also like