JP Morgan SQL Interview Question | Calculate capital gain/loss
Nishtha Nagar
0:00 / 0:00
JP Morgan SQL Interview Question | Calculate capital gain/loss
6 829 просмотров · 11 месяцев назад
Nishtha Nagar
11,2 тыс. подписчиков
6 829 просмотров · 11 месяцев назад
Script:
CREATE TABLE stocks (
id INT AUTO_INCREMENT PRIMARY KEY,
stock_name VARCHAR(50),
operation ENUM('Buy', 'Sell'),
operation_day INT,
price INT
);
INSERT INTO stocks (stock_name, operation, operation_day, price) VALUES
('Apple', 'Buy', 1, 1500),
('Tesla', 'Buy', 2, 1200),
('Apple', 'Sell', 5, 5000),
('Samsung', 'Buy', 17, 20000),
('Tesla', 'Sell', 3, 1300),
('Tesla', 'Buy', 4, 1500),
('Tesla', 'Sell', 5, 1100),
('Tesla', 'Buy', 6, 1400),
('Samsung', 'Sell', 29, 15000),
('Tesla', 'Sell', 10, 1200);
Find the solution queries here - https://drive.google.com/file/d/1IsZS...
Complete SQL in one shot for beginners - • SQL Tutorial for Beginners in 2.5 hours | ...
15+ SQL Interview Questions Asked by Top Companies - • 15+ SQL Questions Asked in Top Companies |...
#sql #sqlinterviewquestions #sqlforbeginners #dataanlysis #sqlinterview