In this video we will discuss a SQL interview question asked in American Express Data Analyst Interview.
High Quality Analytics Courses : https://www.namastesql.com/
script:
CREATE TABLE friends (
user_id INT,
friend_id INT
);
-- Insert data into friends table
INSERT INTO friends VALUES
(1, 2),
(1, 3),
(1, 4),
(2, 1),
(3, 1),
(3, 4),
(4, 1),
(4, 3);
-- Create likes table
CREATE TABLE likes (
user_id INT,
page_id CHAR(1)
);
-- Insert data into likes table
INSERT INTO likes VALUES
(1, 'A'),
(1, 'B'),
(1, 'C'),
(2, 'A'),
(3, 'B'),
(3, 'C'),
(4, 'B');
Zero to hero(Advance) SQL Aggregation:
• All About SQL Aggregations | SQL Adva...
Most Asked Join Based Interview Question:
• Most Asked SQL JOIN based Interview Q...
Solving 4 Trick SQL problems:
• Solving 4 Tricky SQL Problems
Data Analyst Spotify Case Study:
• Data Analyst Spotify Case Study | SQL...
Top 10 SQL interview Questions:
• Top 10 SQL interview Questions and An...
Interview Question based on FULL OUTER JOIN:
• SQL Interview Question Based on Full ...
Playlist to master SQL :
• Complex SQL Questions for Interview P...
Rank, Dense_Rank and Row_Number:
• RANK, DENSE_RANK, ROW_NUMBER SQL Anal...
#sql #dataengineer