SQL Natural Join

SQL Natural Join

What is SQL Natural Join? Natual Join is a type of join in SQL which combines row from 2 tables based on common column which has same name and datatype. It automatically matches the 2 columns and eliminates the duplicate column. read more Example Database CustomerID FirstName LastName Email City 1 John Doe [email protected] New … Read more

Display the cumulative percentage of total sales for each product.

Display the cumulative percentage of total sales for each product.

This question was asked in Interview at black rock. Read more Company: BlackRock CTC: 26LPA Source: LinkedIn SQL Interview Question Q. Display the cumulative percentage of total sales for each product. sale_id product_id sales 1 101 500.00 2 102 300.00 3 103 200.00 4 101 400.00 5 102 600.00 6 103 800.00 7 104 1000.00 … Read more

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

Running Total for Different Genders

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