CSDL - SQL Từ Cơ Bản Đến Nâng Cao

Khóa học SQL từ Cơ bản đến Nâng cao được thiết kế trong 30 buổi (75 giờ), giúp học viên nắm vững SQL từ nền tảng đến ứng dụng thực tế. Khóa học tập trung vào truy vấn dữ liệu, thiết kế cơ sở dữ liệu, tối ưu hiệu năng và xử lý giao dịch, làm việc...
Programming FullhouseDev Premium
Tác giả FullhouseDev
1000+ Học viên
4.8
Mục tiêu của khóa học
  • Nắm vững ngôn ngữ SQL từ cơ bản đến nâng cao
  • Thiết kế database hiệu quả theo chuẩn normalization
  • Viết queries phức tạp với Window Functions, CTEs, Subqueries
  • Tối ưu performance với Indexes và Query Optimization
  • Hiểu rõ Transactions, Concurrency, Locking
  • Làm việc với Stored Procedures, Functions, Triggers
  • Sẵn sàng làm việc với real-world database projects
Đối tượng học viên
  • Sinh viên ngành CNTT, HTTT, Khoa học dữ liệu
  • Lập trình viên Web Backend, Fullstack
  • Người học về Data, Phân tích dữ liệu
Sự khác biệt khoá học
  • 9 Lý Do nên lựa chọn Fullhouse Dev mà không phải trung tâm khác.
  • 1. 100% Giáo viên đạt giải lập trình thi đấu quốc gia hoặc làm việc doanh nghiệp lớn.
  • 2. Lộ trình, Slide bài giảng được biên soạn cẩn thận và chuyên sâu.
  • 3. Giáo viên giảng dạy vô cùng dễ hiểu được kiểm duyệt kỹ trước khi vào lớp.
  • 4. Hệ thống Website chấm tự động với 600-800 bài tập chuyên sâu có lời hướng dẫn giải.
  • 5. Kèm 1:1 bất kỳ khi nào học viên cần.
  • 6. Đo lường đánh giá được số bài tập làm được, số bài đúng, số bài sai, thời gian tham gia học từng bạn.
  • 7. Phương pháp học châu âu Flipped Classroom, Mind Map, Mentor System.
  • 8. cuộc thi định kỳ, quà tặng, nhắc nhở thúc đẩy học tập.
  • 9. Chứng nhận sau khoá học.
Phương pháp giảng dạy
  • Dạy học online trực tiếp với giáo viên
  • Có mentor kèm 1:1
  • Giải đáp mọi kiến thức, bài tập 24/24
  • Có video xem lại sau mỗi buổi học

Nội dung chương trình học

CHƯƠNG 1: SQL CƠ BẢN - SQL BASICS
Buổi 1: Database Basics & Setup

Database là gì: RDBMS, Tables, Rows, Columns

SQL vs NoSQL comparison

RDBMS phổ biến: MySQL, PostgreSQL, SQL Server, Oracle

Cài đặt MySQL/PostgreSQL

Kết nối database: Command line, GUI tools (MySQL Workbench, pgAdmin, DBeaver)

Database basics: CREATE DATABASE, DROP DATABASE, USE

Basic data types: INT, VARCHAR, TEXT, DATE, DATETIME, BOOLEAN

Buổi 2: SELECT Fundamentals

SELECT statement basics: SELECT * FROM table

Selecting specific columns: SELECT col1, col2

Column aliases: AS keyword

DISTINCT: Remove duplicates

ORDER BY: ASC, DESC, Multiple columns

LIMIT/OFFSET: Pagination

WHERE clause basics: =, !=, <, >, <=, >=

Logical operators: AND, OR, NOT

NULL handling: IS NULL, IS NOT NULL

Buổi 3: Filtering Data

WHERE với nhiều điều kiện

IN operator: WHERE column IN (value1, value2)

BETWEEN operator: Range filtering

LIKE operator: Pattern matching với %, _

