Dataset Viewer
Auto-converted to Parquet Duplicate
conversations
listlengths
2
8
system
stringlengths
284
8.23k
[ { "role": "user", "content": "List pairs of citizens who share the same email domain." }, { "role": "assistant", "content": "SELECT c1.first_name AS first1,\n c1.last_name AS last1,\n c2.first_name AS first2,\n c2.last_name AS last2,\n SPLIT_PART(c1.contact_email, '@', 2)...
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 all securities (security_id, ticker_symbol, security_name) that have a currency of 'EUR' and were last updated within the last 30 days, along with their exchange and sector information." }, { "role": "assistant", "content": "SELECT security_id, ticker_symbol, 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 financial_services.securities ( security_id character varying(64) NOT NULL, -- unique identifier for the security ...
[ { "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": "Count the number of law firms founded in each decade. Show the decade (e.g., 1990s, 2000s) and the count." }, { "role": "assistant", "content": "SELECT CONCAT(FLOOR(EXTRACT(YEAR FROM founded_date) / 10) * 10, 's') AS decade, COUNT(*) AS firm_count FROM law_firms WHE...
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 PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "Show all medical records with the record_id, record_date, the patient's insurance policy_number, and the doctor's ID, for records linked to a currently active insurance policy." }, { "role": "assistant", "content": "SELECT mr.record_id, mr.record_date, pi.policy_num...
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.appointments ( appointment_id.text, patient_id.text, doctor_id.text, appointment_time.timestamp, duration_mi...
[ { "role": "user", "content": "Provide a count of citizens registered per calendar year." }, { "role": "assistant", "content": "SELECT CAST(EXTRACT(YEAR FROM registration_date) AS INTEGER) AS registration_year, COUNT(*) AS citizen_count FROM government_services.citizens GROUP BY 1 ORDER BY 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "List all ERC20 tokens where the price is greater than $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_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 token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varchar, transaction_index bigint, from_...
[ { "role": "user", "content": "List the full name and bar number of all lawyers who were hired before 2015." }, { "role": "assistant", "content": "SELECT first_name || ' ' || last_name AS lawyer_full_name, bar_number\nFROM legal_services.lawyers\nWHERE hire_date < '2015-01-01';" } ]
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 character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "What is the average ROI and average realized_ratio for each chain?" }, { "role": "assistant", "content": "SELECT chain,\n AVG(roi) AS avg_roi,\n AVG(realized_ratio) AS avg_realized_ratio\nFROM smart_money_token_performance\nGROUP BY chain;" }, { ...
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 smart_money_token_performance ( token_address text, token_symbol text, pnl numeric, net_flow numeric, avg_cost numeric,...
[ { "role": "user", "content": "List the first and last name of each citizen along with the city and state of the service location for their agency." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, sl.city, sl.state\nFROM government_services.citizens c\nJOIN 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 government_services.citizens ( citizen_id text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "Provide a report of each user with their username and the count of all log entries from the last 30 days." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COUNT(l.log_id) AS log_count\nFROM trading_platform.users u\nLEFT JOIN trading_platform.log...
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, -- unique identifier for the user username ch...
[ { "role": "user", "content": "List properties and the average base rate of their room types." }, { "role": "assistant", "content": "SELECT T1.property_name , AVG(T2.base_rate) FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.room_types AS T2 ON T1.property_id = T2.prop...
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.room_types ( room_type_id character varying(64) NOT NULL, -- unique identifier for the room ...
[ { "role": "user", "content": "Show me the top 5 ERC20 tokens with the highest total supply, along with their names and contract addresses, but only include tokens where the price is greater than $0.10." }, { "role": "assistant", "content": "SELECT tm.name, tm.contract_address, tm.total_supply FR...
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(6) NOT NULL, -- Timestamp of the block when token metadata was recorded ...
[ { "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 me all distinct dosage forms used in prescriptions." }, { "role": "assistant", "content": "SELECT DISTINCT dosage FROM healthcare.prescriptions;" } ]
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.prescriptions ( prescription_id text PRIMARY KEY, record_id text, patient_id text, doctor_id text, medicatio...
[ { "role": "user", "content": "I need to find all tickets for a specific route 'RT456' along with the car details and route information." }, { "role": "assistant", "content": "SELECT t.ticket_id, t.seat_number, t.price, tc.car_number, tc.car_type, r.route_name, r.description\nFROM train_station_m...
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 train_station_management.train_cars ( car_id character varying(64) NOT NULL, -- ...
[ { "role": "user", "content": "For each player, calculate the total quantity of items they have acquired. Return player_id and total_quantity." }, { "role": "assistant", "content": "SELECT player_id,\n SUM(quantity) AS total_quantity\nFROM gaming_technology.player_inventory\nGROUP BY 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 gaming_technology.player_inventory ( inventory_id uuid PRIMARY KEY, player_id uuid, item_id uuid, quantity int, acquire...
[ { "role": "user", "content": "What is the average commission_rate for each agent status and only show statuses with an average commission_rate above 0.05?" }, { "role": "assistant", "content": "SELECT status,\n AVG(commission_rate) AS avg_commission_rate\nFROM insurance.agents\nGROUP BY st...
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.agents ( agent_id.text, first_name.text, last_name.text, agency_name.text, license_number.text, license_state...
[ { "role": "user", "content": "Show me the top 5 users who have interacted with DApps, along with the count of distinct DApps they interacted with and their wallet addresses." }, { "role": "assistant", "content": "SELECT w.user_id, COUNT(DISTINCT d.dapp_id) AS dapp_count, w.address FROM trading_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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "List document names and versions for documents that share the same case_id, showing each pair of versions." }, { "role": "assistant", "content": "SELECT d1.case_id, d1.document_name AS doc_name_v1, d1.version AS version1, d2.document_name AS doc_name_v2, d2.version ...
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 character varying(64) NOT NULL, -- unique identifier for the document c...
[ { "role": "user", "content": "For all chains, which token held by centralized exchanges (CEX) has the highest ROI according to smart money token performance? Show token symbol, chain, exchange, total USD value held on CEX, and the smart money ROI." }, { "role": "assistant", "content": "SELECT 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 project_fundraising_record ( id character varying(32) NOT NULL, project_id character varying(32) NOT NULL, project_name...
[ { "role": "user", "content": "Show me all asset types along with the count of distinct assets and the count of log actions for each type." }, { "role": "assistant", "content": "SELECT a.type, COUNT(DISTINCT a.asset_id) AS asset_count, COUNT(l.log_id) AS action_count FROM trading_platform.assets ...
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.assets ( asset_id text, name text, symbol text, type text ) CREATE TABLE trading_platform.logs ( log_i...
[ { "role": "user", "content": "Which chain has the highest total USD inflow from buy transactions (type=1), and how many distinct tokens were involved in that inflow?" }, { "role": "assistant", "content": "SELECT chain, SUM(usd_value) AS total_inflow, COUNT(DISTINCT token_symbol) AS distinct_toke...
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 smart_money_token_inflow ( token_address text, token_symbol text, token_amount numeric, usd_value numeric, avg_price nu...
[ { "role": "user", "content": "Get a list of room types along with their property name and the count of rooms currently Available for each type." }, { "role": "assistant", "content": "SELECT rt.type_name, p.property_name, COUNT(r.room_id) AS available_rooms_count\nFROM 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.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Retrieve the policy_number, start_date, end_date, premium_amount, and corresponding product_name for policies with a coverage_limit greater than 500000." }, { "role": "assistant", "content": "SELECT p.policy_number, p.start_date, p.end_date, p.premium_amount, ip.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 insurance.policies ( policy_id text, customer_id text, product_id text, agent_id text, policy_number text, start_date d...
[ { "role": "user", "content": "List all room types that have at least one service in the 'Spa' category, including the room type name, property name, and service name." }, { "role": "assistant", "content": "SELECT DISTINCT rt.type_name, p.property_name, s.service_name\nFROM hospitality_technology...
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, -- unique identifier for the prope...
[ { "role": "user", "content": "For each Avalanche token tick, calculate the total transfer volume and transaction count over the past 7 days using token_activities_avalanche. Include the token tick, total_volume, and tx_count." }, { "role": "assistant", "content": "SELECT\n tick,\n SUM(amt) AS ...
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 all reservations where the number of adults is greater than 2, showing reservation_id, guest_id, and the total_amount." }, { "role": "assistant", "content": "SELECT reservation_id, guest_id, total_amount\nFROM hospitality_technology.reservations\nWHERE num_adul...
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.reservations ( reservation_id character varying(64) NOT NULL, property_id character varying(64) ...
[ { "role": "user", "content": "For each customer, provide a summary of their account statuses, showing their full name, account status, and the count of accounts for each status." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, a.status, COUNT(a.account_id) AS account_coun...
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 character varying(64) NOT NULL, -- unique identifier for the account c...
[ { "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": "I want to see pairs of items from the same game that share the same rarity but are of different types. Show each pair's names and types." }, { "role": "assistant", "content": "SELECT a.game_id,\n a.item_name AS item1_name,\n a.item_type AS item1_type,\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 gaming_technology.in_game_items ( item_id.uuid, game_id.uuid, item_name.text, item_type.text, description.text, rarity....
[ { "role": "user", "content": "Count the total number of cases that are currently marked as 'Open'." }, { "role": "assistant", "content": "SELECT COUNT(*) FROM cases WHERE status = 'Open'" } ]
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.cases ( case_id.text, case_number.text, case_name.text, client_id.text, lead_lawyer_id.text, case_type.t...
[ { "role": "user", "content": "List all medical records, showing the record ID, record date, and the full name of the doctor who created the record. Include the patient ID as well." }, { "role": "assistant", "content": "SELECT mr.record_id, mr.record_date, mr.patient_id, d.first_name, d.last_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 healthcare.medical_records ( record_id character varying(64) NOT NULL, -- unique identifier for the medical record...
[ { "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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "For each chain, which centralized exchange holds the largest total USD value in their token balance as of the most recent snapshot?" }, { "role": "assistant", "content": "WITH latest_snapshot AS (\n SELECT MAX(snapshot_time) AS max_time FROM cex_token_balance\n)\nS...
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, -- fundraising record id project_id character varying(...
[ { "role": "user", "content": "How many diagnoses does each status have grouped by is_chronic flag?" }, { "role": "assistant", "content": "SELECT is_chronic, status, COUNT(*) AS count FROM healthcare.diagnoses GROUP BY is_chronic, 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 healthcare.diagnoses ( diagnosis_id text, record_id text, patient_id text, doctor_id text, diagnosis_code text, code_ty...
[ { "role": "user", "content": "For each developer, can you find the next developer in the same country using a self join, returning developer_ids and names?" }, { "role": "assistant", "content": "SELECT d1.developer_id AS current_dev,\n d1.name AS current_name,\n d2.develo...
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 PRIMARY KEY, name text, country text, founded_year int, website text, ...
[ { "role": "user", "content": "List all events and any token transfers that occurred in the same transaction, showing event_id, event_name, transfer_id, and token_symbol." }, { "role": "assistant", "content": "SELECT\n e.event_id,\n e.event_name,\n tt.transfer_id,\n tk.token_symbol\nFROM web3...
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 me a list of all properties along with their average overall review rating." }, { "role": "assistant", "content": "SELECT p.property_id, p.property_name, AVG(r.rating_overall) AS avg_rating\nFROM hospitality_technology.properties p\nJOIN hospitality_technology....
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": "I need to list the top 5 ERC20 tokens by total supply, including symbol, contract_address, and name." }, { "role": "assistant", "content": "SELECT tm.contract_address, tm.symbol, tm.name, CAST(tm.total_supply AS DECIMAL) AS total_supply\nFROM token_metas tm\nWHERE 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 token_metas ( block_timestamp.timestamp, block_number.bigint, transaction_hash.text, transaction_index.bigint, from_add...
[ { "role": "user", "content": "List all NFT collections where the floor price is greater than 0.5 ETH, including their names and contract addresses." }, { "role": "assistant", "content": "SELECT name, contract_address FROM nft_collections WHERE CAST(floor_price AS decimal) > 0.5 AND floor_price_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 token_metas ( block_timestamp timestamp(6) NOT NULL, -- Timestamp of the block when token metadata was recorded ...
[ { "role": "user", "content": "For each contract, can you list the token symbols and total supply of all tokens created by that contract, along with the contract's current status?" }, { "role": "assistant", "content": "SELECT c.contract_id, c.address AS contract_address, c.status, t.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 web3.contracts ( contract_id text, address text, abi text, bytecode text, deployer_address text, deployed_at timestamp,...
[ { "role": "user", "content": "I want to identify pairs of bookings that share the same payment_transaction_id, showing both booking IDs and the payment_transaction_id." }, { "role": "assistant", "content": "SELECT b1.booking_id AS booking1, b2.booking_id AS booking2, b1.payment_transaction_id\nF...
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.bookings ( booking_id.text, passenger_id.text, trip_id.text, seat_number.text, booking_time.timestamp, s...
[ { "role": "user", "content": "For each user with 'approved' KYC status, show their user ID and the total amount in their unspent UTXOs." }, { "role": "assistant", "content": "SELECT T1.user_id, SUM(T2.amount) FROM trading_platform.kyc_audit AS T1 JOIN trading_platform.utxos AS T2 ON T1.user_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 trading_platform.utxos ( utxo_id text, transaction_id text, output_index integer, address text, amount numeric, spent b...
[ { "role": "user", "content": "What are the fuel consumption rates per hour for the Boeing 747-8 model?" }, { "role": "assistant", "content": "I'm sorry, but I can't provide information on the fuel consumption rates for the Boeing 747-8 model as this data is not included in the aircraft_models ta...
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 all appointments along with the patient's full name and the doctor's full name." }, { "role": "assistant", "content": "SELECT\n a.appointment_id,\n a.appointment_time,\n p.first_name AS patient_first_name,\n p.last_name AS patient_last_name,\n d.first_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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "List all depot locations in the United States with their city and state information." }, { "role": "assistant", "content": "SELECT name, city, state_province FROM transportation.locations WHERE type = 'depot' AND country = 'United States';" }, { "role": "use...
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.locations ( location_id text PRIMARY KEY, name text, type text, address_line1 text, city text, state_pro...
[ { "role": "user", "content": "What is the performance review score for employee with ID 'EMP456' for the last quarter?" }, { "role": "assistant", "content": "I'm sorry, but I can't assist with information about performance review scores as this data is not included 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": "How many medications does each manufacturer have?" }, { "role": "assistant", "content": "SELECT manufacturer, COUNT(*) AS med_count\nFROM healthcare.medications\nGROUP BY manufacturer;" }, { "role": "user", "content": "Only include manufacturers with mor...
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, medication_name character varying(255) NOT NULL,...
[ { "role": "user", "content": "I need to find pairs of players who share the same email domain. For each pair, return player1_id, player2_id, and the shared domain." }, { "role": "assistant", "content": "SELECT p1.player_id AS player1_id,\n p2.player_id AS player2_id,\n LOWER(SPLIT_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 gaming_technology.players ( player_id.uuid, username.text, email.text, password_hash.text, registration_date.timestampt...
[ { "role": "user", "content": "List the names of services and the total number of times each service has been ordered. Only include services that have been ordered at least once." }, { "role": "assistant", "content": "SELECT T1.service_name, count(T2.order_id) AS order_count FROM hospitality_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 hospitality_technology.properties ( property_id character varying(64) NOT NULL, property_name character varying(255) NO...
[ { "role": "user", "content": "Which players have unlocked any achievement?" }, { "role": "assistant", "content": "SELECT DISTINCT player_id FROM player_achievements;" }, { "role": "user", "content": "Show me the player ID and the total number of points they've accumulated from all un...
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.achievements ( achievement_id.uuid, game_id.uuid, name.text, description.text, icon_url.text, points....
[ { "role": "user", "content": "Show me all contracts deployed on the 'ethereum' network along with their deployer addresses and the count of events emitted by each contract, sorted by event count in descending order." }, { "role": "assistant", "content": "SELECT c.address, c.deployer_address, 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 web3.contracts ( contract_id character varying(64) NOT NULL, -- unique identifier for the contract address cha...
[ { "role": "user", "content": "For each diagnosis, show the diagnosis code, description, and the full name of the doctor who made the diagnosis." }, { "role": "assistant", "content": "SELECT dgn.diagnosis_code, dgn.description, doc.first_name AS doctor_first_name, doc.last_name AS doctor_last_nam...
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": "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": "List the usernames and user IDs of all users whose bio contains the word 'developer'." }, { "role": "assistant", "content": "SELECT user_id, username\nFROM social_media.users\nWHERE bio ILIKE '%developer%';" } ]
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 character varying(64) NOT NULL, -- unique identifier for the user username charac...
[ { "role": "user", "content": "Find all medical records where the treatment plan includes 'physical therapy' and the patient has an active primary insurance plan, showing the patient ID, record date, and insurance provider details." }, { "role": "assistant", "content": "SELECT mr.patient_id, mr.r...
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, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "List all patients who do not have an email address on file, showing their patient_id, first_name, last_name, and phone_number." }, { "role": "assistant", "content": "SELECT patient_id,\n first_name,\n last_name,\n phone_number\nFROM healthcare.pati...
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, first_name text, last_name text, date_of_birth date, gender text, address text, ...
[ { "role": "user", "content": "Show me the average market cap and average 24-hour price change percentage for tokens on each chain." }, { "role": "assistant", "content": "SELECT chain, AVG(market_cap) AS average_market_cap, AVG(price_change_percentage_24h) AS average_price_change_24h FROM token_b...
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_basic_info ( coin_id character varying(100) NOT NULL, token_name character var...
[ { "role": "user", "content": "Provide every combination of medication name and insurance plan name." }, { "role": "assistant", "content": "SELECT m.medication_name, p.plan_name\nFROM healthcare.medications AS m\nCROSS JOIN healthcare.insurance_plans AS 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.diagnoses ( diagnosis_id character varying(64) NOT NULL, record_id character varying(64) NOT NULL, patient_i...
[ { "role": "user", "content": "List the top 3 tokens by net flow on the Binance chain, including their symbol and average cost." }, { "role": "assistant", "content": "SELECT token_symbol, net_flow, avg_cost FROM smart_money_token_performance WHERE chain = 'Binance' ORDER BY net_flow DESC 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 smart_money_token_performance ( token_address character varying(100) NOT NULL, -- the token's address token_symbol char...
[ { "role": "user", "content": "List all insurance products that have 'auto' in their product type and are currently active, showing their product name and base premium." }, { "role": "assistant", "content": "SELECT product_id, product_name, product_type, base_premium FROM insurance.insurance_prod...
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, first_name character varying(100) NOT NULL, last_name...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
2