SQL Interview Questions and answers Part 5 | Amazon SQL Interview Question And Answer Part-3
SQL / ORACLE Scenario Based Interview Questions Part 5 | Amazon SQL Interview Question And Answer Part-3 | SQL Scenario based Interview Question and Answer This question has been asked in Amazon interview for the role of Data Analyst Order_Tbl has four columns namely ORDER_DAY, ORDER_ID, PRODUCT_ID, QUANTITY and PRICE (a) Write a SQL to get all the products that got sold on both the days and the number of times the product is sold. (b) (b) Write a SQL to get products that was ordered on 02-May-2015 but not on 01-May-2015 ------------------------------------------------------------------------- ๐๐ผ๐ถ๐ป ๐บ๐ฒ ๐ผ๐ป ๐ฆ๐ผ๐ฐ๐ถ๐ฎ๐น ๐ ๐ฒ๐ฑ๐ถ๐ฎ:๐ฅ ------------------------------------------------------------------------- *Instagram : https://www.instagram.com/itjunction4all/ *Twitter: https://twitter.com/sunilkr5672 ------------------------------------------------------------------------- Table and Insert SQL Script : ------------------------------------------------------------------------- CREATE TABLE [Order_Tbl]( [ORDER_DAY] date, [ORDER_ID] varchar(10) , [PRODUCT_ID] varchar(10) , [QUANTITY] int , [PRICE] int ) INSERT INTO [Order_Tbl] VALUES ('2015-05-01','ODR1', 'PROD1', 5, 5) INSERT INTO [Order_Tbl] VALUES ('2015-05-01','ODR2', 'PROD2', 2, 10) INSERT INTO [Order_Tbl] VALUES ('2015-05-01','ODR3', 'PROD3', 10, 25) INSERT INTO [Order_Tbl] VALUES ('2015-05-01','ODR4', 'PROD1', 20, 5) INSERT INTO [Order_Tbl] VALUES ('2015-05-02','ODR5', 'PROD3', 5, 25) INSERT INTO [Order_Tbl] VALUES ('2015-05-02','ODR6', 'PROD4', 6, 20) INSERT INTO [Order_Tbl] VALUES ('2015-05-02','ODR7', 'PROD1', 2, 5) INSERT INTO [Order_Tbl] VALUES ('2015-05-02','ODR8', 'PROD5', 1, 50) INSERT INTO [Order_Tbl] VALUES ('2015-05-02','ODR9', 'PROD6', 2, 50) INSERT INTO [Order_Tbl] VALUES ('2015-05-02','ODR10','PROD2', 4, 10) #AmazonDataEngineer #AmazonSQLInterview #AmazonInterview #SQLInterviewQuestionsandanswers #sqlInterviewQuestions #sqlInterviewQuestionsForTesting #sql InterviewQuestionsQuery #sqlInterviewQuestionsOnJoins #ITJunction4All
Download
0 formatsNo download links available.