Hello friends, If you are going to attend an interview where you expect SQL related questions, then you should definitely check out the below SQL Interview cheatsheet.
This Cheatsheet contains the frequently asked questions in SQL which every SQL professional should be aware. Bookmark this page and Go through these to instantly brush up the basics before attending any SQL interview
SELECT * FROM table_name;
SELECT DISTINCT column_name FROM table_name;
SELECT * FROM table_name LIMIT N;
SELECT * FROM table_name WHERE column_name = value;
SELECT * FROM table_name WHERE column_name BETWEEN value1 AND value2;
SELECT * FROM table_name WHERE column_name IS NULL;
SELECT * FROM table_name ORDER BY column_name ASC/DESC;
SELECT COUNT(*) FROM table_name;
SELECT AVG(column_name), SUM(column_name), MIN(column_name), MAX(column_name) FROM table_name;
SELECT column_name, AVG(salary) FROM table_name GROUP BY column_name;
INNER: Retrieves common rows from both tables.
LEFT: Retrieves all rows from the left table and matching rows from the right.
RIGHT: Retrieves all rows from the right table and matching from the left.
FULL: Retrieves all rows from both tables.
SELECT * FROM table1 JOIN table2 ON table1.column_name = table2.column_name;
SELECT * FROM table_name WHERE column_name IN (SELECT column_name FROM another_table);
SELECT * FROM table1 WHERE column_name = (SELECT column_name FROM table2 WHERE condition);
INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...);
UPDATE table_name SET column_name = new_value WHERE condition;
DELETE FROM table_name WHERE condition;
Fully customizable CRM Software for Freelancers and Small Businesses