Get the total and approved transactions details | SQL Scenario interview question |Leetcode Medium

 DML Script:

DROP TABLE IF EXISTS Transactions;

CREATE TABLE Transactions

(

id int,

country varchar(100),

[status] varchar(100),

amount int,

trans_date datetime

)


INSERT INTO Transactions VALUES

(1,'India' ,'Approved',1000,'04-08-2024'),

(2,'Pakistan' ,'Approved',2000,'03-08-2024'),

(3,'Australia' ,'Declined',3000,'01-08-2024'),

(10,'Australia' ,'Declined',5000,'01-28-2024'),

(4,'USA' ,'Approved',1400,'04-13-2024'),

(5,'India' ,'Declined',1500,'09-28-2024'),

(6,'USA' ,'Approved',1070,'01-17-2024'),

(7,'India' ,'Approved',5000,'04-26-2024'),

(8,'UK' ,'Declined',2500,'04-28-2023')


SELECT * FROM Transactions


Detailed Explanation: https://www.youtube.com/watch?v=x1apIG0MKDE

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