FAANG SQL Interview Questions
FAAND SQL Complex Interview Questions: Write a query to find the top 5 countries with the highest number of active users on a social media platform. SELECT country, COUNT(DISTINCT user_id)…
SQL Complex Interview Questions, Realtime SQL interview questions for java developers, SQL Interview queries, FAANG SQL Interview complex queries,
FAAND SQL Complex Interview Questions: Write a query to find the top 5 countries with the highest number of active users on a social media platform. SELECT country, COUNT(DISTINCT user_id)…
Write a query to find the top 10 most popular apps in the App Store based on the number of downloads. SELECT app_name, SUM(downloads) AS total_downloads FROM app_downloads GROUP BY…
Write a query to find the number of unique viewers for each movie. SELECT movie_id, COUNT(DISTINCT user_id) AS num_unique_viewers FROM view_history GROUP BY movie_id; Write a query to find the…
Write a query to find the top 10 users with the highest number of friends. SELECT user_id, COUNT(*) AS num_friends FROM user_friends GROUP BY user_id ORDER BY num_friends DESC LIMIT…
Write a query to find the average time taken to ship orders in each region. SELECT region, AVG(DATEDIFF(shipped_date, order_date)) AS avg_time_to_ship FROM orders GROUP BY region; Write a query to…
Write a query to find the top 10 most frequent words in a table of text data. SELECT word, COUNT(*) AS frequency FROM ( SELECT regexp_split_to_table(text_column, '\s+') AS word FROM…
What is the difference between a view and a materialized view? A view is a virtual table that is based on the results of a query, while a materialized view…
What is SQL and what is it used for? SQL (Structured Query Language) is a programming language used to manage and manipulate relational databases. It is used to create, modify,…
Write a query to find the second-highest salary in a table. SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees); Write a query to find the names of…