American Express SQL Interview Question | SQL Interview Preparation | Medium-Level

Опубликовано: 16 Март 2026
на канале: Nishtha Nagar
6,892
248

This video will help you calculate the average transaction amount per year for each client for the years 2018 to 2022.

Table: transactions
Script -

-- Create the table
CREATE TABLE transactions (
transaction_id INT PRIMARY KEY,
user_id INT NOT NULL,
transaction_date DATE NOT NULL,
transaction_amount DECIMAL(10, 2) NOT NULL
);

-- Insert the data into the table
INSERT INTO transactions (transaction_id, user_id, transaction_date, transaction_amount)
VALUES
(1, 269, '2018-08-15', 500),
(2, 478, '2018-11-25', 400),
(3, 269, '2019-01-05', 1000),
(4, 123, '2020-10-20', 600),
(5, 478, '2021-07-05', 700),
(6, 123, '2022-03-05', 900);

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