SQL Cheatsheet 📝
This SQL cheatsheet is designed to be your quick reference guide for SQL programming. Whether you’re a beginner learning how to query databases or an experienced developer looking for a handy resource, this cheatsheet covers essential SQL topics.
1. Database Basics
-
-
2. Tables
- Create Table:
- Drop Table:
- Alter Table:
3. Insert Data
-
4. Select Queries
- Basic Select:
- Select Specific Columns:
- Select with Condition:
5. Update Data
-
6. Delete Data
-
7. Joins
- Inner Join:
- Left Join:
- Right Join:
8. Aggregations
- Count:
- Sum:
- Group By:
9. Sorting & Limiting
- Order By:
- Limit Results:
10. Indexes
- Create Index:
- Drop Index:
11. Subqueries
-
12. Views
- Create View:
- Drop View:
Here you can find SQL Interview Resources👇
https://news.1rj.ru/str/DataSimplifier
Share with credits: https://news.1rj.ru/str/sqlspecialist
Hope it helps :)
This SQL cheatsheet is designed to be your quick reference guide for SQL programming. Whether you’re a beginner learning how to query databases or an experienced developer looking for a handy resource, this cheatsheet covers essential SQL topics.
1. Database Basics
-
CREATE DATABASE db_name;-
USE db_name;2. Tables
- Create Table:
CREATE TABLE table_name (col1 datatype, col2 datatype);- Drop Table:
DROP TABLE table_name;- Alter Table:
ALTER TABLE table_name ADD column_name datatype;3. Insert Data
-
INSERT INTO table_name (col1, col2) VALUES (val1, val2);4. Select Queries
- Basic Select:
SELECT * FROM table_name;- Select Specific Columns:
SELECT col1, col2 FROM table_name;- Select with Condition:
SELECT * FROM table_name WHERE condition;5. Update Data
-
UPDATE table_name SET col1 = value1 WHERE condition;6. Delete Data
-
DELETE FROM table_name WHERE condition;7. Joins
- Inner Join:
SELECT * FROM table1 INNER JOIN table2 ON table1.col = table2.col;- Left Join:
SELECT * FROM table1 LEFT JOIN table2 ON table1.col = table2.col;- Right Join:
SELECT * FROM table1 RIGHT JOIN table2 ON table1.col = table2.col;8. Aggregations
- Count:
SELECT COUNT(*) FROM table_name;- Sum:
SELECT SUM(col) FROM table_name;- Group By:
SELECT col, COUNT(*) FROM table_name GROUP BY col;9. Sorting & Limiting
- Order By:
SELECT * FROM table_name ORDER BY col ASC|DESC;- Limit Results:
SELECT * FROM table_name LIMIT n;10. Indexes
- Create Index:
CREATE INDEX idx_name ON table_name (col);- Drop Index:
DROP INDEX idx_name;11. Subqueries
-
SELECT * FROM table_name WHERE col IN (SELECT col FROM other_table);12. Views
- Create View:
CREATE VIEW view_name AS SELECT * FROM table_name;- Drop View:
DROP VIEW view_name;Here you can find SQL Interview Resources👇
https://news.1rj.ru/str/DataSimplifier
Share with credits: https://news.1rj.ru/str/sqlspecialist
Hope it helps :)
❤7
Beware of any recruiter who asks for money for interview scheduling, certification, or references etc. This is a clear sign of a scam and a fake hiring process.
- No Payment Required: In the IT industry, you should never have to make any kind of payment to get hired. Legitimate companies and recruiters do not charge candidates for job opportunities.
- Third-Party Agencies: Even when you are working with third-party agencies, these agencies charge the employer (their clients), not you.
Red Flags to Identify Scams:
- Payment Requests: If a recruiter asks for money at any stage, it is likely a scam.
- Unverified Contacts: Be cautious if the recruiter’s contact information or company details cannot be verified.
- Pressure Tactics: Scammers often use urgency or pressure tactics to get you to pay quickly.
Always remember: never pay for a job opportunity. If a recruiter or agency asks for money, it is a scam. Stay away and protect yourself from fraudulent practices.
- No Payment Required: In the IT industry, you should never have to make any kind of payment to get hired. Legitimate companies and recruiters do not charge candidates for job opportunities.
- Third-Party Agencies: Even when you are working with third-party agencies, these agencies charge the employer (their clients), not you.
Red Flags to Identify Scams:
- Payment Requests: If a recruiter asks for money at any stage, it is likely a scam.
- Unverified Contacts: Be cautious if the recruiter’s contact information or company details cannot be verified.
- Pressure Tactics: Scammers often use urgency or pressure tactics to get you to pay quickly.
Always remember: never pay for a job opportunity. If a recruiter or agency asks for money, it is a scam. Stay away and protect yourself from fraudulent practices.
❤8👍4
Which of the following is the correct formula to find the sum of cells A1 to A10 in Excel?
Anonymous Quiz
6%
=ADD(A1:A10)
90%
=SUM(A1:A10)
1%
=PLUS(A1:A10)
2%
=TOTAL(A1:A10)
❤9
Which Excel feature allows you to rearrange rows based on the contents of a column?
Anonymous Poll
23%
Filtering
44%
Sorting
19%
Conditional Formatting
14%
Pivot Tables
❤5
What does the VLOOKUP function do in Excel?
Anonymous Quiz
5%
Calculates the average of a range of cells
87%
Vertically search for value in first column of range and returns value from other column in same row
5%
Combines multiple cells into one
3%
Validates data entered into a cell
❤4👍2
Which symbol is used to make a cell reference absolute in Excel (so it doesn't change when you copy the formula)?
Anonymous Quiz
15%
&
15%
*
61%
$
8%
!
❤5👏2
What is the primary purpose of Data Validation in Excel?
Anonymous Quiz
7%
To format data consistently
88%
To ensure data is accurate and consistent by restricting type of data that can be entered into cell
3%
To automatically correct spelling errors
2%
To encrypt data
❤4👏2
𝗟𝗲𝗮𝗿𝗻 𝗗𝗮𝘁𝗮 𝗦𝗰𝗶𝗲𝗻𝗰𝗲 𝗳𝗼𝗿 𝗙𝗥𝗘𝗘 (𝗡𝗼 𝗦𝘁𝗿𝗶𝗻𝗴𝘀 𝗔𝘁𝘁𝗮𝗰𝗵𝗲𝗱)
𝗡𝗼 𝗳𝗮𝗻𝗰𝘆 𝗰𝗼𝘂𝗿𝘀𝗲𝘀, 𝗻𝗼 𝗰𝗼𝗻𝗱𝗶𝘁𝗶𝗼𝗻𝘀, 𝗷𝘂𝘀𝘁 𝗽𝘂𝗿𝗲 𝗹𝗲𝗮𝗿𝗻𝗶𝗻𝗴.
𝗛𝗲𝗿𝗲’𝘀 𝗵𝗼𝘄 𝘁𝗼 𝗯𝗲𝗰𝗼𝗺𝗲 𝗮 𝗗𝗮𝘁𝗮 𝗦𝗰𝗶𝗲𝗻𝘁𝗶𝘀𝘁 𝗳𝗼𝗿 𝗙𝗥𝗘𝗘:
1️⃣ Python Programming for Data Science → Harvard’s CS50P
The best intro to Python for absolute beginners:
↬ Covers loops, data structures, and practical exercises.
↬ Designed to help you build foundational coding skills.
Link: https://cs50.harvard.edu/python/
https://news.1rj.ru/str/datasciencefun
2️⃣ Statistics & Probability → Khan Academy
Want to master probability, distributions, and hypothesis testing? This is where to start:
↬ Clear, beginner-friendly videos.
↬ Exercises to test your skills.
Link: https://www.khanacademy.org/math/statistics-probability
https://whatsapp.com/channel/0029Vat3Dc4KAwEcfFbNnZ3O
3️⃣ Linear Algebra for Data Science → 3Blue1Brown
↬ Learn about matrices, vectors, and transformations.
↬ Essential for machine learning models.
Link: https://www.youtube.com/playlist?list=PLZHQObOWTQDMsr9KzVk3AjplI5PYPxkUr
4️⃣ SQL Basics → Mode Analytics
SQL is the backbone of data manipulation. This tutorial covers:
↬ Writing queries, joins, and filtering data.
↬ Real-world datasets to practice.
Link: https://mode.com/sql-tutorial
https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
5️⃣ Data Visualization → freeCodeCamp
Learn to create stunning visualizations using Python libraries:
↬ Covers Matplotlib, Seaborn, and Plotly.
↬ Step-by-step projects included.
Link: https://www.youtube.com/watch?v=JLzTJhC2DZg
https://whatsapp.com/channel/0029VaxaFzoEQIaujB31SO34
6️⃣ Machine Learning Basics → Google’s Machine Learning Crash Course
An in-depth introduction to machine learning for beginners:
↬ Learn supervised and unsupervised learning.
↬ Hands-on coding with TensorFlow.
Link: https://developers.google.com/machine-learning/crash-course
7️⃣ Deep Learning → Fast.ai’s Free Course
Fast.ai makes deep learning easy and accessible:
↬ Build neural networks with PyTorch.
↬ Learn by coding real projects.
Link: https://course.fast.ai/
8️⃣ Data Science Projects → Kaggle
↬ Compete in challenges to practice your skills.
↬ Great way to build your portfolio.
Link: https://www.kaggle.com/
𝗡𝗼 𝗳𝗮𝗻𝗰𝘆 𝗰𝗼𝘂𝗿𝘀𝗲𝘀, 𝗻𝗼 𝗰𝗼𝗻𝗱𝗶𝘁𝗶𝗼𝗻𝘀, 𝗷𝘂𝘀𝘁 𝗽𝘂𝗿𝗲 𝗹𝗲𝗮𝗿𝗻𝗶𝗻𝗴.
𝗛𝗲𝗿𝗲’𝘀 𝗵𝗼𝘄 𝘁𝗼 𝗯𝗲𝗰𝗼𝗺𝗲 𝗮 𝗗𝗮𝘁𝗮 𝗦𝗰𝗶𝗲𝗻𝘁𝗶𝘀𝘁 𝗳𝗼𝗿 𝗙𝗥𝗘𝗘:
1️⃣ Python Programming for Data Science → Harvard’s CS50P
The best intro to Python for absolute beginners:
↬ Covers loops, data structures, and practical exercises.
↬ Designed to help you build foundational coding skills.
Link: https://cs50.harvard.edu/python/
https://news.1rj.ru/str/datasciencefun
2️⃣ Statistics & Probability → Khan Academy
Want to master probability, distributions, and hypothesis testing? This is where to start:
↬ Clear, beginner-friendly videos.
↬ Exercises to test your skills.
Link: https://www.khanacademy.org/math/statistics-probability
https://whatsapp.com/channel/0029Vat3Dc4KAwEcfFbNnZ3O
3️⃣ Linear Algebra for Data Science → 3Blue1Brown
↬ Learn about matrices, vectors, and transformations.
↬ Essential for machine learning models.
Link: https://www.youtube.com/playlist?list=PLZHQObOWTQDMsr9KzVk3AjplI5PYPxkUr
4️⃣ SQL Basics → Mode Analytics
SQL is the backbone of data manipulation. This tutorial covers:
↬ Writing queries, joins, and filtering data.
↬ Real-world datasets to practice.
Link: https://mode.com/sql-tutorial
https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
5️⃣ Data Visualization → freeCodeCamp
Learn to create stunning visualizations using Python libraries:
↬ Covers Matplotlib, Seaborn, and Plotly.
↬ Step-by-step projects included.
Link: https://www.youtube.com/watch?v=JLzTJhC2DZg
https://whatsapp.com/channel/0029VaxaFzoEQIaujB31SO34
6️⃣ Machine Learning Basics → Google’s Machine Learning Crash Course
An in-depth introduction to machine learning for beginners:
↬ Learn supervised and unsupervised learning.
↬ Hands-on coding with TensorFlow.
Link: https://developers.google.com/machine-learning/crash-course
7️⃣ Deep Learning → Fast.ai’s Free Course
Fast.ai makes deep learning easy and accessible:
↬ Build neural networks with PyTorch.
↬ Learn by coding real projects.
Link: https://course.fast.ai/
8️⃣ Data Science Projects → Kaggle
↬ Compete in challenges to practice your skills.
↬ Great way to build your portfolio.
Link: https://www.kaggle.com/
❤8
Data Analytics Interview Questions with Answers
1. What are Query and Query language?
A query is nothing but a request sent to a database to retrieve data or information. The required data can be retrieved from a table or many tables in the database.
Query languages use various types of queries to retrieve data from databases. SQL, Datalog, and AQL are a few examples of query languages; however, SQL is known to be the widely used query language.
2. What are Superkey and candidate key?
A super key may be a single or a combination of keys that help to identify a record in a table. Know that Super keys can have one or more attributes, even though all the attributes are not necessary to identify the records.
A candidate key is the subset of Superkey, which can have one or more than one attributes to identify records in a table. Unlike Superkey, all the attributes of the candidate key must be helpful to identify the records.
3. What do you mean by buffer pool and mention its benefits?
A buffer pool in SQL is also known as a buffer cache. All the resources can store their cached data pages in a buffer pool. The size of the buffer pool can be defined during the configuration of an instance of SQL Server.
The following are the benefits of a buffer pool:
Increase in I/O performance
Reduction in I/O latency
Increase in transaction throughput
Increase in reading performance
4. What is the difference between Zero and NULL values in SQL?
When a field in a column doesn’t have any value, it is said to be having a NULL value. Simply put, NULL is the blank field in a table. It can be considered as an unassigned, unknown, or unavailable value. On the contrary, zero is a number, and it is an available, assigned, and known value.
1. What are Query and Query language?
A query is nothing but a request sent to a database to retrieve data or information. The required data can be retrieved from a table or many tables in the database.
Query languages use various types of queries to retrieve data from databases. SQL, Datalog, and AQL are a few examples of query languages; however, SQL is known to be the widely used query language.
2. What are Superkey and candidate key?
A super key may be a single or a combination of keys that help to identify a record in a table. Know that Super keys can have one or more attributes, even though all the attributes are not necessary to identify the records.
A candidate key is the subset of Superkey, which can have one or more than one attributes to identify records in a table. Unlike Superkey, all the attributes of the candidate key must be helpful to identify the records.
3. What do you mean by buffer pool and mention its benefits?
A buffer pool in SQL is also known as a buffer cache. All the resources can store their cached data pages in a buffer pool. The size of the buffer pool can be defined during the configuration of an instance of SQL Server.
The following are the benefits of a buffer pool:
Increase in I/O performance
Reduction in I/O latency
Increase in transaction throughput
Increase in reading performance
4. What is the difference between Zero and NULL values in SQL?
When a field in a column doesn’t have any value, it is said to be having a NULL value. Simply put, NULL is the blank field in a table. It can be considered as an unassigned, unknown, or unavailable value. On the contrary, zero is a number, and it is an available, assigned, and known value.
❤8