Skip to content

๐Ÿ’ก I Just Started My MySQL Learning Journey! Iโ€™ve recently started learning MySQL, a powerful relational database management system. I'm exploring how to create and manage databases, write SQL queries, and understand how data is stored, retrieved, and organized. So far, I've learned about SQL commands like CREATE, SELECT, INSERT, UPDATE,and DELETE.

Notifications You must be signed in to change notification settings

Reena-senthilkumar/MYSQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

46 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“˜ SQL Basics โ€” Everything You Should Know

1๏ธโƒฃ Database Basics

  • ๐Ÿ“‚ What is a database?
  • ๐Ÿงฑ SQL introduction
  • ๐Ÿ— Types of database objects: Tables, Views, Indexes, Sequences, Triggers

2๏ธโƒฃ SQL Categories

  • ๐Ÿงฑ DDL โ€“ CREATE, ALTER, DROP, TRUNCATE
  • โœ๏ธ DML โ€“ INSERT, UPDATE, DELETE
  • ๐Ÿ” DQL โ€“ SELECT
  • ๐Ÿ”’ TCL โ€“ COMMIT, ROLLBACK, SAVEPOINT
  • ๐Ÿ” DCL โ€“ GRANT, REVOKE

3๏ธโƒฃ Basic Queries

  • Filtering: WHERE, BETWEEN, IN, LIKE, IS NULL
  • Sorting: ORDER BY
  • Limiting: LIMIT
  • Logical operators: AND, OR, NOT
  • Conditional logic: CASE

4๏ธโƒฃ Functions

๐Ÿ”ข Aggregate Functions

SUM, AVG, COUNT, MAX, MIN

๐Ÿ”ค String Functions

CONCAT, LENGTH, SUBSTRING, UPPER, LOWER, TRIM

๐Ÿ“… Date Functions

NOW(), CURDATE(), DATE_ADD(), DATE_FORMAT()


5๏ธโƒฃ Grouping & Filtering Groups

  • GROUP BY โ†’ group rows
  • HAVING โ†’ filter groups after grouping

6๏ธโƒฃ Joins

  • ๐Ÿ”— INNER JOIN
  • โ†ช๏ธ LEFT JOIN
  • โ†ฉ๏ธ RIGHT JOIN
  • ๐ŸŒ FULL JOIN
  • ๐Ÿ” SELF JOIN
  • โŒ CROSS JOIN

7๏ธโƒฃ Constraints

  • ๐Ÿ”‘ PRIMARY KEY
  • ๐Ÿ”— FOREIGN KEY
  • ๐Ÿ†” UNIQUE
  • ๐Ÿšซ NOT NULL
  • โœ”๏ธ CHECK
  • ๐Ÿ“Œ DEFAULT

8๏ธโƒฃ Set Operations

  • UNION
  • UNION ALL
  • INTERSECT
  • EXCEPT (if supported)

9๏ธโƒฃ Transactions & TCL

  • ๐Ÿงช START TRANSACTION
  • ๐Ÿ’พ COMMIT
  • โŒ ROLLBACK
  • ๐Ÿงฉ SAVEPOINT

Ensures ACID properties (Atomicity, Consistency, Isolation, Durability)


๐Ÿ”Ÿ Index

  • โšก CREATE INDEX โ†’ improves search speed
  • Can be: Unique or Non-Unique

๐Ÿš€ Advanced SQL โ€” Level Up Your Database Skills 1๏ธโƒฃ Subqueries & Nested Queries

๐Ÿ” Subquery in WHERE

๐Ÿ“ฆ Subquery in FROM (derived table)

๐ŸŽฏ Subquery in SELECT

๐Ÿ” Correlated Subqueries

โšก EXISTS vs IN vs ANY vs ALL


2๏ธโƒฃ Advanced Joins

๐Ÿ‘ฅ Self Join (manager-management table)

๐Ÿ”— Multi-table joins

๐Ÿ“Š Joins with Aggregate Functions

๐Ÿ”„ Cross Join usage in real cases


3๏ธโƒฃ Views

๐ŸชŸ Creating views: CREATE VIEW

๐Ÿ”„ Updating data with views

๐Ÿšซ Updatable vs Non-Updatable Views

๐Ÿ“˜ Real use cases: security, simplification


4๏ธโƒฃ Stored Procedures & Functions

โš™๏ธ CREATE PROCEDURE

๐Ÿงต Input & Output parameters

๐Ÿ”„ CALL a procedure

๐Ÿ“Œ Stored Functions using RETURN

๐Ÿ” Reusable logic for apps


5๏ธโƒฃ Triggers

๐Ÿงจ BEFORE INSERT

๐Ÿ”ฅ AFTER UPDATE

๐Ÿ“˜ Auditing tables

๐Ÿ“ Logging data changes

โš ๏ธ Enforcing rules automatically

6๏ธโƒฃ Window Functions (Analytical Functions)


๐ŸชŸ ROW_NUMBER()

๐ŸŽ– RANK()

๐Ÿฅ‡ DENSE_RANK()

โญ๏ธ LEAD()

โฎ๏ธ LAG()

โž• Running totals โ†’ SUM() OVER()


7๏ธโƒฃ CTE โ€” Common Table Expressions

๐Ÿ“„ WITH clause

๐Ÿ” Recursive CTE

Organization hierarchy

Category trees

Explaining parent-child relations


8๏ธโƒฃ Indexing (Performance Boost)

โšก Composite Index

๐Ÿ“˜ Covering Index

๐Ÿงฑ Clustered vs Non-Clustered (conceptual)

๐Ÿš€ How indexes affect WHERE, JOIN, ORDER BY


9๏ธโƒฃ Normalization & Design

1๏ธโƒฃ 1NF

2๏ธโƒฃ 2NF

3๏ธโƒฃ 3NF

๐Ÿ”ต BCNF

๐Ÿงฉ When to use Denormalization

๐Ÿ“ฆ Data redundancy control


๐Ÿ”Ÿ Query Optimization

๐Ÿ” EXPLAIN โ€” read query execution plan

โš™๏ธ Optimizing joins

๐Ÿงน Avoiding heavy subqueries

๐Ÿš… Improving performance using indexes

๐Ÿ“‰ Avoid full table scans

About

๐Ÿ’ก I Just Started My MySQL Learning Journey! Iโ€™ve recently started learning MySQL, a powerful relational database management system. I'm exploring how to create and manage databases, write SQL queries, and understand how data is stored, retrieved, and organized. So far, I've learned about SQL commands like CREATE, SELECT, INSERT, UPDATE,and DELETE.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published