Write a query to group employees by age ranges (e.g., 20–30, 31–40) and count the number of employees in each group.

SQL Interview Question: Write a query to group employees by age ranges (e.g., 20–30, 31–40) and count the number of employees in each group.

This question was asked in Interview at black rock. read more Company: BlackRock CTC: 26LPA SQL Interview Question Question Q. Write a query to group employees by age ranges (e.g., 20–30, 31–40) and count the number of employees in each group. Solution age-range num_employee 21-30 7 31-40 6 41-50 5 51-60 2 View on DB … Read more

Running Total for Different Genders: Write an SQL query to find the total score for each gender at each day

This question was asked in Facebook interview, Ask is to provide Running Total for Different Genders. Source: LeetCode Difficulty: Medium Company: Facebook Running Total for Different Genders Q. Write an SQL query to find the total score for each gender at each day. Order the result table by gender and day. Solution Explanation The solution … Read more

SQL LAG function explained!!

Understanding the SQL LAG Function (With Examples) SQL LAG function is a powerful tool that enables you to access data from the previous row, which is related to the current row as well. It’s incredibly useful for trend analysis. For example, if you are tracking how much a stock price has changed from the previous … Read more

Page Recommendations: Write an SQL query to recommend pages to the user

This question was asked in Facebook interview, Ask is to give page recommendation for user1 based on Friendship and Likes. Source: LeetCode Difficulty: Medium Company: Facebook Page Recommendations Q. Write an SQL query to recommend pages to the user with user_id = 1 using the pages that your friends liked. It should not recommend pages you already liked. … Read more

Exit mobile version