UPDATE customers SET email = 'new@email.com' WHERE customer_id = 123;
--This updates the email address for the customer with ID 123.
--This updates the email address for the customer with ID 123.
π6
Joins allow you to combine data from multiple tables based on related columns
π10
Forwarded from Data Analytics
SQL Notes Part-1
Like if you need more content on SQL πβ€οΈ
Like if you need more content on SQL πβ€οΈ
π51β€8π1
Forwarded from Data Analytics
SQL Notes Part-3
(Cascading actions and Normalisation concepts)
(Cascading actions and Normalisation concepts)
π8β€3
Forwarded from Data Analytics
SQL Notes PART-4
Data Wrangling functions on string data types ππ
Data Wrangling functions on string data types ππ
π9β€3
π6
Free resources to learn SQL
Udacity free course- https://imp.i115008.net/AoAg7K
For Practice- https://stratascratch.com/?via=free
Udacity free course- https://imp.i115008.net/AoAg7K
For Practice- https://stratascratch.com/?via=free
π13β€3
If you are trying to transition into the data analytics domain and getting started with SQL, focus on the most useful concept that will help you solve the majority of the problems, and then try to learn the rest of the topics:
ππ» Basic Aggregation function:
1οΈβ£ AVG
2οΈβ£ COUNT
3οΈβ£ SUM
4οΈβ£ MIN
5οΈβ£ MAX
ππ» JOINS
1οΈβ£ Left
2οΈβ£ Inner
3οΈβ£ Self (Important, Practice questions on self join)
ππ» Windows Function (Important)
1οΈβ£ Learn how partitioning works
2οΈβ£ Learn the different use cases where Ranking/Numbering Functions are used? ( ROW_NUMBER,RANK, DENSE_RANK, NTILE)
3οΈβ£ Use Cases of LEAD & LAG functions
4οΈβ£ Use cases of Aggregate window functions
ππ» GROUP BY
ππ» WHERE vs HAVING
ππ» CASE STATEMENT
ππ» UNION vs Union ALL
ππ» LOGICAL OPERATORS
Other Commonly used functions:
ππ» IFNULL
ππ» COALESCE
ππ» ROUND
ππ» Working with Date Functions
1οΈβ£ EXTRACTING YEAR/MONTH/WEEK/DAY
2οΈβ£ Calculating date differences
ππ»CTE
ππ»Views & Triggers (optional)
Here is an amazing resources to learn & practice SQL: https://bit.ly/3FxxKPz
Share with credits: https://t.me/sqlspecialist
Hope it helps :)
ππ» Basic Aggregation function:
1οΈβ£ AVG
2οΈβ£ COUNT
3οΈβ£ SUM
4οΈβ£ MIN
5οΈβ£ MAX
ππ» JOINS
1οΈβ£ Left
2οΈβ£ Inner
3οΈβ£ Self (Important, Practice questions on self join)
ππ» Windows Function (Important)
1οΈβ£ Learn how partitioning works
2οΈβ£ Learn the different use cases where Ranking/Numbering Functions are used? ( ROW_NUMBER,RANK, DENSE_RANK, NTILE)
3οΈβ£ Use Cases of LEAD & LAG functions
4οΈβ£ Use cases of Aggregate window functions
ππ» GROUP BY
ππ» WHERE vs HAVING
ππ» CASE STATEMENT
ππ» UNION vs Union ALL
ππ» LOGICAL OPERATORS
Other Commonly used functions:
ππ» IFNULL
ππ» COALESCE
ππ» ROUND
ππ» Working with Date Functions
1οΈβ£ EXTRACTING YEAR/MONTH/WEEK/DAY
2οΈβ£ Calculating date differences
ππ»CTE
ππ»Views & Triggers (optional)
Here is an amazing resources to learn & practice SQL: https://bit.ly/3FxxKPz
Share with credits: https://t.me/sqlspecialist
Hope it helps :)
π25β€3
SQL Topicwise Interview Questions & Answers
https://www.linkedin.com/posts/sql-analysts_sql-intrrview-preparation-activity-7129458058409181184-UJKb
https://www.linkedin.com/posts/sql-analysts_sql-intrrview-preparation-activity-7129458058409181184-UJKb
Linkedin
SQL Intrrview Preparation | Data Analytics
SQL INTERVIEW QUESTIONS AND SOLUTIONS WITH TOPIC WISE.
(This is what we needed for a long term.)
For practical and queries asked in FAANG and MNCs , subscribe below.
Learn SQL in Deep Dive : Join below.
https://t.me/sqlanalyst
Follow Data Analytics forβ¦
(This is what we needed for a long term.)
For practical and queries asked in FAANG and MNCs , subscribe below.
Learn SQL in Deep Dive : Join below.
https://t.me/sqlanalyst
Follow Data Analytics forβ¦
β€1
Top 5 SQL Functions
https://t.me/sqlanalyst
1. SELECT Statement:
- Function: Retrieving data from one or more tables.
- Example:
2. COUNT Function:
- Function: Counts the number of rows that meet a specified condition.
- Example:
3. SUM Function:
- Function: Calculates the sum of values in a numeric column.
- Example:
4. AVG Function:
- Function: Computes the average value of a numeric column.
- Example:
5. GROUP BY Clause:
- Function: Groups rows that have the same values in specified columns into summary rows.
- Example:
These functions are fundamental in SQL and are frequently used for various data manipulation tasks, including data retrieval, aggregation, and analysis.
https://t.me/sqlanalyst
1. SELECT Statement:
- Function: Retrieving data from one or more tables.
- Example:
SELECT column1, column2 FROM table WHERE condition;2. COUNT Function:
- Function: Counts the number of rows that meet a specified condition.
- Example:
SELECT COUNT(column) FROM table WHERE condition;3. SUM Function:
- Function: Calculates the sum of values in a numeric column.
- Example:
SELECT SUM(column) FROM table WHERE condition;4. AVG Function:
- Function: Computes the average value of a numeric column.
- Example:
SELECT AVG(column) FROM table WHERE condition;5. GROUP BY Clause:
- Function: Groups rows that have the same values in specified columns into summary rows.
- Example:
SELECT column, AVG(numeric_column) FROM table GROUP BY column;These functions are fundamental in SQL and are frequently used for various data manipulation tasks, including data retrieval, aggregation, and analysis.
π23β€3
*SQL Interview Questions which can be asked in a Data Analyst Interview.*
1οΈβ£ What is difference between Primary key and Unique key?
βΌPrimary key- A column or set of columns which uniquely identifies each record in a table. It can't contain null values and only one primary key
can exist in a table.
βΌUnique key-Similar to primary key it also uniquely identifies each record in a table and can contain null values.Multiple Unique key can exist in a table.
2οΈβ£ What is a Candidate key?
βΌA key or set of keys that uniquely identifies each record in a table.It is a combination of Primary and Alternate key.
3οΈβ£ What is a Constraint?
βΌSpecific rule or limit that we define in our table. E.g - NOT NULL,AUTO INCREMENT
4οΈβ£ Can you differentiate between TRUNCATE and DELETE?
βΌTRUNCATE is a DDL command. It deletes the entire data from a table but preserves the structure of table.It doesn't deletes the data row by row hence faster than DELETE command, while DELETE is a DML command and it deletes the entire data based on specified condition else deletes the entire data,also it deletes the data row by row hence slower than TRUNCATE command.
5οΈβ£ What is difference between 'View' and 'Stored Procedure'?
βΌA View is a virtual table that gets data from the base table .It is basically a Select statement,while Stored Procedure is a sql statement or set of sql statement stored on database server.
6οΈβ£ What is difference between a Common Table Expression and temporary table?
βΌCTE is a temporary result set that is defined within execution scope of a single SELECT ,DELETE,UPDATE statement while temporary table is stored in TempDB and gets deleted once the session expires.
7οΈβ£ Differentiate between a clustered index and a non-clustered index?
βΌ A clustered index determines physical ordering of data in a table and a table can have only one clustered index while a non-clustered index is analogous to index of a book where index is stored at one place and data at other place and index will have pointers to storage location of the data,a table can have more than one non-clustered index.
8οΈβ£ Explain triggers ?
βΌThey are sql codes which are automatically executed in response to certain events on a table.They are used to maintain integrity of data.
1οΈβ£ What is difference between Primary key and Unique key?
βΌPrimary key- A column or set of columns which uniquely identifies each record in a table. It can't contain null values and only one primary key
can exist in a table.
βΌUnique key-Similar to primary key it also uniquely identifies each record in a table and can contain null values.Multiple Unique key can exist in a table.
2οΈβ£ What is a Candidate key?
βΌA key or set of keys that uniquely identifies each record in a table.It is a combination of Primary and Alternate key.
3οΈβ£ What is a Constraint?
βΌSpecific rule or limit that we define in our table. E.g - NOT NULL,AUTO INCREMENT
4οΈβ£ Can you differentiate between TRUNCATE and DELETE?
βΌTRUNCATE is a DDL command. It deletes the entire data from a table but preserves the structure of table.It doesn't deletes the data row by row hence faster than DELETE command, while DELETE is a DML command and it deletes the entire data based on specified condition else deletes the entire data,also it deletes the data row by row hence slower than TRUNCATE command.
5οΈβ£ What is difference between 'View' and 'Stored Procedure'?
βΌA View is a virtual table that gets data from the base table .It is basically a Select statement,while Stored Procedure is a sql statement or set of sql statement stored on database server.
6οΈβ£ What is difference between a Common Table Expression and temporary table?
βΌCTE is a temporary result set that is defined within execution scope of a single SELECT ,DELETE,UPDATE statement while temporary table is stored in TempDB and gets deleted once the session expires.
7οΈβ£ Differentiate between a clustered index and a non-clustered index?
βΌ A clustered index determines physical ordering of data in a table and a table can have only one clustered index while a non-clustered index is analogous to index of a book where index is stored at one place and data at other place and index will have pointers to storage location of the data,a table can have more than one non-clustered index.
8οΈβ£ Explain triggers ?
βΌThey are sql codes which are automatically executed in response to certain events on a table.They are used to maintain integrity of data.
π23β€3π1