TCS SQL INTERVIEW QUESTION | Last 3 months average
Join this channel to get access to perks: https://www.youtube.com/channel/UCTcOXx-NtZswf_yoRZCw7NA/join Feedback: https://forms.gle/NQuCAy7p5a9wxW3LA DROP TABLE IF EXISTS CustomerPurchases; CREATE TABLE CustomerPurchases ( Name VARCHAR(100), PurchaseDate DATE, Amount DECIMAL(10, 2) ); -- Inserting data for John Smith (continuous purchases) INSERT INTO CustomerPurchases (Name, PurchaseDate, Amount) VALUES ('John Smith', '2024-05-01', 100), ('John Smith', '2024-06-01', 120), ('John Smith', '2024-07-01', 140), ('John Smith', '2024-08-01', 160), ('John Smith', '2024-09-01', 180); -- Inserting data for Alice Doe (continuous purchases) INSERT INTO CustomerPurchases (Name, PurchaseDate, Amount) VALUES ('Alice Doe', '2024-05-15', 200), ('Alice Doe', '2024-06-15', 220), ('Alice Doe', '2024-07-15', 240), ('Alice Doe', '2024-08-15', 260), ('Alice Doe', '2024-08-25', 360), ('Alice Doe', '2024-09-15', 280); -- Inserting data for Bob Brown (non-continuous purchases) INSERT INTO CustomerPurchases (Name, PurchaseDate, Amount) VALUES ('Bob Brown', '2024-05-20', 150), ('Bob Brown', '2024-07-20', 170), ('Bob Brown', '2024-09-20', 190), ('Bob Brown', '2024-10-20', 490) SELECT * FROM CustomerPurchases Playlists: SQL Interview Questions: https://www.youtube.com/playlist?list=PLNlYnu7poveKW915P7Yafz3mNqnIefh3e Recursive CTE: https://www.youtube.com/playlist?list=PLNlYnu7poveK0ySrsIgUihCCryXo-KQj6 PySpark Interview Questions: https://www.youtube.com/playlist?list=PLNlYnu7poveI0umHioVrs6yI6ruP2wy5M Power BI and DAX: https://www.youtube.com/playlist?list=PLNlYnu7poveIK-Fjk7j9xE_9k9tlWFnEE Data Modeling: https://www.youtube.com/playlist?list=PLNlYnu7poveKKEKmJBbvTfyazt6aUiGCw Generative AIs: https://www.youtube.com/playlist?list=PLNlYnu7poveJ6F2xspS7nOZqDV0-G-cmd Excel: https://www.youtube.com/playlist?list=PLNlYnu7poveKW8q_NFOOEew8xA44Y_4kt Cricket: https://www.youtube.com/playlist?list=PLNlYnu7poveJ7pXb00jftk5yoTtuoQjaY SQL ADVANCED AGGREGATIONS: https://www.youtube.com/playlist?list=PLNlYnu7poveJ0ei855_X_gy_ZEj_z4vz1 Follow me Linkedin: https://www.linkedin.com/in/data-sculptor-93a00b2a8 Instagram: https://www.instagram.com/datasculptor2895
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.