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

SQL Notes

The document provides an overview of SQL, including its purpose for managing and retrieving data from databases. It covers key concepts such as DDL and DML commands, constraints, filtering techniques, aggregate functions, joins, subqueries, and transactions. Examples of SQL queries demonstrate practical applications of these concepts.

Uploaded by

aditipmpatil2007
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)
4 views2 pages

SQL Notes

The document provides an overview of SQL, including its purpose for managing and retrieving data from databases. It covers key concepts such as DDL and DML commands, constraints, filtering techniques, aggregate functions, joins, subqueries, and transactions. Examples of SQL queries demonstrate practical applications of these concepts.

Uploaded by

aditipmpatil2007
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

UNIT-2 SQL NOTES

1. SQL Introduction:

SQL is used to manage and retrieve data from databases.

2. DDL Commands:

CREATE, ALTER, DROP

3. Constraints:

NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY

4. DML Commands:

INSERT, UPDATE, DELETE, SELECT

5. Filtering:

WHERE, ORDER BY, GROUP BY, HAVING

6. Pattern Matching:

LIKE, IN, BETWEEN

7. Aggregate Functions:

COUNT, SUM, AVG, MAX, MIN

8. Joins:

INNER JOIN, LEFT JOIN, RIGHT JOIN

9. Subqueries:

Query inside query

10. Transactions:

COMMIT, ROLLBACK, SAVEPOINT

Key Examples:

SELECT * FROM Student WHERE name LIKE 'A%';

SELECT * FROM Student WHERE age IN (18,20);

SELECT * FROM Student WHERE marks BETWEEN 50 AND 80;


SELECT dept_id, COUNT(*) FROM Student GROUP BY dept_id;

SELECT [Link], d.dept_name

FROM Student s

INNER JOIN Dept d ON s.dept_id = [Link];

SAVEPOINT sp1;

You might also like