SQL Interview Questions Part 66 | TRICKY SQL Interview Question & Answer 🔥🔥
Problem Statement :- The relationship between the LIFT and LIFT_PASSENGERS Table is such that multiple passengers can attempt to enter the same lift, but the total weight of the passengers in a lift cannot exceed the lift's capacity.
Write an SQL query that produces a comma separated list of passengers who can be accommodated in each lift without exceeding the lift's capacity. The passengers in the list should be ordered by their weight in increasing order
-------------------------------------------------------------------------
𝗝𝗼𝗶𝗻 𝗺𝗲 𝗼𝗻 𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:🔥
-------------------------------------------------------------------------
*Instagram :
/ itjunction4all
*Twitter:
/ sunilkr5672
-------------------------------------------------------------------------
Table and Insert SQL Script :
-------------------------------------------------------------------------
Create Table Lift_Passengers(
Passenger_Name Varchar(20),
Weight_Kg int,
Lift_Id int)
Insert into Lift_Passengers Values('Mark',85,1)
Insert into Lift_Passengers Values('Antony',73,1)
Insert into Lift_Passengers Values('David',95,1)
Insert into Lift_Passengers Values('Mary',80,1)
Insert into Lift_Passengers Values('John',83,2)
Insert into Lift_Passengers Values('Robert',77,2)
Insert into Lift_Passengers Values('Maria',73,2)
Insert into Lift_Passengers Values('Susan',85,2)
Create Table Lift( Id int,
Capacity_Kg Bigint)
Insert into Lift Values(1,300)
Insert into Lift Values(2,350)
#SQL #trickysql #itjunction4all
On this page of the site you can watch the video online SQL Interview Questions Part 66 | Tricky SQL Interview Question & Answer 🔥🔥 with a duration of hours minute second in good quality, which was uploaded by the user ItJunction4all 08 June 2024, share the link with friends and acquaintances, this video has already been watched 1,426 times on youtube and it was liked by 36 viewers. Enjoy your viewing!