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

Pubblicato il: 08 giugno 2024
sul canale di: 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


In questa pagina del sito puoi guardare il video online SQL Interview Questions Part 66 | Tricky SQL Interview Question & Answer 🔥🔥 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato ItJunction4all 08 giugno 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,426 volte e gli è piaciuto 36 spettatori. Buona visione!