Day 1: Introduction to SQL and Databases
- Understanding Databases
- What is a database?
- Types of databases: Relational vs. Non-relational
- Introduction to SQL and its role in databases
- Setting Up the Environment
- Installing a database system (e.g., MySQL, PostgreSQL)
- Setting up a sample database
- Basic SQL syntax and structure
- Basic SQL Commands
SELECT
and FROM
clauses
- Sorting data with
ORDER BY
- Filtering data with
WHERE
clause
Day 2: Advanced Data Selection and Functions
- Advanced Selection Queries
- Using
DISTINCT
to remove duplicates
- Working with columns using
AS
for aliases
- Logical operators (
AND
, OR
, NOT
)
- Functions in SQL
- String functions:
CONCAT
, UPPER
, LOWER
- Numeric functions:
ROUND
, AVG
, SUM
, MAX
, MIN
- Date functions:
CURDATE
, DATE_FORMAT
, DATEDIFF
- Joining Tables
- Understanding different types of joins:
INNER JOIN
, LEFT JOIN
, RIGHT JOIN
- Using joins to combine rows from two or more tables
Day 3: Complex Queries and Data Manipulation
- Subqueries and Nested Queries
- Using subqueries in
SELECT
, FROM
, and WHERE
clauses
- The importance of grouping data with
GROUP BY
- Filtering grouped data using
HAVING
- Set Operations
- Using set operators:
UNION
, INTERSECT
, EXCEPT
- Understanding the rules of set operations
- Transactions and Data Integrity
- Understanding transactions in SQL (
BEGIN
, COMMIT
, ROLLBACK
)
- Ensuring data integrity through transactions
Day 4: Database Administration and Performance Tuning
- Creating and Managing Tables
- Creating tables using
CREATE TABLE
- Modifying tables with
ALTER TABLE
- Dropping tables with
DROP TABLE
- Indexes and Performance Tuning
- Creating indexes with
CREATE INDEX
for faster queries
- Understanding how indexes affect performance
- Best practices for writing efficient SQL queries
- Database Security
- Basic concepts of database security
- Managing user permissions with
GRANT
and REVOKE
Day 5: Advanced SQL Features and Mini Project
- Advanced SQL Features
- Working with views (
CREATE VIEW
, DROP VIEW
)
- Using triggers and stored procedures for automation