llamaTrainSQL / llamaTrain.json
wasoncesimple's picture
Upload llamaTrain.json
11db163 verified
[
{
"instruction": "The database contains a 'transactionalplms.trip' table with columns like 'id', 'status', 'gateOut', and 'vehicleNumber'. The task is to retrieve the latest trip information for a vehicle number. Limit the results to the most recent trip.",
"input": "Where is vehicle JH11AG0663?",
"output": "SELECT id AS trip_id, dinumber,status, gateOut FROM transactionalplms.trip WHERE vehicleNumber = 'JH11AG0663' ORDER BY gateOut DESC LIMIT 1;"
},
{
"instruction": "The 'transactionalplms.trip' table has a 'mapPlantStageLocation' column that tracks where vehicles are in the plant. The task is to count vehicles that are in the 'YARD-IN' stage, indicating they are at the plant.",
"input": "How many vehicles are currently at our plant?",
"output": "SELECT COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE mapPlantStageLocation = 'YARD-IN';"
},
{
"instruction": "The 'transactionalplms.trip' table contains a 'packingOut' column that indicates the timestamp when a vehicle completes tareweight. The task is to retrieve the latest tareweight completion time for a vehicle.",
"input": "When did vehicle JH11AG0663 complete tareweight?",
"output": "SELECT packingOut FROM transactionalplms.trip WHERE vehicleNumber = 'JH11AG0663' ORDER BY packingOut DESC LIMIT 1;"
},
{
"instruction": "The 'transactionalplms.trip' table contains a 'driverId' column that tracks the driver assigned to a vehicle. The task is to retrieve the driver ID for the latest trip of the vehicle.",
"input": "Who is the assigned driver for vehicle JH09AR8268?",
"output": "SELECT driverId FROM transactionalplms.trip WHERE vehicleNumber = 'JH09AR8268' ORDER BY gateIn DESC LIMIT 1;"
},
{
"instruction": "The 'transactionalplms.trip' table has a 'gateIn' column that records the time a vehicle enters the plant. The task is to retrieve the gate-in time for the given vehicle number.",
"input": "When did vehicle UP32AA1010 enter the plant?",
"output": "SELECT gateIn FROM transactionalplms.trip WHERE vehicleNumber = 'UP32AA1010' ORDER BY gateIn DESC LIMIT 1;"
},
{
"instruction": "The 'transactionalplms.trip' table contains a 'materialType_code' column that tracks the type of goods loaded in a vehicle. The task is to retrieve the material type for the latest trip of the vehicle.",
"input": "What goods are loaded in vehicle JH09AR8268?",
"output": "SELECT materialType_code FROM transactionalplms.trip WHERE vehicleNumber = 'JH09AR8268' ORDER BY gateIn DESC LIMIT 1;"
},
{
"instruction": "The 'transactionalplms.trip' table has a 'gateOut' column that records the time a vehicle leaves the plant. The task is to retrieve the gate-out time for the last vehicle that unloaded at the plant, filtered by the 'GATE-OUT' location.",
"input": "When did the last vehicle unload at the plant?",
"output": "SELECT gateOut FROM transactionalplms.trip WHERE mapPlantStageLocation = 'GATE-OUT' ORDER BY gateOut DESC LIMIT 1;"
},
{
"instruction": "The 'transactionalplms.trip' table has an 'id' column, which is the trip ID. The task is to retrieve the trip ID for the latest trip of the given vehicle.",
"input": "What is the trip ID for vehicle JH09AR8268?",
"output": "SELECT tripId FROM transactionalplms.trip WHERE vehicleNumber = 'JH09AR8268' ORDER BY gateIn DESC LIMIT 1;"
},
{
"instruction": "The 'transactionalplms.trip' table contains an 'id' column for the trip ID, a 'status' column indicating the trip status, and a 'gateOut' column recording when the trip is completed. The task is to check if a trip is completed by verifying the status and whether the 'gateOut' field is populated.",
"input": "Is trip TRIP9876 completed?",
"output": "SELECT gateOut FROM transactionalplms.trip WHERE id = '20240418175619192' AND status = 'C' LIMIT 1;"
},
{
"instruction": "The 'transactionalplms.trip' table contains a 'packingIn' column, which records when a vehicle started loading or unloading. The task is to retrieve the start time of packing for a given vehicle number.",
"input": "When did vehicle JH11AG0663 start packing?",
"output": "SELECT packingIn FROM transactionalplms.trip WHERE vehicleNumber = 'JH11AG0663' ORDER BY packingIn DESC LIMIT 1;"
},
{
"instruction": "The 'transactionalplms.trip' table contains a 'mapPlantStageLocation' column that tracks the current stage of the vehicle in the plant. The task is to retrieve the current location of the given vehicle number.",
"input": "Where is vehicle JH11AG0663?",
"output": "SELECT mapPlantStageLocation FROM transactionalplms.trip WHERE vehicleNumber = 'JH11AG0663' ORDER BY gateIn DESC LIMIT 1;"
},
{
"instruction": "The 'transactionalplms.trip' table contains a 'gateIn' and 'gateOut' column. The task is to retrieve both the entry and exit times for a specific vehicle.",
"input": "When did vehicle JH09AR8268 enter and exit the plant?",
"output": "SELECT gateIn, gateOut FROM transactionalplms.trip WHERE vehicleNumber = 'UP32AA1010' ORDER BY gateIn DESC LIMIT 1;"
},
{
"instruction": "The task is to check if vehicle JH10CS206 has completed the 'YARD-IN' process, which is tracked in the 'mapPlantStageLocation' column.",
"input": "Has vehicle JH10CS206 completed the Yard-In process?",
"output": "SELECT mapPlantStageLocation FROM transactionalplms.trip WHERE vehicleNumber = 'JH10CS206' AND mapPlantStageLocation = 'YARD-IN' LIMIT 1;"
},
{
"instruction": "The task is to count the number of trips created today.",
"input": "How many trips are being made today?",
"output": "SELECT COUNT(*) AS trip_count FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE;"
},
{
"instruction": "The task is to retrieve the current stage for the vehicle with number JH10CS206.",
"input": "In which stage is vehicle number JH10CS206?",
"output": "SELECT mapPlantStageLocation FROM transactionalplms.trip WHERE vehicleNumber = 'JH10CS206' ORDER BY gateIn DESC LIMIT 1;"
},
{
"instruction": "The task is to retrieve the tareweight time for vehicle MH34BG1275.",
"input": "TareWeight time for this vehicle MH34BG1275?",
"output": "SELECT packingOut FROM transactionalplms.trip WHERE vehicleNumber = 'MH34BG1275' ORDER BY packingOut DESC LIMIT 1;"
},
{
"instruction": "The task is to calculate the time difference between entry and exit for vehicle TS01UC241.",
"input": "How much time did TS01UC241 take from Entry to Exit?",
"output": "SELECT TIMESTAMPDIFF(MINUTE, gateIn, gateOut) AS time_taken FROM transactionalplms.trip WHERE vehicleNumber = 'TS01UC241' ORDER BY gateIn DESC LIMIT 1;"
},
{
"instruction": "The task is to count the stages completed by vehicle UP53ET7162.",
"input": "How many stages are completed by UP53ET7162?",
"output": "SELECT COUNT(DISTINCT mapPlantStageLocation) AS stages_completed FROM transactionalplms.trip WHERE vehicleNumber = 'UP53ET7162';"
},
{
"instruction": "The task is to retrieve the material description for material code 'COMP'.",
"input": "Tell me which material has this code COMP?",
"output": "SELECT description FROM transactionalplms.material WHERE code = 'COMP';"
},
{
"instruction": "The task is to retrieve the material type for the latest trip of vehicle JH02P2241.",
"input": "What material type is this vehicle number carrying JH02P2241?",
"output": "SELECT materialType_code FROM transactionalplms.trip WHERE vehicleNumber = 'JH02P2241' ORDER BY gateIn DESC LIMIT 1;"
},
{
"instruction": "The task is to count the number of vehicles currently at the N205 stage.",
"input": "How many vehicles are currently at N205?",
"output": "SELECT COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE mapPlantStageLocation = 'N205';"
},
{
"instruction": "The task is to count vehicles currently in the 'GATE-OUT' stage.",
"input": "How many vehicles are in the gate out stage?",
"output": "SELECT COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE mapPlantStageLocation = 'GATE-OUT';"
},
{
"instruction": "The task is to calculate the average time vehicles spend in the 'YARD-IN' stage.",
"input": "How much time on average does a vehicle take in Yard-IN?",
"output": "SELECT AVG(TIMESTAMPDIFF(MINUTE, yardIn, yardOut)) AS avg_time FROM transactionalplms.trip WHERE mapPlantStageLocation = 'YARD-IN';"
},
{
"instruction": "The task is to retrieve the tareweight time and date for vehicles JH10CD0283 and MH33T4122.",
"input": "Tareweight time and date of JH10CD0283, MH33T4122?",
"output": "SELECT vehicleNumber, packingOut FROM transactionalplms.trip WHERE vehicleNumber IN ('JH10CD0283', 'MH33T4122') ORDER BY packingOut DESC;"
},
{
"instruction": "The task is to count the number of vehicles aborted today.",
"input": "How many vehicles have been aborted today?",
"output": "SELECT COUNT(*) AS aborted_count FROM transactionalplms.trip WHERE status = 'A' AND DATE(gateIn) = CURRENT_DATE;"
},
{
"instruction": "The task is to find the vehicle number associated with a specific trip ID.",
"input": "I am not able to find the vehicle number related to this 2024042514482296?",
"output": "SELECT vehicleNumber FROM transactionalplms.trip WHERE id = '2024042514482296';"
},
{
"instruction": "The task is to count stages completed by vehicle MH02ER9382.",
"input": "How many stages has been covered by this MH02ER9382?",
"output": "SELECT COUNT(DISTINCT mapPlantStageLocation) AS stages_covered FROM transactionalplms.trip WHERE vehicleNumber = 'MH02ER9382';"
},
{
"instruction": "The task is to find the sequence number for vehicle jh10cr1855.",
"input": "In which sequence number is this vehicle jh10cr1855?",
"output": "SELECT sequence_number FROM transactionalplms.trip WHERE vehicleNumber = 'jh10cr1855' ORDER BY gateIn DESC LIMIT 1;"
},
{
"instruction": "The task is to calculate the average time a vehicle takes between Packing IN and Packing Out.",
"input": "On average, how much time does a vehicle take between Packing IN and Packing Out?",
"output": "SELECT AVG(TIMESTAMPDIFF(MINUTE, packingIn, packingOut)) AS avg_packing_time FROM transactionalplms.trip WHERE packingIn IS NOT NULL AND packingOut IS NOT NULL;"
},
{
"instruction": "The task is to count trips with 'S' creation type and 'C' status.",
"input": "How many vehicles have trip creation S with C status?",
"output": "SELECT COUNT(*) AS trip_count FROM transactionalplms.trip WHERE creationType = 'S' AND status = 'C';"
},
{
"instruction": "The task is to count trips with no issues.",
"input": "How many trips have been done by vehicles without any issues?",
"output": "SELECT COUNT(*) AS trip_count FROM transactionalplms.trip WHERE status = 'C';"
},
{
"instruction": "The task is to count vehicles with the 'PSC' material type today.",
"input": "How many vehicles have this material PSC today?",
"output": "SELECT COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE materialType_code = 'PSC' AND DATE(gateIn) = CURRENT_DATE;"
},
{
"instruction": "The task is to find the trip ID associated with a given serial number.",
"input": "Which trip is associated with Serial number 559?",
"output": "SELECT id FROM transactionalplms.trip WHERE serial_number = '559';"
},
{
"instruction": "The task is to count vehicles associated with the company IN20.",
"input": "How many vehicles are associated with this company IN20 and provide count too?",
"output": "SELECT COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE company_code = 'IN20';"
},
{
"instruction": "The task is to count vehicles handling both COMP and PPC materials.",
"input": "How many vehicles are handling COMP and PPC?",
"output": "SELECT COUNT(DISTINCT vehicleNumber) AS vehicle_count FROM transactionalplms.trip WHERE materialType_code IN ('COMP', 'PPC');"
},
{
"instruction": "The task is to find the vehicle that took the maximum time from entry to exit today.",
"input": "Which vehicle took the maximum time from entry to exit today?",
"output": "SELECT vehicleNumber, TIMESTAMPDIFF(MINUTE, gateIn, gateOut) AS time_taken FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE ORDER BY time_taken DESC LIMIT 1;"
},
{
"instruction": "The task is to find the vehicle details and stage count for vehicle ID 1005.",
"input": "Which vehicle is with this ID 1005 and how many stages are being done by this vehicle?",
"output": "SELECT vehicleNumber, COUNT(DISTINCT mapPlantStageLocation) AS stages_completed FROM transactionalplms.trip WHERE id = '1005';"
},
{
"instruction": "The task is to find the current location of vehicle MH04DS5386.",
"input": "Where is this MH04DS5386 right now?",
"output": "SELECT mapPlantStageLocation FROM transactionalplms.trip WHERE vehicleNumber = 'MH04DS5386' ORDER BY gateIn DESC LIMIT 1;"
},
{
"instruction": "The task is to find the vehicle with the minimum time to complete stages today.",
"input": "Which vehicle has the minimum time to complete the stages today?",
"output": "SELECT vehicleNumber, TIMESTAMPDIFF(MINUTE, gateIn, gateOut) AS time_taken FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE AND gateOut IS NOT NULL ORDER BY time_taken ASC LIMIT 1;"
},
{
"instruction": "The task is to count the goods being handled by company IN10.",
"input": "How many goods are being handled by IN10?",
"output": "SELECT COUNT(*) AS goods_count FROM transactionalplms.trip WHERE company_code = 'IN10';"
},
{
"instruction": "The task is to count the number of vehicles present in the plant until 3 PM today.",
"input": "How many vehicles were there till 3pm?",
"output": "SELECT COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE AND TIME(gateIn) <= '15:00:00';"
},
{
"instruction": "The task is to find the vehicle with the maximum time to complete stages today.",
"input": "Which vehicle has the maximum time to complete the stages today?",
"output": "SELECT vehicleNumber, TIMESTAMPDIFF(MINUTE, gateIn, gateOut) AS time_taken FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE ORDER BY time_taken DESC LIMIT 1;"
},
{
"instruction": "The task is to count the total number of vehicles in each stage right now.",
"input": "Can you show me the total count of vehicles in each stage right now?",
"output": "SELECT mapPlantStageLocation, COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE GROUP BY mapPlantStageLocation;"
},
{
"instruction": "The task is to count the number of vehicles currently in the Packing-Out stage.",
"input": "How many vehicles are currently in the Packing-Out stage?",
"output": "SELECT COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE mapPlantStageLocation = 'Packing-Out';"
},
{
"instruction": "The task is to count the number of vehicles currently between Yard-Out and Gate-Out.",
"input": "How many vehicles are currently in between Yard-Out and Gate-Out right now?",
"output": "SELECT COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE mapPlantStageLocation IN ('Yard-Out', 'Gate-Out');"
},
{
"instruction": "The task is to count the number of vehicles with status 'C'.",
"input": "How many vehicles got status C?",
"output": "SELECT COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE status = 'C';"
},
{
"instruction": "The task is to count the stages completed by vehicle ID 764.",
"input": "How many stages are being completed by this ID 764?",
"output": "SELECT COUNT(DISTINCT mapPlantStageLocation) AS stages_completed FROM transactionalplms.trip WHERE id = '764';"
},
{
"instruction": "The task is to count the number of vehicles that completed the Packing-In stage.",
"input": "How many vehicles completed the packing-in stage?",
"output": "SELECT COUNT(*) AS completed_count FROM transactionalplms.trip WHERE mapPlantStageLocation = 'Packing-In' AND packingIn IS NOT NULL;"
},
{
"instruction": "The task is to find when vehicle MH40CD7766 completed the Yard-IN stage.",
"input": "When did vehicle MH40CD7766 complete the YardIN?",
"output": "SELECT yardIn FROM transactionalplms.trip WHERE vehicleNumber = 'MH40CD7766' ORDER BY yardIn DESC LIMIT 1;"
},
{
"instruction": "The task is to count the number of vehicles that exited the plant today.",
"input": "How many vehicles have exited the plant today?",
"output": "SELECT COUNT(*) AS exited_count FROM transactionalplms.trip WHERE DATE(gateOut) = CURRENT_DATE;"
},
{
"instruction": "The task is to count the number of vehicles currently active within the plant.",
"input": "What is the total number of vehicles currently active within the plant?",
"output": "SELECT COUNT(*) AS active_vehicle_count FROM transactionalplms.trip WHERE gateOut IS NULL;"
},
{
"instruction": "The task is to find the first vehicle that entered the plant today.",
"input": "Which vehicle entered the plant first today?",
"output": "SELECT vehicleNumber FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE ORDER BY gateIn ASC LIMIT 1;"
},
{
"instruction": "The task is to count the number of vehicles in the process of loading material type 'COMP'.",
"input": "How many vehicles are in the process of being loaded with material type COMP?",
"output": "SELECT COUNT(*) AS loading_count FROM transactionalplms.trip WHERE materialType_code = 'COMP' AND mapPlantStageLocation = 'Loading';"
},
{
"instruction": "The task is to check if vehicle BR23A2793 has completed the Gate-Out stage.",
"input": "Has vehicle BR23A2793 successfully completed the Gate-Out stage?",
"output": "SELECT gateOut FROM transactionalplms.trip WHERE vehicleNumber = 'BR23A2793' AND gateOut IS NOT NULL LIMIT 1;"
},
{
"instruction": "The task is to count the vehicles present last week.",
"input": "How many vehicles were there last week?",
"output": "SELECT COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE WEEK(gateIn) = WEEK(CURRENT_DATE) - 1;"
},
{
"instruction": "The task is to find the date with the maximum number of vehicles in the plant.",
"input": "On which date were the maximum number of vehicles present in the plant?",
"output": "SELECT DATE(gateIn) AS date, COUNT(*) AS vehicle_count FROM transactionalplms.trip GROUP BY DATE(gateIn) ORDER BY vehicle_count DESC LIMIT 1;"
},
{
"instruction": "The task is to find the number of trips created for vehicles with a specific company code today.",
"input": "How many trips have been created today for company code IN20?",
"output": "SELECT COUNT(*) AS trip_count FROM transactionalplms.trip WHERE company_code = 'IN20' AND DATE(gateIn) = CURRENT_DATE;"
},
{
"instruction": "The task is to identify vehicles that have both Yard-IN and Yard-Out stages completed today.",
"input": "Which vehicles have completed both Yard-IN and Yard-Out today?",
"output": "SELECT DISTINCT vehicleNumber FROM transactionalplms.trip WHERE DATE(yardIn) = CURRENT_DATE AND DATE(yardOut) = CURRENT_DATE;"
},
{
"instruction": "The task is to find the average number of stages completed by vehicles today.",
"input": "What is the average number of stages completed by vehicles today?",
"output": "SELECT AVG(stage_count) AS avg_stages FROM (SELECT vehicleNumber, COUNT(DISTINCT mapPlantStageLocation) AS stage_count FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE GROUP BY vehicleNumber) AS stage_data;"
},
{
"instruction": "The task is to find the vehicles with more than 3 distinct stages completed today.",
"input": "Which vehicles completed more than 3 stages today?",
"output": "SELECT vehicleNumber FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE GROUP BY vehicleNumber HAVING COUNT(DISTINCT mapPlantStageLocation) > 3;"
},
{
"instruction": "The task is to retrieve the vehicle numbers of those that have completed packing today but not exited the plant.",
"input": "Which vehicles completed packing but are still in the plant today?",
"output": "SELECT vehicleNumber FROM transactionalplms.trip WHERE DATE(packingOut) = CURRENT_DATE AND gateOut IS NULL;"
},
{
"instruction": "The task is to identify vehicles that entered the plant before 9 AM today.",
"input": "Which vehicles entered the plant before 9 AM today?",
"output": "SELECT vehicleNumber FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE AND TIME(gateIn) < '09:00:00';"
},
{
"instruction": "The task is to count vehicles that have aborted their trips today.",
"input": "How many vehicles aborted their trips today?",
"output": "SELECT COUNT(*) AS aborted_count FROM transactionalplms.trip WHERE status = 'A' AND DATE(gateIn) = CURRENT_DATE;"
},
{
"instruction": "The task is to retrieve the vehicle numbers with the longest stay in the Yard-IN stage today.",
"input": "Which vehicles have spent the longest time in the Yard-IN stage today?",
"output": "SELECT vehicleNumber, TIMESTAMPDIFF(MINUTE, yardIn, yardOut) AS time_in_yard FROM transactionalplms.trip WHERE DATE(yardIn) = CURRENT_DATE ORDER BY time_in_yard DESC LIMIT 1;"
},
{
"instruction": "The task is to find the total number of trips completed by vehicles with material type 'CEMENT'.",
"input": "How many trips have vehicles carrying material type 'CEMENT' completed?",
"output": "SELECT COUNT(*) AS trip_count FROM transactionalplms.trip WHERE materialType_code = 'CEMENT' AND status = 'C';"
},
{
"instruction": "The task is to calculate the percentage of vehicles currently active in the plant.",
"input": "What percentage of vehicles are currently active in the plant?",
"output": "SELECT (COUNT(*) * 100 / (SELECT COUNT(*) FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE)) AS active_percentage FROM transactionalplms.trip WHERE gateOut IS NULL AND DATE(gateIn) = CURRENT_DATE;"
},
{
"instruction": "The task is to list vehicle numbers and their total number of trips this month.",
"input": "How many trips has each vehicle made this month?",
"output": "SELECT vehicleNumber, COUNT(*) AS trip_count FROM transactionalplms.trip WHERE MONTH(gateIn) = MONTH(CURRENT_DATE) AND YEAR(gateIn) = YEAR(CURRENT_DATE) GROUP BY vehicleNumber;"
},
{
"instruction": "The task is to find the vehicles with material type 'PPC' that have not exited the plant.",
"input": "Which vehicles carrying material type 'PPC' have not exited the plant?",
"output": "SELECT vehicleNumber FROM transactionalplms.trip WHERE materialType_code = 'PPC' AND gateOut IS NULL;"
},
{
"instruction": "The task is to find the vehicle with the highest number of trips recorded in the database.",
"input": "Which vehicle has the highest number of trips recorded?",
"output": "SELECT vehicleNumber, COUNT(*) AS trip_count FROM transactionalplms.trip GROUP BY vehicleNumber ORDER BY trip_count DESC LIMIT 1;"
},
{
"instruction": "The task is to retrieve vehicles with more than one trip created today.",
"input": "Which vehicles have more than one trip created today?",
"output": "SELECT vehicleNumber FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE GROUP BY vehicleNumber HAVING COUNT(*) > 1;"
},
{
"instruction": "The task is to calculate the total number of vehicles that completed Yard-Out but have not yet reached Gate-Out today.",
"input": "How many vehicles completed Yard-Out but are yet to complete Gate-Out today?",
"output": "SELECT COUNT(*) AS vehicle_count FROM transactionalplms.trip WHERE DATE(yardOut) = CURRENT_DATE AND gateOut IS NULL;"
},
{
"instruction": "The task is to find the vehicle with the earliest gate-out time today.",
"input": "Which vehicle exited the plant first today?",
"output": "SELECT vehicleNumber FROM transactionalplms.trip WHERE DATE(gateOut) = CURRENT_DATE ORDER BY gateOut ASC LIMIT 1;"
},
{
"instruction": "The task is to identify vehicles that have skipped the Yard-IN stage but completed Yard-Out.",
"input": "Which vehicles skipped the Yard-IN stage but completed Yard-Out?",
"output": "SELECT vehicleNumber FROM transactionalplms.trip WHERE yardIn IS NULL AND yardOut IS NOT NULL;"
},
{
"instruction": "The task is to find the average time vehicles spend between Yard-IN and Gate-Out stages.",
"input": "What is the average time vehicles spend between Yard-IN and Gate-Out stages?",
"output": "SELECT AVG(TIMESTAMPDIFF(MINUTE, yardIn, gateOut)) AS avg_time FROM transactionalplms.trip WHERE yardIn IS NOT NULL AND gateOut IS NOT NULL;"
},
{
"instruction": "The task is to find the vehicle that spent the least amount of time in the plant today.",
"input": "Which vehicle spent the least time in the plant today?",
"output": "SELECT vehicleNumber, TIMESTAMPDIFF(MINUTE, gateIn, gateOut) AS time_spent FROM transactionalplms.trip WHERE DATE(gateIn) = CURRENT_DATE AND gateOut IS NOT NULL ORDER BY time_spent ASC LIMIT 1;"
},
{
"instruction": "The task is to find the material types associated with vehicles currently in the plant.",
"input": "What material types are associated with vehicles currently in the plant?",
"output": "SELECT DISTINCT materialType_code FROM transactionalplms.trip WHERE gateOut IS NULL;"
}
]