SQL চিটশিট
SQL সিনট্যাক্স, join, ফাংশন ও ডেটা টাইপের দ্রুত রেফারেন্স।
যেভাবে কাজ করে
SQL evaluates logically as FROM/JOIN -> WHERE -> GROUP BY -> HAVING -> SELECT/WINDOW -> DISTINCT -> ORDER BY -> LIMIT, even though `SELECT` is written first.
সারভাইভাল কিট
যে কয়েকটি কমান্ড সবার আগে শিখতে হবে।
৪২টি কমান্ড
Select, Filter & Pagination
Filter predicates safely, avoid NULL traps, sort, and paginate efficiently.
- অপরিহার্য
Filter rows, sort deterministically, and cap returned rows
SELECT <cols> FROM <table> WHERE <cond> ORDER BY <col> DESC LIMIT <n>;কমান্ড তৈরি করুন
SELECT <cols> FROM <table> WHERE <cond> ORDER BY <col> DESC LIMIT <n>;মানগুলো ঠিক যেভাবে টাইপ করা হয়েছে সেভাবেই বসানো হয়। স্পেস বা বিশেষ অক্ষর থাকলে নিজে কোট দিয়ে নিন।
কখন ব্যবহার করবেন
Adding a tie-breaker column to `ORDER BY` guarantees repeatable pagination order.
উদাহরণ
SELECT id, email, created_at FROM users WHERE status = 'active' ORDER BY created_at DESC, id DESC LIMIT 25;
Joins & Set Operations
Combine related tables cleanly and find orphan or unmatched rows.
Aggregation, CTEs & Window Functions
Group metrics, stage readable queries with CTEs, and rank without collapsing rows.
Insert, Upsert, Update & Delete
Write idempotent mutations safely inside transactions without locking accidents.
Schema, Constraints, JSON & Performance
Design tables, composite indexes, JSON queries, and inspect EXPLAIN plans.