Skip to main content

SQL Quick Reference (Cheat Sheet) πŸ“„

Mentor's Note: Keep this page bookmarked! It contains the "Formula" for every major SQL command we've learned. πŸ’‘


πŸ—οΈ Structure (DDL)​

ActionSyntax
Create TableCREATE TABLE table (col type, ...);
Add ColumnALTER TABLE table ADD col type;
Drop ColumnALTER TABLE table DROP COLUMN col;
Delete TableDROP TABLE table;
Clear TableTRUNCATE TABLE table;

πŸ“ Data Operations (DML)​

ActionSyntax
Fetch AllSELECT * FROM table;
Add RowINSERT INTO table (cols) VALUES (vals);
Modify RowUPDATE table SET col = val WHERE condition;
Remove RowDELETE FROM table WHERE condition;

πŸ” Filtering & Sorting​

FilterLogic
RangeWHERE salary BETWEEN 1000 AND 5000
SetWHERE city IN ('Surat', 'Mumbai')
PatternWHERE name LIKE 'A%'
NULLsWHERE email IS NULL
Sort`ORDER BY name ASC

πŸ•ΈοΈ Joins​

Join TypeDescription
INNER JOINMatch in BOTH tables. βœ…
LEFT JOINALL from Left + Matches from Right. πŸ‘ˆ
FULL JOINEVERYTHING from both. πŸŒ•

πŸ“Š Aggregates​

  • COUNT(*): Total Rows.
  • SUM(col): Total Sum.
  • AVG(col): Mean.
  • MIN/MAX: Smallest/Largest.

πŸ’‘ Syntax Hierarchy​

  1. SELECT
  2. FROM
  3. WHERE
  4. GROUP BY
  5. HAVING
  6. ORDER BY

πŸ“ˆ Learning Path​

πŸ“ Visit Us

🏫 VD Computer Tuition Surat

VD Computer Tuition
πŸ“ Address
2/66 Faram Street, Rustompura
Surat – 395002, Gujarat, India
πŸ“ž Phone / WhatsApp
+91 84604 41384
🌐 Website

Computer Classes & Tuition β€” Areas We Serve in Surat

Adajanβ€’Althanβ€’Amroliβ€’Athwaβ€’Athwalinesβ€’Bhagalβ€’Bhatarβ€’Bhestanβ€’Canal Roadβ€’Chowkβ€’Citylightβ€’Dumasβ€’Gaurav Pathβ€’Ghod Dod Roadβ€’Haziraβ€’Jahangirpuraβ€’Kamrejβ€’Kapodraβ€’Katargamβ€’Limbayatβ€’Magdallaβ€’Majura Gateβ€’Mota Varachhaβ€’Nanpuraβ€’New Citylightβ€’Olpadβ€’Palβ€’Pandesaraβ€’Parle Pointβ€’Piplodβ€’Punaβ€’Randerβ€’Ring Roadβ€’Rustampuraβ€’Sachinβ€’Salabatpuraβ€’Sarthanaβ€’Sosyo Circleβ€’Udhnaβ€’Varachhaβ€’Ved Roadβ€’Vesuβ€’VIP Road
πŸ“ž Call SirπŸ’¬ WhatsApp Sir