Wildcard patterns

REGEXP/RLIKE: Regular expressions trong SQL

CASE WHEN: Conditional logic

Filtering best practices

Buổi 4: Aggregate Functions

COUNT(): Đếm rows

SUM(): Tổng giá trị

AVG(): Trung bình

MIN(), MAX(): Giá trị nhỏ nhất, lớn nhất

GROUP BY: Nhóm dữ liệu

HAVING clause: Filtering sau GROUP BY

GROUP BY với nhiều columns

Aggregate functions với DISTINCT

Buổi 5: JOINS - Part 1

Relationship giữa tables: One-to-One, One-to-Many, Many-to-Many

INNER JOIN: Matching rows from both tables

LEFT JOIN (LEFT OUTER JOIN): All from left + matching right

RIGHT JOIN (RIGHT OUTER JOIN): All from right + matching left

FULL OUTER JOIN: All rows from both tables

JOIN với nhiều tables

Self JOIN: Join table với chính nó

Buổi 6: JOINS - Part 2 & Set Operations

CROSS JOIN: Cartesian product

Natural JOIN: JOIN based on same column names

JOIN conditions: ON vs USING

Multiple JOIN conditions

Set Operations

CHƯƠNG 2: SQL TRUNG CẤP - INTERMEDIATE SQL
Buổi 7: Subqueries - Part 1

Subquery là gì

Subquery trong WHERE clause

Subquery với IN, NOT IN

Subquery với comparison operators

Subquery trả về single value

Subquery trả về multiple values

EXISTS và NOT EXISTS

Correlated subqueries

Buổi 8: Subqueries - Part 2

Subquery trong FROM clause (Derived tables)

Subquery trong SELECT clause

Nested subqueries

Subquery performance considerations

Replacing subqueries với JOINs

When to use subqueries vs JOINs

Buổi 9: String Functions

CONCAT(), CONCAT_WS(): Nối chuỗi

SUBSTRING()/SUBSTR(): Cắt chuỗi

LENGTH()/CHAR_LENGTH(): Độ dài chuỗi

UPPER(), LOWER(): Chuyển đổi case

TRIM(), LTRIM(), RTRIM(): Xóa khoảng trắng

REPLACE(): Thay thế chuỗi

LEFT(), RIGHT(): Lấy ký tự từ trái/phải

INSTR(), LOCATE(): Tìm vị trí

String comparison và sorting

Buổi 10: Numeric & Date Functions

Numeric Functions

Date/Time Functions

Buổi 11: Data Manipulation Language (DML)

INSERT INTO: Thêm dữ liệu

UPDATE: Cập nhật dữ liệu

DELETE: Xóa dữ liệu

REPLACE: Insert or Update

INSERT ... ON DUPLICATE KEY UPDATE

Buổi 12: Data Definition Language (DDL)

CREATE TABLE: Tạo bảng

PRIMARY KEY: Khóa chính

FOREIGN KEY: Khóa ngoại, References

UNIQUE constraint: Duy nhất

CHECK constraint: Điều kiện validation

AUTO_INCREMENT: Tự động tăng

ALTER TABLE

DROP TABLE, TRUNCATE TABLE

CREATE TABLE AS SELECT

Temporary tables

CHƯƠNG 3: SQL NÂNG CAO - ADVANCED SQL
Buổi 13: Common Table Expressions (CTEs)

CTE là gì: WITH clause

Simple CTE syntax

Multiple CTEs trong một query

CTE với complex queries

Recursive CTEs

Recursive CTE applications

CTE vs Subqueries vs Temporary Tables

Buổi 14: Window Functions - Part 1

Window Functions là gì

OVER() clause

PARTITION BY: Chia nhóm

ORDER BY trong window functions

ROW_NUMBER(): Đánh số thứ tự

RANK(): Xếp hạng với gaps

DENSE_RANK(): Xếp hạng không gaps

NTILE(n): Chia thành n groups

