Filter
Exclude
Time range
-
Near
6 May 2025
SQL Cheat Sheet for Beginners #sql #sqlcheatsheet
2
72
429
35,524
4 Mar 2025
Master SQL with this comprehensive cheat sheet! ๐Ÿš€ Includes essential commands, different types of JOINS, and practical examples to help you write queries like a pro. #SQL #Database #DataScience #SQLCheatsheet ๐Ÿ‘‰Learn here datafrik.co/bootcamp/beginneโ€ฆ
2
27
2,540
๐Ÿ“œ SQL Cheat Sheet ๐Ÿ” Fetching Data (SELECT) SELECT * FROM table_name; SELECT column1, column2 FROM table_name; SELECT DISTINCT column FROM table_name; _____________________________________________________ ๐ŸŽฏ Filtering Data (WHERE) SELECT * FROM users WHERE age > 25; SELECT * FROM orders WHERE status = 'delivered'; _____________________________________________________ ๐Ÿงฉ Multiple Conditions (AND, OR, NOT) SELECT * FROM users WHERE age > 25 AND city = 'Delhi'; SELECT * FROM products WHERE price < 500 OR stock > 50; SELECT * FROM employees WHERE NOT department = 'HR'; _____________________________________________________ ๐Ÿ”ข Sorting Results (ORDER BY) SELECT * FROM employees ORDER BY salary DESC; SELECT * FROM products ORDER BY price ASC, name DESC; _____________________________________________________ ๐ŸŽ› Limiting & Skipping (LIMIT, OFFSET) SELECT * FROM products LIMIT 5; SELECT * FROM orders LIMIT 10 OFFSET 5; _________________________________________________________ ๐Ÿ— Grouping Data (GROUP BY, HAVING) SELECT department, COUNT(*) FROM employees GROUP BY department; SELECT category, AVG(price) FROM products GROUP BY category HAVING AVG(price) > 100; _________________________________________________________ ๐Ÿ† Aggregations (COUNT, SUM, AVG, MIN, MAX) SELECT COUNT(*) FROM users; SELECT SUM(price) FROM orders; SELECT AVG(salary) FROM employees; SELECT MIN(age), MAX(age) FROM users; _____________________________________________________ ๐Ÿ”„ Joining Tables (JOIN) ๐Ÿ‘ซ Inner Join SELECT users.name, orders.amount FROM users INNER JOIN orders ON users.id = orders.user_id; _____________________________________________________ ๐Ÿ“Œ Left Join SELECT users.name, orders.amount FROM users LEFT JOIN orders ON users.id = orders.user_id; _________________________________________________________ ๐Ÿ“Œ Right Join SELECT users.name, orders.amount FROM users RIGHT JOIN orders ON users.id = orders.user_id; _____________________________________________________ ๐Ÿ”— Full Join SELECT users.name, orders.amount FROM users FULL JOIN orders ON users.id = orders.user_id; _____________________________________________________ ๐Ÿ— Creating & Modifying Tables ๐Ÿ†• Creating a Table CREATE TABLE users ( id INT PRIMARY KEY, name VARCHAR(100), age INT, city VARCHAR(50) ); _____________________________________________________ ๐Ÿ”ง Altering a Table ALTER TABLE users ADD COLUMN email VARCHAR(100); ALTER TABLE users DROP COLUMN city; _____________________________________________________ ๐Ÿ“ Modifying Data โž• Inserting Data INSERT INTO users (id, name, age) VALUES (1, 'Amit', 30); _____________________________________________________ ๐Ÿ›  Updating Data UPDATE users SET age = 31 WHERE id = 1; _____________________________________________________ โŒ Deleting Data DELETE FROM users WHERE id = 1; DELETE FROM users; -- Delete all rows _____________________________________________________ ๐Ÿ› Indexes & Keys ๐Ÿ”‘ Primary Key CREATE TABLE users ( id INT PRIMARY KEY, name VARCHAR(100) ); _____________________________________________________ ๐Ÿ”‘ Foreign Key CREATE TABLE orders ( id INT PRIMARY KEY, user_id INT, FOREIGN KEY (user_id) REFERENCES users(id) ); _____________________________________________________ ๐Ÿš€ Creating Index CREATE INDEX idx_name ON users(name); _____________________________________________________ ๐Ÿ“œ Subqueries & Unions ๐Ÿ”„ Subquery SELECT name FROM users WHERE id IN (SELECT user_id FROM orders); _____________________________________________________ ๐Ÿ”— Union (Combine Results) SELECT name FROM customers UNION SELECT name FROM suppliers; SELECT name FROM customers UNION ALL SELECT name FROM suppliers; -- Includes duplicates _____________________________________________________ ๐Ÿ”ฅ Transactions BEGIN TRANSACTION; UPDATE accounts SET balance = balance - 500 WHERE id = 1; UPDATE accounts SET balance = balance 500 WHERE id = 2; COMMIT; -- Save changes ROLLBACK; -- Undo changes #SQL #SQLTutorial #LearnSQL #SQLQueries #SQLCheatSheet #Database #DataScience #Programming #Tech #Code #SQLForBeginners #SQLBasics #SQLTraining #LearnToCode #CodingForBeginners #AdvancedSQL #SQLPerformance #SQLOptimization #SQLBestPractices #SQLDatabase #MySQL #PostgreSQL #SQLServer #OracleSQL #NoSQL #DataAnalytics #SQLForDataScience #BusinessIntelligence #BigData #DataVisualization
28
19
66
8,752
1
5
323
๐Ÿ“Š Master SQL with our handy SQL Cheat Sheet! ๐ŸŒŸ From basics to advanced functions, this guide covers everything you need to know about string manipulation, joins, aggregate functions, etc., #SQL #SQLCheatSheet #DataScience #DataAnalysis #DatabaseManagement #SQLBasics #Advanced
1
2
36
SQL Joins That Every Developer Should Know! Donโ€™t forget to save and share this post. Check out the threads below for the complete cheatsheet. #SQLJoins #SQLCheatsheet
2
7
334
Unlock the power of databases with this SQL cheatsheet! ๐Ÿš€ From SELECT to JOIN, it's your go-to guide for efficient queries. Save it, share it, and level up your SQL game. #SQLCheatsheet #DatabaseMagic #technology #blockchain #education โœจ๐Ÿ“Š
1
1
4
63
Master SQL with our Comprehensive Cheat Sheet! ๐Ÿ“Š๐Ÿ” From Keywords to Functions, Indexes to Keys, we've got you covered. Download your FREE PDF now! ๐Ÿ’ก๐Ÿ“š ๐‘๐ž๐š๐ ๐๐ฅ๐จ๐  ๐‡๐ž๐ซ๐ž: kanakinfosystems.com/blog/sqโ€ฆ #SQLMastery #CheatSheet #DownloadNow #sqlcheatsheet #sqlcheatsheetpdf
1
22
SQL Cheat Sheet #sql #sqlcheatsheet
4
2
189
Replying to @ShahzaibOG11
Saved this Tweet to your Notion database. Tags: [Sql, Sqlcheatsheet]
12
Replying to @Faded_Fuzz
Saved this Tweet to your Notion database. Tags: [Sqlcheatsheet]
#SQL remains one of the most important skills in #DataScience. You will need SQL to read data from #tables and combine data in useful form before you can create a #machinelearning model. Found in #LinkedIn #copied #SQLCheatSheet
1
7