Last person to enter the elevator | SQL Interview question

 DML Script:

DROP TABLE IF EXISTS ElevatorOrder;

GO


CREATE TABLE  ElevatorOrder

(

LineOrder  INTEGER PRIMARY KEY,

[Name]     VARCHAR(100) NOT NULL,

[Weight]   INTEGER NOT NULL

);

GO


INSERT INTO ElevatorOrder ([Name], [Weight], LineOrder)

VALUES

('Haruto',611,1),('Minato',533,2),('Haruki',623,3),

('Sota',569,4),('Aoto',610,5),('Hinata',525,6);

GO


SELECT * FROM ElevatorOrder


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