Ranking functions applications

Buổi 15: Window Functions - Part 2

Aggregate window functions

Running totals (Cumulative sum)

Moving averages

ROWS vs RANGE frame specification

Frame clause applications

Buổi 16: Window Functions - Part 3

Analytic functions

LAG/LEAD applications

Complex window function queries

Combining multiple window functions

Buổi 17: Advanced Query Techniques

PIVOT operations: Rows to Columns

UNPIVOT operations: Columns to Rows

Dynamic SQL: Building queries programmatically

JSON functions

Full-text search

Advanced CASE expressions

Complex conditional logic

Buổi 18: Query Optimization Basics

Execution plans: EXPLAIN, EXPLAIN ANALYZE

Reading execution plans

Query optimization principles

Avoiding common pitfalls

Query refactoring techniques

Using covering indexes

Index hints

CHƯƠNG 4: THIẾT KẾ DATABASE - DATABASE DESIGN
Buổi 19: Database Design Fundamentals

Database design process

Requirements gathering

Conceptual design

Entity-Relationship (ER) Diagrams

ER diagram tools

Converting ER to tables

Primary keys selection strategies

Foreign keys and referential integrity

Buổi 20: Normalization

Normalization là gì: Mục đích, Benefits

Functional dependencies

Normal Forms

Normalization process step-by-step

Denormalization: When and why

Trade-offs: Normalization vs Performance

Buổi 21: Advanced Database Design

Designing for scalability

Partitioning strategies

Surrogate keys vs Natural keys

Composite keys

Database design patterns

Handling many-to-many relationships

Audit tables and history tracking

Soft delete vs Hard delete

Buổi 22: Data Integrity & Constraints

Data integrity types

Constraint enforcement

CASCADE options

CHECK constraints best practices

Triggers for complex integrity rules

Validation at database level vs application level

Database documentation

CHƯƠNG 5: TỐI ƯU & PERFORMANCE - OPTIMIZATION
Buổi 23: Indexes - Part 1

Index là gì: Purpose, How they work

Index types

Creating indexes

Index selection guidelines

Column order trong composite indexes

Buổi 24: Indexes - Part 2

Index benefits và costs

When to use indexes

When NOT to use indexes

Covering indexes

Index maintenance

Analyzing index usage

Identifying missing indexes

Removing unused indexes

Clustered vs Non-clustered indexes

Index fragmentation

Buổi 25: Query Performance Tuning

Performance monitoring tools

Slow query log

Query profiling

Common performance issues

Optimization techniques

Batch operations vs Single operations

LIMIT optimization

COUNT(*) optimization

Buổi 26: Advanced Performance Topics

Database caching

Connection pooling

Prepared statements và parameter binding

Analyzing query patterns

Database statistics và maintenance

VACUUM, ANALYZE (PostgreSQL)

OPTIMIZE TABLE (MySQL)

Table statistics update

Database monitoring và alerting

Performance testing strategies

CHƯƠNG 6: STORED PROCEDURES & FUNCTIONS
Buổi 27: Stored Procedures

Stored Procedures là gì: Benefits, Use cases

Creating stored procedures

Parameters: IN, OUT, INOUT

Variable declaration và assignment

Control flow

Cursors: Iterating through result sets

Error handling: DECLARE HANDLER

Calling stored procedures

Stored procedures best practices

When to use stored procedures vs application logic

Buổi 28: Functions & Triggers

User-Defined Functions (UDFs)

Triggers

Views

CHƯƠNG 7: TRANSACTIONS & CONCURRENCY
Buổi 29: Transactions & ACID

Transaction là gì

ACID properties

Transaction commands

Transaction best practices

Transaction scope management

Nested transactions

Long-running transactions

Buổi 30: Concurrency & Locking

Concurrency issues

Isolation levels

Locking mechanisms

Deadlocks

Optimistic vs Pessimistic locking

Multi-Version Concurrency Control (MVCC)

Concurrency best practices