SQL Interview Questions Part 66 | Tricky SQL Interview Question & Answer 🔥🔥

Publié le: 08 juin 2024
sur la chaîne: ItJunction4all
1,426
36

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


Sur cette page du site, vous pouvez voir la vidéo en ligne SQL Interview Questions Part 66 | Tricky SQL Interview Question & Answer 🔥🔥 durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur ItJunction4all 08 juin 2024, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,426 fois et il a aimé 36 téléspectateurs. Bon visionnage!