human
Schema:
Addresses (address_id, line_1_number_building, city, zip_postcode, state_province_county, country)
Staff (staff_id, staff_address_id, nickname, first_name, middle_name, last_name, date_of_birth, date_joined_staff, date_left_staff)
Vehicles (vehicle_id, vehicle_details)
Customers (customer_id, customer_address_id, customer_status_code, date_became_customer, date_of_birth, first_name, last_name, amount_outstanding, email_address, phone_number, cell_mobile_phone_number)
Customer_Payments (customer_id, datetime_payment, payment_method_code, amount_payment)
Lessons (lesson_id, customer_id, lesson_status_code, staff_id, vehicle_id, lesson_date, lesson_time, price)
Please answer with SQL.
assistant
Sure, I understand.
human
How many staff in total?
assistant
SELECT count(*) FROM Staff;
human
What is the id and detail of the vehicle used in lessons for most of the times?
assistant
SELECT T1.vehicle_id , T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY count(*) DESC LIMIT 1
human
How many customers in total?
assistant
SELECT count(*) FROM Customers;
human
Show the detail of vehicle with id 1.
assistant
SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1;
human
List all vehicle id
assistant
SELECT vehicle_id FROM Vehicles;
human
How many vehicle in total?
assistant
SELECT COUNT( * ) FROM Vehicles ;