I hope you are practising SQL whilst you are learning it. This technique makes it easier to understand concepts.
Alrighty, here is another thread for SQL. 🤩
SQL - A Beginner-friendly version! 📚
(Clauses: IN, BETWEEN and LIKE)
Thread 🧵
🌟Which table are we working on today?
The name of the table is "products". So the columns that we have are productCode, productName, productDescription, among others.
Take a look 👇
☑️ IN
This clause would reduce the efforts to write multiple OR conditions. It helps you find a specific match for a value.
👉 select column1, column2 from table_name where EXPRESSION IN ('value1', 'value2')
Here is another thread of the most important clauses to boost your SQL queries to the next level!
Advance SQL, A beginner-friendly version! (#DataScience)
Thread 🧵
Let me explain what the table looks like.
The table name is customer_list, where the columns are ID, name, address, zip code, phone, city, country, notes & SID.
See the image for reference
☑️ GROUP BY
This clause is used to group rows that have the same values together. It summarises data from the database.
Note: The group by clause returns one row for each group.
👉 Query: select col_name from table_name GROUP BY column_name;
Some SQL Aggregate Functions that would come in handy! ➕ ➖ ➗ ✖️
Let's dive right into them. 🤩
Thread 🧵
☑️ Aggregate Functions
The motive of these functions is to perform a calculation on a set of values and return a single value as a result.
Different functions:- 1. COUNT 2. AVERAGE (AVG) 3. MAXIMUM (MAX) 4. MINIMUM (MIN) 5. SUM
To understand most of the Advance SQL clauses, we will use the table named "payment". It consists of columns like payment_id, amount, staff_id, customer_id, etc. (See the image).
The first 5 rows of the table are also described for reference.
Hey, folks! Some time back, I was scrolling through LinkedIn and found some essential SQL topics to revisit before an Interview.
Have a look 🧵👇
1. WHERE, AND, OR, NOT, IN 2. ORDER BY, ASC, DESC 3. IS NULL 4. LIMIT 5. MIN, MAX, COUNT, AVG, SUM 6. LIKE, WILDCARDS 7. IN BETWEEN 8. INNER JOIN 9. LEFT JOIN
10. UNION ALL 11. GROUP BY 12. HAVING 13. LEFT, RIGHT, MID, CONCAT 14. PARTITION BY, OVER 15. LEAD, LAG 16. Subqueries 17. RANK, DENSE_RANK, PERCENT_RANK 18. ROW_NUMBER, CUME_DIST 19. FIRST_VALUE, LAST_VALUE 20. AS
Let's dive further into SQL to help you through the most demanding skill required in the Data Science Industry.
A Beginner's Guide to Filter Results in MySQL - Part 5!!
Thread 🧵
☑️ LIMIT Clause
To restrict the number of rows in the final result, we use the LIMIT clause.
That means if you have 10,000 rows in the data, you can fetch only 10 rows using this clause in your query.
👉 Query: select * table_name LIMIT limit_no;
For e.g., Consider a table PAYMENTS. It has more than 1000 rows. [See the image]