system stringlengths 290 8.23k | conversations listlengths 2 8 |
|---|---|
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id text PRIMARY KEY, property_name text, address_line1 text, address_line2... | [
{
"role": "user",
"content": "Show me the first name, last name, and position of all staff members, along with the name of the property they work at."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T1.position, T2.property_name FROM hospitality_technology.staff AS T1 J... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims ( claim_id.text, policy_id.text, customer_id.text, incident_date.timestamp, reported_date.timestamp, d... | [
{
"role": "user",
"content": "Count the number of claims for each status in the system."
},
{
"role": "assistant",
"content": "SELECT status, COUNT(*) FROM insurance.claims GROUP BY status;"
}
] |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO... | [
{
"role": "user",
"content": "Which room types have a base rate above 250, and what are their property names and maximum occupancy?"
},
{
"role": "assistant",
"content": "SELECT rt.room_type_id, rt.type_name, p.property_name, rt.base_rate, rt.max_occupancy\nFROM hospitality_technology.room_types... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ... | [
{
"role": "user",
"content": "List all game titles and corresponding server names for servers that are located in the same region as 'us-central-1'."
},
{
"role": "assistant",
"content": "SELECT g.title, s.server_name\nFROM gaming_technology.servers s\nJOIN gaming_technology.games g ON s.game_id... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.trips ( trip_id text, route_id text, vehicle_id text, driver_id text, scheduled_departure timestamp, act... | [
{
"role": "user",
"content": "For each trip, show the scheduled and actual arrival time alongside the vehicle_id and driver_id. Only include trips where the actual arrival was later than the scheduled arrival."
},
{
"role": "assistant",
"content": "SELECT trip_id, vehicle_id, driver_id, schedule... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE erc1155_approval_for_all (
block_number bigint NOT NULL, -- Block number containing the transaction
block_times... | [
{
"role": "user",
"content": "For each ERC20 token, how many unique wallets currently hold them? Show the contract address and unique wallet count."
},
{
"role": "assistant",
"content": "SELECT contract_address, COUNT(DISTINCT wallet_address) AS unique_wallet_count FROM erc20_balances GROUP BY c... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... | [
{
"role": "user",
"content": "Retrieve all applications that have no assigned employee. Display the application_id, citizen_id, service_id, submitted_at, and status."
},
{
"role": "assistant",
"content": "SELECT\n application_id,\n citizen_id,\n service_id,\n submitted_at,\n status\nFROM go... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.diagnoses ( diagnosis_id.text, record_id.text, patient_id.text, doctor_id.text, diagnosis_code.text, code_ty... | [
{
"role": "user",
"content": "List the diagnosis code, description, and insurance provider for all diagnoses where the code type is 'ICD-9'."
},
{
"role": "assistant",
"content": "SELECT d.diagnosis_code, d.description, ip.insurance_provider\nFROM healthcare.diagnoses d\nJOIN healthcare.insuranc... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.events (
event_id character varying(64) NOT NULL, -- unique identifier for the event
contract_id characte... | [
{
"role": "user",
"content": "Find pairs of events within the same transaction that have the same event name but were emitted by different contracts. List the transaction ID, the shared event name, the IDs of both events, and the IDs of their respective contracts."
},
{
"role": "assistant",
"con... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique identifier for the vehicle
lice... | [
{
"role": "user",
"content": "Which vehicles are assigned to each depot? Display the depot ID, vehicle's license_plate, make, and model."
},
{
"role": "assistant",
"content": "SELECT depot_id, license_plate, make, model\nFROM transportation.vehicles\nWHERE depot_id IS NOT NULL;"
},
{
"ro... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms ( room_id text PRIMARY KEY, property_id text, room_number text, room_type_id text, floor i... | [
{
"role": "user",
"content": "List all available rooms (status = 'available') with their room numbers and features, along with their property IDs."
},
{
"role": "assistant",
"content": "SELECT room_id, property_id, room_number, features FROM hospitality_technology.rooms WHERE status = 'available... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- unique identifier for the room
prope... | [
{
"role": "user",
"content": "List all rooms along with their room type names and base rates for rooms that are currently 'Available'."
},
{
"role": "assistant",
"content": "SELECT r.room_id, r.room_number, rt.type_name, rt.base_rate\nFROM hospitality_technology.rooms r\nJOIN hospitality_technol... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.documents ( document_id text, case_id text, document_name text, document_type text, storage_path text, u... | [
{
"role": "user",
"content": "List all documents that have multiple versions, including document_name, case_id, and the count of versions."
},
{
"role": "assistant",
"content": "SELECT document_name,\n case_id,\n COUNT(*) AS version_count\nFROM legal_services.documents\nGROUP BY docu... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id.text, first_name.text, last_name.text, specialty.text, license_number.text, phone_number... | [
{
"role": "user",
"content": "List all doctors who have a hospital affiliation and include their specialty and affiliation ID."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, specialty, hospital_affiliation_id FROM healthcare.doctors WHERE hospital_affiliation_id IS NOT NULL... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e... | [
{
"role": "user",
"content": "List the name of each agency and the total number of service locations it operates in New York State."
},
{
"role": "assistant",
"content": "SELECT a.agency_name, COUNT(sl.location_id) AS location_count\nFROM government_services.agencies a\nLEFT JOIN government_serv... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add... | [
{
"role": "user",
"content": "List the ERC20 tokens (from token_metas) with exactly 6 decimals. Show their symbol, contract_address, and name."
},
{
"role": "assistant",
"content": "SELECT symbol, contract_address, name FROM token_metas WHERE is_erc20 = 1 AND decimals = 6;"
},
{
"role": ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.invoices ( invoice_id text PRIMARY KEY, invoice_number text UNIQUE, client_id text, case_id text, issue_... | [
{
"role": "user",
"content": "For each client, show the earliest and latest invoice issue_date, along with the total amount invoiced. Include client_id, earliest_issue_date, latest_issue_date, and total_amount."
},
{
"role": "assistant",
"content": "SELECT client_id, MIN(issue_date) AS earliest_... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.documents ( document_id text, application_id text, citizen_id text, document_type text, file_refere... | [
{
"role": "user",
"content": "List the full names of citizens who have uploaded documents with a verification status of 'Pending' and the type of document they uploaded."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T2.document_type FROM government_services.citizens ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.trades ( trade_id.text, account_id.text, security_id.text, order_id.text, trade_type.text, quantity.... | [
{
"role": "user",
"content": "Give me the total commission and average price_per_unit for each execution_venue for trades executed in the last 30 days."
},
{
"role": "assistant",
"content": "SELECT execution_venue, SUM(commission) AS total_commission, AVG(price_per_unit) AS avg_price\nFROM finan... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.insurance_products ( product_id text, product_name text, product_type text, description text, base_premium nu... | [
{
"role": "user",
"content": "List all active products, showing their product ID, name, and type, ordered by their creation date."
},
{
"role": "assistant",
"content": "SELECT product_id, product_name, product_type FROM insurance.insurance_products WHERE is_active = TRUE ORDER BY created_at;"
... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u... | [
{
"role": "user",
"content": "For each case, show the latest uploaded document's name, version number, and upload timestamp."
},
{
"role": "assistant",
"content": "SELECT d.case_id, d.document_name, d.version, d.upload_timestamp\nFROM legal_services.documents d\nINNER JOIN (\n SELECT case_id, M... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.patients (
patient_id character varying(64) NOT NULL, -- unique identifier for the patient
first_na... | [
{
"role": "user",
"content": "List appointment IDs, times, patient full name, and doctor full name for all appointments scheduled in February 2024."
},
{
"role": "assistant",
"content": "SELECT T1.appointment_id, T1.appointment_time, T2.first_name, T2.last_name, T3.first_name, T3.last_name FROM ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.comments ( comment_id text, post_id text, user_id text, parent_comment_id text, content text, created_at t... | [
{
"role": "user",
"content": "Show me all replies to comments on post 'P500', including the reply content and the content of the parent comment."
},
{
"role": "assistant",
"content": "SELECT T1.content AS reply_content, T2.content AS parent_comment_content FROM social_media.comments AS T1 JOIN s... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e... | [
{
"role": "user",
"content": "List the names of agencies and the total standard fee sum for all active services they currently provide."
},
{
"role": "assistant",
"content": "SELECT a.agency_name, SUM(s.standard_fee) AS total_active_service_fee\nFROM government_services.agencies a\nJOIN governme... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL... | [
{
"role": "user",
"content": "I want a list of game_id and the count of hidden achievements for each game."
},
{
"role": "assistant",
"content": "SELECT game_id, COUNT(*) AS hidden_achievement_count\nFROM gaming_technology.achievements\nWHERE hidden = TRUE\nGROUP BY game_id;"
},
{
"role"... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE financial_services.accounts ( account_id.text, customer_id.text, account_number.text, account_type.text, balance.numeri... | [
{
"role": "user",
"content": "Can you provide the total number of accounts and the average balance for each account_type?"
},
{
"role": "assistant",
"content": "SELECT account_type, COUNT(*) AS total_accounts, AVG(balance) AS avg_balance\nFROM financial_services.accounts\nGROUP BY account_type;"... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id_number character varying(128) NOT... | [
{
"role": "user",
"content": "Show the total amount paid for services in each category."
},
{
"role": "assistant",
"content": "SELECT T2.category , SUM(T1.amount) FROM government_services.payments AS T1 JOIN government_services.services AS T2 ON T1.service_id = T2.service_id GROUP BY T2.categ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_... | [
{
"role": "user",
"content": "List the top 5 Avalanche tokens by total transfer volume in token_activities_avalanche."
},
{
"role": "assistant",
"content": "SELECT tick, SUM(amt) AS total_volume\nFROM token_activities_avalanche\nGROUP BY tick\nORDER BY total_volume DESC\nLIMIT 5;"
},
{
"... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.notifications ( notification_id character varying(64) NOT NULL, citizen_id character varying(64) NO... | [
{
"role": "user",
"content": "For each notification, list the next notification sent to the same citizen (if any). Show citizen_id, notification_id, sent_at, next_notification_id, and next_sent_at."
},
{
"role": "assistant",
"content": "SELECT\n n1.citizen_id,\n n1.notification_id,\n n1.sent_... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
"CREATE TABLE token_basic_info (",
"coin_id character varying(100) NOT NULL, -- the id of the token",
"token_name character... | [
{
"role": "user",
"content": "What is the current market cap and 7-day price change percentage for the top 3 narratives by trend rank?"
},
{
"role": "assistant",
"content": "SELECT narrative, market_cap, price_change_percentage_7d FROM narrative_info ORDER BY trend_rank ASC LIMIT 3;"
}
] |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.medical_records (
record_id character varying(64) NOT NULL, -- unique identifier for the medical record... | [
{
"role": "user",
"content": "List all medical records created by doctor 'doc001' for patient 'pat456', displaying the record ID and record date."
},
{
"role": "assistant",
"content": "SELECT record_id, record_date\nFROM healthcare.medical_records\nWHERE doctor_id = 'doc001' AND patient_id = 'pa... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.appointments ( appointment_id text, citizen_id text, employee_id text, location_id text, service_id... | [
{
"role": "user",
"content": "Can you list all appointments along with the scheduled start time, purpose, and booking method, as well as the employee ID and location ID for each appointment?"
},
{
"role": "assistant",
"content": "SELECT appointment_id, scheduled_start_time, purpose, booking_meth... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE project_fundraising_record ( id.text, project_id.text, project_name.text, rounds_name.text, investment_value.numeric, i... | [
{
"role": "user",
"content": "List all projects that have completed a Series A funding round, including their investment value and valuation."
},
{
"role": "assistant",
"content": "SELECT project_name, investment_value, valuation FROM project_fundraising_record WHERE rounds_name = 'Series A';"
... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.posts ( post_id text PRIMARY KEY, user_id text, content text, media_url text, media_type text, created_at ... | [
{
"role": "user",
"content": "List all post IDs and their corresponding hashtag names for posts that include media."
},
{
"role": "assistant",
"content": "SELECT ph.post_id, h.tag_name\nFROM social_media.post_hashtags ph\nJOIN social_media.hashtags h ON ph.hashtag_id = h.hashtag_id\nJOIN social_... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.wallets (
wallet_id character varying(64) NOT NULL, -- unique identifier for the wallet
user_id character... | [
{
"role": "user",
"content": "Show me the wallet addresses and their creation dates for wallets created in the last 30 days, sorted by creation date in descending order."
},
{
"role": "assistant",
"content": "SELECT address, created_at FROM web3.wallets WHERE created_at >= CURRENT_DATE - INTERVA... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id.text, first_name.text, last_name.text, company_name.text, email.text, phone.text, ad... | [
{
"role": "user",
"content": "List each document name, document_type, the case_number, and case_name for all documents uploaded in the year 2023."
},
{
"role": "assistant",
"content": "SELECT d.document_name, d.document_type, c.case_number, c.case_name\nFROM legal_services.documents d\nJOIN lega... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the player
... | [
{
"role": "user",
"content": "Which games have achievements where the points value is exactly 0? List the game title and the achievement name."
},
{
"role": "assistant",
"content": "SELECT g.title AS game_title, a.name AS achievement_name\nFROM gaming_technology.achievements a\nJOIN gaming_techn... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE web3.contracts ( contract_id character varying(64) NOT NULL, address character varying(128) NOT NULL, abi text NOT NULL... | [
{
"role": "user",
"content": "Show the transfer id, token symbol, and the total supply of the token for every token transfer, but only for transfers where the transferred value is less than 100. Order by transfer_id."
},
{
"role": "assistant",
"content": "SELECT tt.transfer_id, tk.token_symbol, ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.insurance_plans ( plan_id text, plan_name text, insurance_provider text, plan_type text, contact_phone text,... | [
{
"role": "user",
"content": "List all dental insurance plans, sorted by plan name."
},
{
"role": "assistant",
"content": "SELECT * FROM healthcare.insurance_plans WHERE plan_type = 'dental' ORDER BY plan_name;"
},
{
"role": "user",
"content": "Actually, I only need plans from provid... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.fuel_logs ( fuel_log_id text, vehicle_id text, trip_id text, log_timestamp timestamp, fuel_type text, qu... | [
{
"role": "user",
"content": "How many fuel logs were created for each unit of measurement? Show the unit and the corresponding count."
},
{
"role": "assistant",
"content": "SELECT unit, COUNT(*) as log_count\nFROM transportation.fuel_logs\nGROUP BY unit;"
},
{
"role": "user",
"conte... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.routes ( route_id text, route_number text, description text, origin_location_id text, destination_locati... | [
{
"role": "user",
"content": "Can you show me all routes where the origin_location_id is the same as the destination_location_id? List their route_id, route_number, and type."
},
{
"role": "assistant",
"content": "SELECT route_id, route_number, type\nFROM transportation.routes\nWHERE origin_loca... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.doctors ( doctor_id text PRIMARY KEY, first_name text, last_name text, specialty text, license_number text, ... | [
{
"role": "user",
"content": "List each appointment with appointment ID, appointment time, doctor's last name, and the patient's primary insurance plan name."
},
{
"role": "assistant",
"content": "SELECT a.appointment_id,\n a.appointment_time,\n d.last_name AS doctor_last_name,\n ... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE healthcare.medications (
medication_id character varying(64) NOT NULL, -- unique identifier for the medication type... | [
{
"role": "user",
"content": "Show me all medications where the description field is not provided (either NULL or empty)."
},
{
"role": "assistant",
"content": "SELECT medication_id, medication_name, manufacturer FROM healthcare.medications WHERE description IS NULL OR description = '';"
},
... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.claims (
claim_id character varying(64) NOT NULL, -- unique identifier for the claim
policy_id charac... | [
{
"role": "user",
"content": "List all beneficiaries who have a percentage share greater than 75%. Show their first name, last name, and percentage share."
},
{
"role": "assistant",
"content": "SELECT T1.first_name, T1.last_name, T1.percentage_share FROM insurance.policy_beneficiaries AS T1 WHER... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE gaming_technology.servers ( server_id uuid PRIMARY KEY, game_id uuid, server_name text, region text, ip_address text, p... | [
{
"role": "user",
"content": "Show me all servers that are currently full, meaning current players equals max players. List the server name, region, and max players."
},
{
"role": "assistant",
"content": "SELECT server_name, region, max_players FROM gaming_technology.servers WHERE current_player... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE transportation.vehicles ( vehicle_id character varying(64) NOT NULL, license_plate character varying(32) NOT NULL UNIQU... | [
{
"role": "user",
"content": "Retrieve the first and last names of passengers along with the total sum of fares they've paid for bookings with status 'Completed', ordered by the sum descending."
},
{
"role": "assistant",
"content": "SELECT p.first_name, p.last_name, SUM(b.fare) AS total_fare\nFR... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE legal_services.clients ( client_id text, first_name text, last_name text, company_name text, email text, phone text, ad... | [
{
"role": "user",
"content": "How many time entries does each client have? Provide the client's first and last name along with the count, sorted by count descending."
},
{
"role": "assistant",
"content": "SELECT c.first_name, c.last_name, COUNT(te.entry_id) AS entry_count FROM legal_services.cli... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE insurance.customers ( customer_id text, first_name text, last_name text, date_of_birth date, ssn_hash text, address_lin... | [
{
"role": "user",
"content": "Which customers have policies that expired in the last month? Please show the customer ID, policy number, and expiration date."
},
{
"role": "assistant",
"content": "SELECT c.customer_id, p.policy_number, p.end_date\nFROM insurance.customers c\nJOIN insurance.polici... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE government_services.employees ( employee_id.text, agency_id.text, first_name.text, last_name.text, job_title.text, depa... | [
{
"role": "user",
"content": "Show a list of departments with more than 5 employees. Include the department name and the count."
},
{
"role": "assistant",
"content": "SELECT department, COUNT(*) AS employee_count\nFROM government_services.employees\nGROUP BY department\nHAVING COUNT(*) > 5;"
}... |
You are an SQL statement expert. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the user's question.
##Table Structure
CREATE TABLE social_media.likes ( like_id.text, user_id.text, post_id.text, comment_id.text, created_at.timestamp )
| [
{
"role": "user",
"content": "What is the total number of likes recorded in the system?"
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.likes;"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.