Data Analytics
Perfect channel to learn Data Analytics Learn SQL, Python, Alteryx, Tableau, Power BI and many more For Promotions: @coderfun @love_data
إظهار المزيد📈 نظرة تحليلية على قناة تيليجرام Data Analytics
تُعد قناة Data Analytics (@sqlspecialist) في القطاع اللغوي الإنكليزية لاعباً نشطاً. يضم المجتمع حالياً 109 719 مشتركاً، محتلاً المرتبة 1 116 في فئة التكنولوجيات والتطبيقات والمرتبة 2 331 في منطقة الهند.
📊 مؤشرات الجمهور والحراك
منذ تأسيسه في невідомо، حقق المشروع نمواً سريعاً وجمع 109 719 مشتركاً.
بحسب آخر البيانات بتاريخ 26 يونيو, 2026، تحافظ القناة على نشاط مستقر. خلال آخر 30 يوماً تغيّر عدد الأعضاء بمقدار 579، وفي آخر 24 ساعة بمقدار 1، مع بقاء الوصول العام مرتفعاً.
- حالة التحقق: غير موثّقة
- معدل التفاعل (ER): يبلغ متوسط تفاعل الجمهور 2.58%. وخلال أول 24 ساعة من النشر يحصد المحتوى عادةً 0.93% من ردود الفعل نسبةً إلى إجمالي المشتركين.
- وصول المنشورات: يحصل كل منشور على متوسط 2 827 مشاهدة. وخلال اليوم الأول يجمع عادةً 1 016 مشاهدة.
- التفاعلات والاستجابة: يتفاعل الجمهور بانتظام؛ متوسط التفاعلات لكل منشور يبلغ 7.
- الاهتمامات الموضوعية: يركز المحتوى على مواضيع رئيسية مثل row, sql, analytic, analyst, visualization.
📝 الوصف وسياسة المحتوى
يصف المؤلف القناة بأنها مساحة للتعبير عن الآراء الذاتية:
“Perfect channel to learn Data Analytics
Learn SQL, Python, Alteryx, Tableau, Power BI and many more
For Promotions: @coderfun @love_data”
بفضل وتيرة التحديث المرتفعة (أحدث البيانات بتاريخ 27 يونيو, 2026) تحافظ القناة على حداثتها ومستوى وصول مرتفع. وتُظهر التحليلات تفاعلاً نشطاً من الجمهور، ما يجعلها نقطة تأثير مهمة ضمن فئة التكنولوجيات والتطبيقات.
employees and departments:
employees table:
| employee_id | name | department_id |
|-------------|-------|---------------|
| 1 | John | 10 |
| 2 | Jane | 20 |
| 3 | Jim | 30 |
departments table:
| department_id | department_name |
|---------------|-----------------|
| 10 | HR |
| 20 | Finance |
| 40 | IT |
An INNER JOIN query to get the employees and their corresponding department names would be:
SELECT employees.name, departments.department_name
FROM employees
INNER JOIN departments ON employees.department_id = departments.department_id;
Result:
| name | department_name |
|-------|-----------------|
| John | HR |
| Jane | Finance |
LEFT JOIN:
A LEFT JOIN returns all the rows from the left table and the matched rows from the right table. If there is no match, the result is NULL on the side of the right table.
Example:
Using the same tables, a LEFT JOIN query to get all employees and their corresponding department names would be:
SELECT employees.name, departments.department_name
FROM employees
LEFT JOIN departments ON employees.department_id = departments.department_id;
Result:
| name | department_name |
|-------|-----------------|
| John | HR |
| Jane | Finance |
| Jim | NULL |
In this result, Jim is included even though there is no corresponding department in the departments table, showing a NULL for department_name.
Tip: Use an INNER JOIN when you want to retrieve only the records that have matching values in both tables. Use a LEFT JOIN when you want to retrieve all records from the left table and the matching records from the right table, filling in NULLs for non-matching rows. Understanding these joins is crucial for effectively querying relational databases and retrieving the desired data.
Here you can find SQL Interview Resources👇
https://topmate.io/analyst/864764
Like this post if you need more 👍❤️
Share with credits: https://t.me/sqlspecialist
Hope it helps :)UNION operator combines the result sets of two or more SELECT statements into a single result set and removes duplicate rows. Each SELECT statement within the UNION must have the same number of columns in the result sets with similar data types.
Example:
Suppose we have two tables, employees_2022 and employees_2023:
employees_2022:
| employee_id | name |
|-------------|-------|
| 1 | John |
| 2 | Jane |
employees_2023:
| employee_id | name |
|-------------|-------|
| 2 | Jane |
| 3 | Jim |
Using UNION:
SELECT name FROM employees_2022
UNION
SELECT name FROM employees_2023;
Result:
| name |
|-------|
| John |
| Jane |
| Jim |
UNION ALL:
The UNION ALL operator also combines the result sets of two or more SELECT statements but does not remove duplicates. It includes all rows, regardless of whether they are duplicates.
Using UNION ALL:
SELECT name FROM employees_2022
UNION ALL
SELECT name FROM employees_2023;
Result:
| name |
|-------|
| John |
| Jane |
| Jane |
| Jim |
Key Differences:
- Duplicates: UNION removes duplicates, while UNION ALL includes all rows.
- Performance: UNION ALL is generally faster because it does not require the additional step of removing duplicates.
Tip: Use UNION when you need distinct results and UNION ALL when you want to retain all data, especially in scenarios where performance is critical and duplicates are acceptable.
Here you can find SQL Interview Resources👇
https://topmate.io/analyst/864764
Like this post if you need more 👍❤️
Share with credits: https://t.me/sqlspecialist
Hope it helps :)employees table.
1. Create the Stored Procedure:
CREATE PROCEDURE AddEmployee
@FirstName VARCHAR(50),
@LastName VARCHAR(50),
@DepartmentId INT,
@Salary DECIMAL(10, 2)
AS
BEGIN
INSERT INTO employees (first_name, last_name, department_id, salary)
VALUES (@FirstName, @LastName, @DepartmentId, @Salary);
END;
2. Execute the Stored Procedure:
EXEC AddEmployee 'John', 'Doe', 10, 55000.00;
Explanation:
- The stored procedure AddEmployee accepts four parameters: @FirstName, @LastName, @DepartmentId, and @Salary.
- Inside the procedure, an INSERT statement is executed to add a new record to the employees table using the provided parameters.
- The procedure is executed with the EXEC command, passing the required values for the parameters.
Tip: Stored procedures are powerful tools for encapsulating business logic and database operations. Use them to simplify and secure your database interactions, especially when dealing with repetitive tasks or complex logic. Always consider parameterizing your stored procedures to prevent SQL injection attacks. CREATE TABLE students (
student_id INT PRIMARY KEY,
student_name VARCHAR(100),
phone_number VARCHAR(15)
);
Here, each cell contains only one value, and each record is unique.
2. Second Normal Form (2NF):
- Definition: Achieves 1NF and ensures that all non-key attributes are fully functionally dependent on the primary key.
- Example:
CREATE TABLE student_courses (
student_id INT,
course_id INT,
PRIMARY KEY (student_id, course_id)
);
CREATE TABLE students (
student_id INT PRIMARY KEY,
student_name VARCHAR(100)
);
CREATE TABLE courses (
course_id INT PRIMARY KEY,
course_name VARCHAR(100)
);
Here, each non-key attribute is dependent on the whole primary key.
3. Third Normal Form (3NF):
- Definition: Achieves 2NF and ensures that all non-key attributes are not only fully functionally dependent on the primary key but also non-transitively dependent (i.e., no transitive dependency).
- Example:
CREATE TABLE student_courses (
student_id INT,
course_id INT,
PRIMARY KEY (student_id, course_id)
);
CREATE TABLE students (
student_id INT PRIMARY KEY,
student_name VARCHAR(100),
department_id INT
);
CREATE TABLE departments (
department_id INT PRIMARY KEY,
department_name VARCHAR(100)
);
Here, student_name depends only on student_id, and department_name depends only on department_id.
4. Boyce-Codd Normal Form (BCNF):
- Definition: A stricter version of 3NF where every determinant is a candidate key.
- Example:
CREATE TABLE student_courses (
student_id INT,
course_id INT,
course_instructor VARCHAR(100),
PRIMARY KEY (student_id, course_id)
);
CREATE TABLE courses (
course_id INT PRIMARY KEY,
course_name VARCHAR(100),
course_instructor VARCHAR(100)
);
Here, the table is decomposed to ensure no non-trivial functional dependency other than a super key.
5. Fourth Normal Form (4NF):
- Definition: Achieves BCNF and ensures that multi-valued dependencies are removed.
- Example:
CREATE TABLE student_languages (
student_id INT,
language VARCHAR(50),
PRIMARY KEY (student_id, language)
);
CREATE TABLE student_courses (
student_id INT,
course_id INT,
PRIMARY KEY (student_id, course_id)
);
Here, the two independent multi-valued facts (languages known by a student and courses taken by a student) are stored in separate tables.
6. Fifth Normal Form (5NF):
- Definition: Ensures that every join dependency is implied by the candidate keys.
- Example:
Rarely used in practical scenarios, but the concept is to decompose tables to avoid redundancy and ensure data integrity further.
Tip: Normalization is crucial for efficient database design and maintenance. However, over-normalization can lead to complex queries and performance issues. It's important to balance normalization with practical performance considerations.
Like this post if you want me to continue this SQL series 👍♥️
Share with credits: https://t.me/sqlspecialist
Hope it helps :) DELETE FROM table_name WHERE condition;
- Example:
DELETE FROM employees WHERE department_id = 10;
- Characteristics:
- Can use WHERE clause to filter which rows to delete.
- Generates row-level locks.
- Deletes one row at a time, which can be slower for large tables.
- Can be rolled back if used within a transaction.
- Triggers, if defined, will be fired.
TRUNCATE:
- Purpose: Removes all rows from a table, resetting it to its empty state.
- Usage: Used when you need to quickly remove all data from a table.
- Syntax:
TRUNCATE TABLE table_name;
- Example:
TRUNCATE TABLE employees;
- Characteristics:
- Cannot use WHERE clause.
- Faster than DELETE as it deallocates the data pages instead of row-by-row deletion.
- Resets any AUTO_INCREMENT counters.
- Cannot be rolled back in some database systems as it is a DDL operation.
- Does not fire triggers.
DROP:
- Purpose: Removes an entire table or database from the database.
- Usage: Used when you need to completely remove a table or database structure.
- Syntax:
DROP TABLE table_name;
DROP DATABASE database_name;
- Example:
DROP TABLE employees;
- Characteristics:
- Permanently deletes the table or database and all its data.
- Cannot be rolled back; once dropped, the table or database is gone.
- All indexes and triggers associated with the table are also deleted.
- Removes table definition and data.
Tip: Use DELETE when you need to remove specific rows and want the option to roll back the transaction. Use TRUNCATE when you need to quickly clear all data from a table without deleting the table structure itself. Use DROP when you need to completely remove a table or database structure and all associated data permanently. Always ensure you have backups and understand the impact of these operations before executing them.Total Sales = SUM(Sales[SalesAmount])You can refer these Power BI Interview Resources to learn more Like this post if you want me to continue this Power BI series 👍♥️ Share with credits: https://t.me/sqlspecialist Hope it helps :)
Total Sales = SUM(Sales[SalesAmount])
- Conditional Logic: Sales Status = IF(Sales[SalesAmount] > 1000, "High", "Low")
- Time Intelligence: Sales YTD = TOTALYTD(SUM(Sales[SalesAmount]), 'Date'[Date])
Best Practices:
- Understand Context: Grasp the difference between row context and filter context to avoid common pitfalls.
- Use Variables: Use variables (VAR) to simplify and optimize complex DAX expressions.
- Test Incrementally: Break down complex DAX formulas into smaller parts and test incrementally for accuracy.
You can refer these Power BI Interview Resources to learn more
Like this post if you want me to continue this Power BI series 👍♥️
Share with credits: https://t.me/sqlspecialist
Hope it helps :)WITH cte_name (column1, column2, ...)
AS
(
SELECT statement
)
SELECT *
FROM cte_name;
Example:
Suppose you have a sales table and you want to calculate the total sales for each employee and then find the employees whose total sales exceed a certain amount.
WITH TotalSales AS (
SELECT employee_id, SUM(amount) AS total_sales
FROM sales
GROUP BY employee_id
)
SELECT employee_id, total_sales
FROM TotalSales
WHERE total_sales > 10000;
In this example:
1. The CTE TotalSales calculates the total sales for each employee.
2. The main query selects employees from TotalSales where the total sales exceed 10,000.
Advantages of CTEs:
1. Readability: CTEs make SQL queries easier to read and understand by breaking down complex queries into simpler, manageable parts.
2. Modularity: You can define multiple CTEs in a single query and reference them in subsequent CTEs or the main query.
3. Reusability: CTEs can be referenced multiple times within the same query, avoiding the need to repeat complex subqueries.
Recursive CTEs:
CTEs can also be recursive, which means they can refer to themselves. This is useful for hierarchical or tree-structured data.
Example of Recursive CTE:
Suppose you have an employees table with a manager_id column that references the employee_id of the employee's manager. You want to find all employees and their levels in the company hierarchy.
WITH RECURSIVE EmployeeHierarchy AS (
SELECT employee_id, employee_name, manager_id, 1 AS level
FROM employees
WHERE manager_id IS NULL
UNION ALL
SELECT e.employee_id, e.employee_name, e.manager_id, eh.level + 1
FROM employees e
JOIN EmployeeHierarchy eh ON e.manager_id = eh.employee_id
)
SELECT employee_id, employee_name, manager_id, level
FROM EmployeeHierarchy
ORDER BY level;
In this example:
1. The base query selects the top-level employees (those with no manager).
2. The recursive part joins the employees table with the EmployeeHierarchy CTE to find employees managed by those already in the hierarchy, incrementing the level each time.
Tip: CTEs are a powerful tool for writing clear and maintainable SQL code. Use them to simplify complex queries, especially when dealing with hierarchical data or when multiple references to the same subquery are needed.
You can refer these SQL Interview Resources to learn more
Like this post if you want me to continue this SQL series 👍♥️
Share with credits: https://t.me/sqlspecialist
Hope it helps :)SELECT column_name,
window_function() OVER (PARTITION BY column_name ORDER BY column_name)
FROM table_name;
Examples:
1. Using ROW_NUMBER():
Assign a unique number to each row within a partition of the result set.
SELECT employee_name, department_id, salary,
ROW_NUMBER() OVER (PARTITION BY department_id ORDER BY salary DESC) AS rank
FROM employees;
This query ranks employees within each department based on their salary in descending order.
2. Using AVG() with OVER():
Calculate the average salary within each department without collapsing the result set.
SELECT employee_name, department_id, salary,
AVG(salary) OVER (PARTITION BY department_id) AS avg_salary
FROM employees;
This query returns the average salary for each department along with each employee's salary.
3. Using LEAD():
Access the value of a subsequent row in the result set.
SELECT employee_name, department_id, salary,
LEAD(salary, 1) OVER (PARTITION BY department_id ORDER BY salary) AS next_salary
FROM employees;
This query retrieves the salary of the next employee within the same department based on the current sorting order.
4. Using RANK():
Assign a rank to each row within the partition, with gaps in the ranking values if there are ties.
SELECT employee_name, department_id, salary,
RANK() OVER (PARTITION BY department_id ORDER BY salary DESC) AS rank
FROM employees;
This query ranks employees within each department by their salary in descending order, leaving gaps for ties.
Tip: Window functions are powerful for performing calculations across a set of rows while retaining the individual rows. They are useful for running totals, moving averages, ranking, and accessing data from other rows within the same result set.
Go though SQL Learning Series to refresh your basics
Share with credits: https://t.me/sqlspecialist
Like this post if you want me to continue SQL Interview Preparation Series 👍❤️
Hope it helps :)
متاح الآن! بحث تيليغرام 2025 — أهم رؤى العام 
