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

SQL Study Notes Chapter7

Chapter 7 introduces Structured Query Language (SQL), the standard language for managing relational databases. It covers SQL command classifications, including DDL, DML, DCL, TCL, and DQL, along with operations for creating, altering, and retrieving data. The chapter also discusses sorting, filtering, aggregate functions, joins, and transaction control, providing tips for students to practice SQL effectively.
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)
2 views2 pages

SQL Study Notes Chapter7

Chapter 7 introduces Structured Query Language (SQL), the standard language for managing relational databases. It covers SQL command classifications, including DDL, DML, DCL, TCL, and DQL, along with operations for creating, altering, and retrieving data. The chapter also discusses sorting, filtering, aggregate functions, joins, and transaction control, providing tips for students to practice SQL effectively.
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

Chapter 7: Introduction to Structured Query Language (SQL)

1. Introduction to SQL

SQL stands for Structured Query Language. It is the standard language used to create, modify, retrieve, and

manipulate data in relational databases.

2. SQL Commands Classification

DDL (Data Definition Language): CREATE, ALTER, DROP

DML (Data Manipulation Language): INSERT, UPDATE, DELETE

DCL (Data Control Language): GRANT, REVOKE

TCL (Transaction Control Language): COMMIT, ROLLBACK, SAVEPOINT

DQL (Data Query Language): SELECT

3. Creating Database and Tables (DDL)

Commands like CREATE DATABASE and CREATE TABLE define structure. Data types include INT,

VARCHAR, DATE. Constraints: PRIMARY KEY, FOREIGN KEY, NOT NULL, DEFAULT, CHECK.

4. Altering and Dropping Tables

ALTER TABLE adds or removes columns. DROP TABLE deletes a table permanently.

5. Inserting and Updating Data (DML)

INSERT INTO adds new data. UPDATE modifies existing data. DELETE removes rows.

6. Retrieving Data (SELECT Statement)

SELECT retrieves data. WHERE filters data. Operators include AND, OR, NOT, BETWEEN, LIKE, IN, IS

NULL.

7. Sorting and Filtering Results

ORDER BY sorts results. DISTINCT shows unique values.


Chapter 7: Introduction to Structured Query Language (SQL)

8. Aggregate Functions

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

9. Grouping Data

GROUP BY groups rows. HAVING filters grouped results.

10. Joins in SQL

INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN combine rows from multiple tables.

11. Aliases and Recursive Joins

AS keyword renames columns or tables. Recursive joins relate a table to itself.

12. Transaction Control

COMMIT saves changes. ROLLBACK undoes changes. SAVEPOINT creates a restore point.

Tips for UG Students

Practice SQL regularly. Use tools like SQL Fiddle, MySQL Workbench. Start with simple queries and build

up.

You might also like