Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
276
7.27k
[ { "role": "user", "content": "Show me all properties in California with a star rating above 3.5, along with their room types and base rates." }, { "role": "assistant", "content": "SELECT p.property_name, p.city, p.star_rating, rt.type_name, rt.base_rate FROM hospitality_technology.properties p 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 hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Show all rooms that are on floor 3." }, { "role": "assistant", "content": "SELECT room_id, property_id, room_number FROM hospitality_technology.rooms WHERE floor = 3;" }, { "role": "user", "content": "For these rooms, include the property name and room 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 hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "I need a list of claim_ids that have at least one document of type 'Photo' and at least one of type 'Invoice'." }, { "role": "assistant", "content": "SELECT DISTINCT cd.claim_id\nFROM insurance.claim_documents cd\nWHERE cd.document_type IN ('Photo', 'Invoice');" }...
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 character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "Show me the number of players registered in each country, along with the number of different games available for each country." }, { "role": "assistant", "content": "SELECT p.country_code, COUNT(DISTINCT p.player_id) AS player_count, COUNT(DISTINCT g.game_id) AS gam...
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.timestampt...
[ { "role": "user", "content": "Find all in-game items that have a 'mana_cost' attribute in their attributes JSON. Show the item ID, item name, and the value of the 'mana_cost'." }, { "role": "assistant", "content": "SELECT item_id, item_name, attributes ->> 'mana_cost' AS mana_cost FROM gaming_te...
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.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, publisher_id uuid, genre text, relea...
[ { "role": "user", "content": "For each fundraising round in 2022 and 2023, list the round name, the year, the total investment_value, and the count of distinct projects. Also include the average market_cap of associated tokens by matching project_name to token_symbol in token_basic_info." }, { "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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Show the usernames and registration dates for all users whose email ends with '@gmail.com'." }, { "role": "assistant", "content": "SELECT username, created_at FROM web3.users WHERE email LIKE '%@gmail.com';" }, { "role": "user", "content": "Actually, can...
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.users ( user_id text, username text, email text, password_hash text, created_at timestamp )
[ { "role": "user", "content": "List each lawyer's full name with the full name of the partner at the same firm." }, { "role": "assistant", "content": "SELECT l.lawyer_id,\n CONCAT(l.first_name, ' ', l.last_name) AS lawyer_name,\n CONCAT(p.first_name, ' ', p.last_name) AS partner_name\...
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.lawyers ( lawyer_id character varying(64) NOT NULL, -- unique identifier for the lawyer first_n...
[ { "role": "user", "content": "Find all smart contracts where the code length is greater than 1000 characters." }, { "role": "assistant", "content": "SELECT contract_id, creator_address, timestamp FROM blockchain.smart_contracts WHERE LENGTH(code) > 1000;" }, { "role": "user", "conten...
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 blockchain.smart_contracts ( contract_id text PRIMARY KEY, creator_address text, code text, timestamp timestamp )
[ { "role": "user", "content": "Show me all insurance plans where the website includes 'secure'." }, { "role": "assistant", "content": "SELECT * FROM healthcare.insurance_plans WHERE website ILIKE '%secure%';" } ]
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 the names of active services and their categories provided by agencies with a 'Federal' jurisdiction level." }, { "role": "assistant", "content": "SELECT T1.service_name, T1.category FROM government_services.services AS T1 JOIN government_services.agencies AS T...
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, -- unique identifier for the citizen ...
[ { "role": "user", "content": "List the patient ID and subscriber name for all patients who have both at least one diagnosis recorded and at least one primary insurance policy." }, { "role": "assistant", "content": "SELECT DISTINCT pi.patient_id, pi.subscriber_name FROM healthcare.patient_insuran...
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 character varying(64) NOT NULL, -- unique identifier for the diagnosis entry ...
[ { "role": "user", "content": "List usernames and the length of their 'bio' field for users whose 'is_verified' status is true." }, { "role": "assistant", "content": "SELECT username, LENGTH(bio) AS bio_length FROM social_media.users WHERE is_verified IS TRUE;" } ]
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.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "What is the current salary of employee with ID 'EMP123'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information about an employee's salary as it is not included in the data available in the 'employees' table." } ]
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. 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 manufacturing.employees ( ...
[ { "role": "user", "content": "Give me the total billed amount for each invoice in 2024." }, { "role": "assistant", "content": "SELECT invoice_id, SUM(hours_spent * billing_rate) AS total_billed_amount FROM legal_services.time_entries WHERE is_billed = TRUE AND EXTRACT(YEAR FROM date_worked) = 20...
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.time_entries ( entry_id text PRIMARY KEY, case_id text, lawyer_id text, date_worked date, hours_spent nu...
[ { "role": "user", "content": "Show each service's name along with the total number of appointments scheduled and the number of unique locations these appointments are scheduled at." }, { "role": "assistant", "content": "SELECT s.service_name, COUNT(a.application_id) AS appointment_count, COUNT(D...
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, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Could you list all pairs of developers that are based in the same country and share the same website domain?" }, { "role": "assistant", "content": "SELECT\n d1.name AS developer1_name,\n d2.name AS developer2_name,\n d1.country,\n d1.website\nFROM\n gaming_tech...
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.developers ( developer_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the d...
[ { "role": "user", "content": "Show me all customers who have missing contact information (either phone number or email is null), along with their state and city." }, { "role": "assistant", "content": "SELECT first_name, last_name, state, city FROM insurance.customers WHERE phone_number IS NULL O...
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 character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "For each medication, show the total number of prescriptions where at least one refill was allowed." }, { "role": "assistant", "content": "SELECT medication_id, COUNT(*) AS prescription_count FROM healthcare.prescriptions WHERE refills_allowed > 0 GROUP BY medication...
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 text PRIMARY KEY, first_name text, last_name text, date_of_birth date, gender text, ad...
[ { "role": "user", "content": "Show me all insurance plans that cover more than 10 patients as their primary insurance, along with the provider name and contact information." }, { "role": "assistant", "content": "SELECT ip.plan_name, ip.insurance_provider, ip.contact_phone, ip.website, COUNT(pi.p...
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 all users with private profiles who have disabled push notifications, including their user_id and email_notifications_enabled status." }, { "role": "assistant", "content": "SELECT user_id,\n email_notifications_enabled\nFROM social_media.user_settings\nWH...
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.conversations ( conversation_id.text, created_at.timestamp, last_message_at.timestamp, is_group_chat.boole...
[ { "role": "user", "content": "Show me all insurance plans that have more than 5 patients enrolled as their primary insurance, along with the provider name and count of patients, sorted by patient count in descending order." }, { "role": "assistant", "content": "SELECT ip.insurance_provider, ip.p...
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": "Can you help me get the total number of operational platforms across all stations?" }, { "role": "assistant", "content": "db.platforms.countDocuments({ status: 'Operational' });" } ]
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure // db.createCollection('platforms') // Optional: db.platforms.createIndex({ platform_id: 1 }, { u...
[ { "role": "user", "content": "What is the fuel efficiency of the train car with car_id 'TC456'?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to information about the fuel efficiency of specific train cars. The data available in the train_cars table only includes deta...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. 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 train_station_management.t...
[ { "role": "user", "content": "Can you list all SUI coins with 'active' status and their owner addresses and balances?" }, { "role": "assistant", "content": "SELECT object_id, coin_type, owner, balance\nFROM sui_coins\nWHERE status = 'active';" }, { "role": "user", "content": "Add the...
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, block_timestamp timestamp, transaction_index integer, transaction_hash ...
[ { "role": "user", "content": "Show me the average number of current players for each server region." }, { "role": "assistant", "content": "SELECT region, AVG(current_players) AS average_players FROM gaming_technology.servers GROUP BY region;" }, { "role": "user", "content": "Now, onl...
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": "List all rooms that have a 'Jacuzzi' feature, including the room_number, property_id, type_name, and base_rate." }, { "role": "assistant", "content": "SELECT r.room_number,\n r.property_id,\n rt.type_name,\n rt.base_rate\nFROM hospitality_technolog...
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, property_id.text, room_number.text, room_type_id.text, floor.integer, stat...
[ { "role": "user", "content": "What is the average speed of train number T9876 during its last journey?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the average speed of train number T9876 during its last journey. The data in the trains table does not inclu...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. 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 train_station_management.t...
[ { "role": "user", "content": "Show the names of all insurance plans and the number of patients enrolled in each plan." }, { "role": "assistant", "content": "SELECT ip.plan_name, COUNT(pi.patient_id) AS enrolled_patients FROM healthcare.insurance_plans ip JOIN healthcare.patient_insurance pi ON i...
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, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "Find all NFTs with a rarity rank less than 100 and show their name and the name of their collection." }, { "role": "assistant", "content": "SELECT nm.name AS nft_name, nc.name AS collection_name FROM nft_metadata nm JOIN nft_collections nc ON nm.contract_address = n...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varch...
[ { "role": "user", "content": "Find cases where an address received tokens in one transfer and then sent tokens in another. List the receive transfer_id, the send transfer_id, the address, and both transfer values." }, { "role": "assistant", "content": "SELECT recv.transfer_id AS receive_transfer...
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.token_transfers ( transfer_id character varying(64) NOT NULL, -- unique identifier for the transfer token...
[ { "role": "user", "content": "Show me the service name, category, and price for all services that are currently not available." }, { "role": "assistant", "content": "SELECT service_name, category, price FROM hospitality_technology.services WHERE is_available = FALSE;" }, { "role": "user"...
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.services ( service_id.text, property_id.text, service_name.text, description.text, category.text...
[ { "role": "user", "content": "Find the address that has the highest total amount across all its UTXOs." }, { "role": "assistant", "content": "SELECT address FROM utxos GROUP BY address ORDER BY SUM(amount) DESC LIMIT 1;" } ]
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 trading_platform.users ( user_id.text, username.text, email.text, password_hash.text, created_at.timestamp ) CREATE TAB...
[ { "role": "user", "content": "List all insurance plans along with their provider, plan type, and the contact phone number. Also, for each plan, show how many doctors have their hospital affiliation ID matching the plan ID." }, { "role": "assistant", "content": "SELECT ip.plan_id, ip.plan_name, i...
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": "Show me claim IDs, incident dates, and file names for all 'Accident Report' claim documents." }, { "role": "assistant", "content": "SELECT cd.claim_id, cl.incident_date, cd.file_name\nFROM insurance.claim_documents cd\nJOIN insurance.claims cl ON cd.claim_id = cl.cl...
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 PRIMARY KEY, first_name text, last_name text, date_of_birth date, ssn_hash text,...
[ { "role": "user", "content": "List user IDs of users who have private profiles and have liked any post or comment." }, { "role": "assistant", "content": "SELECT DISTINCT T1.user_id FROM social_media.user_settings AS T1 JOIN social_media.likes AS T2 ON T1.user_id = T2.user_id WHERE T1.private_pro...
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 character varying(64) NOT NULL, user_id character varying(64) NOT NULL, post_id character ...
[ { "role": "user", "content": "Which states have the highest number of customers? Provide the top 5 states along with their customer counts, ordered by count descending." }, { "role": "assistant", "content": "SELECT\n state,\n COUNT(*) AS customer_count\nFROM insurance.customers\nGROUP BY state...
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 character varying(64) NOT NULL, -- unique identifier for the customer first_...
[ { "role": "user", "content": "How many primary insurance policies are currently active for each plan_id? Show plan_id and active_count." }, { "role": "assistant", "content": "SELECT plan_id,\n COUNT(*) AS active_count\nFROM healthcare.patient_insurance\nWHERE is_primary = TRUE\n AND (expi...
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.patient_insurance ( patient_insurance_id text, patient_id text, plan_id text, policy_number text, group_numb...
[ { "role": "user", "content": "List all node pairs that operate on the same port and were last_seen within 30 minutes of each other, showing both node_ids, the port, and the time difference in minutes." }, { "role": "assistant", "content": "SELECT n1.node_id AS node1_id, n2.node_id AS node2_id, 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 blockchain.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen timestamp )
[ { "role": "user", "content": "Count the number of transactions for each block that was created in 2023 and has a difficulty greater than 1000. Show the block ID and the transaction count." }, { "role": "assistant", "content": "SELECT B.block_id, COUNT(T.transaction_id) AS transaction_count FROM ...
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure CREATE TABLE blockchain.blocks ( block_id character varying(64) NOT NULL, previous_block_id chara...
[ { "role": "user", "content": "Find documents that have the same document_name but are associated with different cases. Show the document name and the two different case IDs." }, { "role": "assistant", "content": "SELECT d1.document_name, d1.case_id AS case_id_1, d2.case_id AS case_id_2 FROM 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 legal_services.documents ( document_id.text, case_id.text, document_name.text, document_type.text, storage_path.text, u...
[ { "role": "user", "content": "List all pairs of diagnoses that belong to the same medical record. Show record_id, diagnosis_id from the first entry as diag1_id, and diagnosis_id from the second entry as diag2_id." }, { "role": "assistant", "content": "SELECT d1.record_id,\n d1.diagnosis_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 healthcare.diagnoses ( diagnosis_id character varying(64) NOT NULL, -- unique identifier for the diagnosis entry ...
[ { "role": "user", "content": "What is the current address of the employee with ID 'EMP234'?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide the current address of an employee as this information is not stored in the database table." } ]
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. 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 manufacturing.employees ( ...
[ { "role": "user", "content": "What is the current location of train number Acela 2151?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to real-time location data for trains. The database only contains static information such as train ID, model, capacity, and maintenance...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. 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 train_station_management.t...
[ { "role": "user", "content": "Show me all policies that expired in the last 60 days, along with their product IDs and premium amounts." }, { "role": "assistant", "content": "SELECT policy_id, product_id, premium_amount FROM insurance.policies WHERE status = 'expired' AND end_date >= CURRENT_DATE...
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.policies ( policy_id text PRIMARY KEY, customer_id text, product_id text, agent_id text, policy_number text, ...
[ { "role": "user", "content": "Find services that have associated documents with a 'Pending' verification status. Show the service name and the document type name." }, { "role": "assistant", "content": "SELECT DISTINCT s.service_name, dt.document_type_name FROM government_services.services AS s 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Show me the earliest unlock date for each achievement along with the player_id who unlocked it." }, { "role": "assistant", "content": "SELECT achievement_id, player_id, MIN(unlocked_at) AS earliest_unlock FROM gaming_technology.player_achievements GROUP BY achieveme...
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.player_achievements ( player_achievement_id.uuid, player_id.uuid, achievement_id.uuid, unlocked_at.ti...
[ { "role": "user", "content": "Show me all intercity routes with their origin and destination locations, including the city and country for each location." }, { "role": "assistant", "content": "SELECT r.route_id, r.route_number, r.type, orig.name AS origin_name, orig.city AS origin_city, orig.cou...
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 character varying(64) NOT NULL, -- unique identifier for the route route_numb...
[ { "role": "user", "content": "Find all patients who have both a primary insurance plan and at least one completed appointment, along with their insurance policy numbers and the count of appointments." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, pi.policy_number, COUNT...
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, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "How many beneficiaries are there for each relationship type?" }, { "role": "assistant", "content": "SELECT relationship,\n COUNT(*) AS beneficiary_count\nFROM insurance.policy_beneficiaries\nGROUP BY relationship;" } ]
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.policy_beneficiaries ( beneficiary_id character varying(64) NOT NULL, policy_id character varying(64) NOT NUL...
[ { "role": "user", "content": "Find all pairs of different insurance records that share the same group_number, and show group_number, the patient_insurance_id of both records, and their corresponding patient_ids." }, { "role": "assistant", "content": "SELECT a.group_number,\n a.patient_insu...
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.patient_insurance ( patient_insurance_id text, patient_id text, plan_id text, policy_number text, group_numb...
[ { "role": "user", "content": "List the document ID, document type, and verification status for all documents verified by employees working for the agency with ID 'AG101'. Also include the verifying employee's full name." }, { "role": "assistant", "content": "SELECT T1.document_id , T1.document_...
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 text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "How many users have non-empty full_name and bio fields? Return only the count." }, { "role": "assistant", "content": "SELECT COUNT(*)\nFROM social_media.users\nWHERE full_name IS NOT NULL\n AND full_name <> ''\n AND bio IS NOT NULL\n AND bio <> '';" } ]
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.users ( user_id text PRIMARY KEY, username text, email text, password_hash text, full_name text, profile_p...
[ { "role": "user", "content": "List all ERC20 tokens where the price is between $1 and $10, including their names, symbols, and contract addresses." }, { "role": "assistant", "content": "SELECT tm.name, tm.symbol, tm.contract_address FROM token_metas tm JOIN token_prices_latest tpl ON tm.contract...
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": "For each city and state, show the number of service locations available along with their accessibility status." }, { "role": "assistant", "content": "SELECT city, state, is_accessible, COUNT(*) AS location_count FROM government_services.service_locations GROUP BY ci...
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.service_locations ( location_id text, agency_id text, location_name text, address text, city text, ...
[ { "role": "user", "content": "Show me all cryptocurrency assets that have metadata entries for both 'category' and 'subcategory', along with their corresponding values." }, { "role": "assistant", "content": "SELECT m1.asset_id, m1.value AS category, m2.value AS subcategory FROM trading_platform....
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 trading_platform.users ( user_id text, username text, email text, password_hash text, created_at timestamp ) CREATE TAB...
[ { "role": "user", "content": "What is the current market price of a Boeing 737 MAX aircraft?" }, { "role": "assistant", "content": "I'm sorry, but I don't have access to the current market price of aircraft models. The data I have is limited to technical specifications and general information ab...
You are an SQL statement expert and you can refuse the user's question if the question is not related to the table structure. 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 manufacturing.aircraft_mod...
[ { "role": "user", "content": "List the name and symbol for all assets that do not have a corresponding entry with the key 'website' in the metadata table." }, { "role": "assistant", "content": "SELECT T1.name , T1.symbol FROM trading_platform.assets AS T1 LEFT JOIN trading_platform.metadata AS T...
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 trading_platform.users ( user_id character varying(64) NOT NULL, username character varying(128) NOT NULL, email charac...
[ { "role": "user", "content": "List the full name (first name and last name) of all citizens who have uploaded documents whose expiry date is in the past." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM government_services.citizens AS T1 INNER JOIN 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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "List all accounts for customers who have at least one account with a balance over 10000 and another account with a balance under 1000. Show customer_id, account_id, account_type, balance, and currency." }, { "role": "assistant", "content": "SELECT account_id , cust...
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": "For each reservation, show me the guest's full name, the property name, and the room type name." }, { "role": "assistant", "content": "SELECT r.reservation_id, g.first_name || ' ' || g.last_name AS guest_full_name, p.property_name, rt.type_name AS room_type_name\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 hospitality_technology.properties ( property_id text, property_name text, address_line1 text, address_line2 text, city ...
[ { "role": "user", "content": "Show the service names that had documents uploaded for their applications in the calendar year 2023." }, { "role": "assistant", "content": "SELECT DISTINCT T1.service_name FROM government_services.services AS T1 JOIN applications AS T2 ON T1.service_id = T2.service_...
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.services ( service_id text PRIMARY KEY, agency_id text, service_name text, description text, catego...
[ { "role": "user", "content": "List all pairs of hashtags that were created on the same date. Show both tag names and the creation date." }, { "role": "assistant", "content": "SELECT a.tag_name AS tag1, b.tag_name AS tag2, a.created_at::date AS created_date\nFROM social_media.hashtags a\nJOIN soc...
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.hashtags ( hashtag_id character varying(64) NOT NULL, tag_name character varying(100) NOT NULL UNIQUE, cre...
[ { "role": "user", "content": "List all room numbers with their room type name and property name for rooms that have a Jacuzzi feature." }, { "role": "assistant", "content": "SELECT r.room_number, rt.type_name, p.property_name\nFROM hospitality_technology.rooms r\nJOIN hospitality_technology.room...
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": "Retrieve the agency name and the most recent notification sent date for each agency, considering only notifications related to agencies." }, { "role": "assistant", "content": "SELECT a.agency_name, MAX(n.sent_at) AS last_notification_date\nFROM government_services.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 government_services.agencies ( agency_id character varying(64) NOT NULL, agency_name character varying(255) NOT NULL, j...
[ { "role": "user", "content": "Show me the total transaction amount by transaction_type for all transactions processed by employees in the 'Trading' department, along with their department name." }, { "role": "assistant", "content": "SELECT t.transaction_type, SUM(t.amount) AS total_amount, e.dep...
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.transactions ( transaction_id character varying(64) NOT NULL, -- unique identifier for the trans...
[ { "role": "user", "content": "List all pairs of tokens (show token_id for both) that share the same contract address, excluding pairs where the token_id is the same." }, { "role": "assistant", "content": "SELECT t1.token_id AS token_id1, t2.token_id AS token_id2, t1.contract_address FROM web3.to...
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.tokens ( token_id character varying(64) NOT NULL, contract_address character varying(128) NOT NULL, token_name cha...
[ { "role": "user", "content": "List all primary insurance policies that will expire within the next 30 days. Return patient_insurance_id, patient_id, policy_number, and expiration_date." }, { "role": "assistant", "content": "SELECT patient_insurance_id,\n patient_id,\n policy_number,\...
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.text, patient_id.text, appointment_id.text, doctor_id.text, record_date.timestam...
[ { "role": "user", "content": "Show the number of employees in each department." }, { "role": "assistant", "content": "SELECT department, COUNT(*) AS employee_count\nFROM financial_services.employees\ngroup BY department;" }, { "role": "user", "content": "Exclude departments that have...
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 PRIMARY KEY, customer_id text, account_number text, account_type text, ba...
[ { "role": "user", "content": "Show all SUI coins with 'exists' status and more than 8 decimal places. Display coin_type, symbol, name, and decimals." }, { "role": "assistant", "content": "SELECT coin_type, symbol, name, decimals\nFROM sui_coins_metadata\nWHERE status = 'exists' AND decimals > 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 nft_holders ( block_number bigint NOT NULL, contract_address varchar NOT NULL, wallet_address varchar NOT NULL, token_i...
[ { "role": "user", "content": "Can you show, for each employee, the full name and job title of their direct manager, as well as the employee's department and branch_id?" }, { "role": "assistant", "content": "SELECT e.employee_id, e.first_name AS employee_first_name, e.last_name AS employee_last_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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "List each guest’s full name and the total number of service orders they have placed, ordered by order count descending." }, { "role": "assistant", "content": "SELECT g.guest_id,\n g.first_name || ' ' || g.last_name AS full_name,\n COUNT(so.order_id) AS o...
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.guests ( guest_id text PRIMARY KEY, first_name text, last_name text, email text, phone_number te...
[ { "role": "user", "content": "Show me all wallet addresses that hold more than 1000 of any ERC1155 token, along with the token ID and amount." }, { "role": "assistant", "content": "SELECT wallet_address, token_id, amount FROM nft_holders WHERE contract_type = 'ERC1155' AND CAST(amount AS decimal...
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...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
2