EY INTERVIEW QUESTION | Categorize Salespersons by Sales Amount in SQL

 -- Drop the table if it already exists

DROP TABLE IF EXISTS sales;


-- Create the sales table

CREATE TABLE sales (

    salesperson VARCHAR(50),

    amount INT

);


-- Insert data into the sales table

INSERT INTO sales (salesperson, amount) VALUES

('Alice', 200),

('Alice', 300),

('Alice', 400),

('Alice', 500),

('Alice', 600),

('Bob', 150),

('Bob', 250),

('Bob', 350),

('Bob', 450),

('Bob', 550);



Select * from sales

Comments

Popular posts from this blog

50 Essential SQL Questions to Land Your Dream Job

How to find all the customers who placed orders on three consecutive days | SQL Scenario questions

ACCENTURE SQL INTERVIEW QUESTION | Change the ProductIDs