Back to Browse

Zomato SQL Interview Question | Using CTEs | Advanced SQL

35.8K views
Aug 28, 2024
14:36

In this video, we'll solve an advanced SQL challenge: correcting a swapping error in Zomato's order database. Imagine each order's item has been mistakenly swapped with the next—our task is to use Common Table Expressions (CTEs) to realign the order IDs with the correct items. Follow along as we solve this problem step-by-step and ensure data integrity. Script -- CREATE TABLE orders ( order_id INT PRIMARY KEY, item VARCHAR(255) NOT NULL ); INSERT INTO orders (order_id, item) VALUES (1, 'Chow Mein'), (2, 'Pizza'), (3, 'Veg Nuggets'), (4, 'Paneer Butter Masala'), (5, 'Spring Rolls'), (6, 'Veg Burger'), (7, 'Paneer Tikka'); TIMESTAMP 00:00 Introduction 00:15 Problem Description and Solution Approach 04:16 Solution Implementation #sql #dataanalysts #dataengineer #dataanalysis #interviewquestion

Download

1 formats

Video Formats

360pmp417.4 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Zomato SQL Interview Question | Using CTEs | Advanced SQL | NatokHD