Target SQL Interview Question | Using Sub-query | Level - MEDIUM

Pubblicato il: 02 settembre 2024
sul canale di: Nishtha Nagar
7,537
255

In this video, you would learn how to write a SQL query to identify sellers who did not make any sales in 2020.

Script

Table 1 - orders

CREATE TABLE orders (
order_id INT PRIMARY KEY,
sale_date DATE,
order_cost DECIMAL(10, 2),
customer_id INT,
seller_id INT
);

INSERT INTO orders (order_id, sale_date, order_cost, customer_id, seller_id) VALUES
(1, '2020-03-01', 1500.00, 101, 1),
(2, '2020-05-25', 2400.00, 102, 2),
(3, '2019-05-25', 800.00, 101, 3),
(4, '2020-09-13', 1000.00, 103, 2),
(5, '2019-02-11', 700.00, 101, 2);


Table 2- sellers

CREATE TABLE sellers (
seller_id INT PRIMARY KEY,
seller_name VARCHAR(100)
);

INSERT INTO sellers (seller_id, seller_name) VALUES
(1, 'Daniel'),
(2, 'Ben'),
(3, 'Frank');

TIMESTAMP
00:00 Introduction
00:21 Problem Description
02:15 Solution Methods
03:30 Implementation
03:45 Method 1 Implementation (Using Sub-query)
06:23 Method 2 Implementation (Using LEFT Join)

#sql #dataanalysts #dataengineer #dataanalysis #interviewquestion #sqlinterview


In questa pagina del sito puoi guardare il video online Target SQL Interview Question | Using Sub-query | Level - MEDIUM della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Nishtha Nagar 02 settembre 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 7,537 volte e gli è piaciuto 255 spettatori. Buona visione!