Winning the Lottery | SQL Scenario Interview question

 DML Script:


 DROP TABLE IF EXISTS WinningNumbers


 CREATE TABLE WinningNumbers

 (

 [Num] int

 )


 INSERT INTO WinningNumbers VALUES 

 (25),(45),(78),(91)


 DROP TABLE IF EXISTS Tickets


 CREATE TABLE Tickets

 (

[TicketID] VARCHAR(max),

[Number] INT

 )


 INSERT INTO Tickets

 VALUES

 ('A',25),

 ('A',45),

 ('A',78),

 ('A',91),

 ('B',25),

 ('B',45),

 ('B',98),

 ('B',91),

 ('C',67),

 ('C',78),

 ('C',91) 


 SELECT * FROM WinningNumbers

 SELECT * FROM Tickets



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

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