In this video we will solve a SQL interview question asked in Tredence Analytics . We will solve it using 3 methods.
High quality in depth Analytics courses : https://www.namastesql.com/
script:
CREATE TABLE cinema (
seat_id INT PRIMARY KEY,
free int
);
delete from cinema;
INSERT INTO cinema (seat_id, free) VALUES (1, 1);
INSERT INTO cinema (seat_id, free) VALUES (2, 0);
INSERT INTO cinema (seat_id, free) VALUES (3, 1);
INSERT INTO cinema (seat_id, free) VALUES (4, 1);
INSERT INTO cinema (seat_id, free) VALUES (5, 1);
INSERT INTO cinema (seat_id, free) VALUES (6, 0);
INSERT INTO cinema (seat_id, free) VALUES (7, 1);
INSERT INTO cinema (seat_id, free) VALUES (8, 1);
INSERT INTO cinema (seat_id, free) VALUES (9, 0);
INSERT INTO cinema (seat_id, free) VALUES (10, 1);
INSERT INTO cinema (seat_id, free) VALUES (11, 0);
INSERT INTO cinema (seat_id, free) VALUES (12, 1);
INSERT INTO cinema (seat_id, free) VALUES (13, 0);
INSERT INTO cinema (seat_id, free) VALUES (14, 1);
INSERT INTO cinema (seat_id, free) VALUES (15, 1);
INSERT INTO cinema (seat_id, free) VALUES (16, 0);
INSERT INTO cinema (seat_id, free) VALUES (17, 1);
INSERT INTO cinema (seat_id, free) VALUES (18, 1);
INSERT INTO cinema (seat_id, free) VALUES (19, 1);
INSERT INTO cinema (seat_id, free) VALUES (20, 1);
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