
- Main
- Catalog
- Job Listings
- Data Analyst Interview
Data Analyst Interview
Engaging and active audience in the channel interested in jobs & interview tips.
Channel statistics
WHERE filters rows before grouping (used with SELECT, UPDATE).
⦁ HAVING filters groups after aggregation (used with GROUP BY), e.g., filtering aggregated results like sums or counts.
5. Write a SQL query to find the second highest salary in a table.
Using a subquery:
SELECT MAX(salary) FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);{}
Or using DENSE_RANK():
SELECT salary FROM (
SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) as rnk
FROM employees) t
WHERE rnk = 2;{}
6. What is a JOIN? Explain different types of JOINs.
A JOIN combines rows from two or more tables based on a related column:
⦁ INNER JOIN: returns matching rows from both tables.
⦁ LEFT JOIN (LEFT OUTER JOIN): all rows from the left table, matched rows from right.
⦁ RIGHT JOIN (RIGHT OUTER JOIN): all rows from right table, matched rows from left.
⦁ FULL JOIN (FULL OUTER JOIN): all rows when there’s a match in either table.
⦁ CROSS JOIN: Cartesian product of both tables.
7. How do you optimize slow-performing SQL queries?
⦁ Use indexes appropriately to speed up lookups.
⦁ Avoid SELECT *; only select necessary columns.
⦁ Use joins carefully; filter early with WHERE clauses.
⦁ Analyze execution plans to identify bottlenecks.
⦁ Avoid unnecessary subqueries; use EXISTS or JOINs.
⦁ Limit result sets with pagination if dealing with large datasets.
8. What is a primary key? What is a foreign key?
⦁ Primary Key: A unique identifier for records in a table; it cannot be NULL.
⦁ Foreign Key: A field that creates a link between two tables by referring to the primary key in another table, enforcing referential integrity.
9. What are indexes? Explain clustered and non-clustered indexes.
⦁ Indexes speed up data retrieval by providing quick lookups.
⦁ Clustered Index: Sorts and stores the actual data rows in the table based on the key; a table can have only one clustered index.
⦁ Non-Clustered Index: Creates a separate structure that points to the data rows; tables can have multiple non-clustered indexes.
10. Write a SQL query to fetch the top 5 records from a table.
In SQL Server and PostgreSQL:
SELECT * FROM table_name
ORDER BY some_column DESC
LIMIT 5; {}
In SQL Server (older syntax):
SELECT TOP 5 * FROM table_name
ORDER BY some_column DESC; {}
React ♥️ for Part 2Reviews channel
8 total reviews
- Added: Newest first
- Added: Oldest first
- Rating: High to low
- Rating: Low to high
Catalog of Telegram Channels for Native Placements
Data Analyst Interview is a Telegram channel in the category «Работа и вакансии», offering effective formats for placing advertising posts on TG. The channel has 51.8K subscribers and provides quality content. The advertising posts on the channel help brands attract audience attention and increase reach. The channel's rating is 17.7, with 8 reviews and an average score of 5.0.
You can launch an advertising campaign through the Telega.in service, choosing a convenient format for placement. The Platform provides transparent cooperation conditions and offers detailed analytics. The placement cost is 30.0 ₽, and with 17 completed requests, the channel has established itself as a reliable partner for advertising on Telegram. Place integrations today and attract new clients!
You will be able to add channels from the catalog to the cart again.
Комментарий