conversations
listlengths
2
8
system
stringlengths
276
8.4k
[ { "role": "user", "content": "Find all pairs of wallets that share the same address_id but belong to different users." }, { "role": "assistant", "content": "SELECT\n w1.wallet_id AS wallet1,\n w1.user_id AS user1,\n w2.wallet_id AS wallet2,\n w2.user_id AS user2,\n w1.address_id\nFROM b...
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.wallets ( wallet_id character varying(64) NOT NULL, user_id character varying(64) NOT NULL, address_id chara...
[ { "role": "user", "content": "List all claims that have at least one document of type 'INVOICE', including the claim ID, incident date, estimated loss, and the document's file name." }, { "role": "assistant", "content": "SELECT c.claim_id, c.incident_date, c.estimated_loss, d.file_name\nFROM ins...
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, policy_id character varying(64) NOT NULL, customer_id chara...
[ { "role": "user", "content": "List all premium payments with status 'Completed', showing the payment ID, payment date, amount paid, and the first and last name of the customer who made the payment." }, { "role": "assistant", "content": "SELECT T1.payment_id, T1.payment_date, T1.amount_paid, T2.f...
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": "List all securities (security_id, ticker_symbol, security_name) that belong to the 'Technology' sector and have a currency of 'USD'." }, { "role": "assistant", "content": "SELECT security_id, ticker_symbol, security_name FROM financial_services.securities WHERE sect...
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.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "List all ERC20 tokens along with their contract addresses and the wallet address holding the largest balance for each token." }, { "role": "assistant", "content": "SELECT eb.contract_address, eb.wallet_address, eb.amount FROM erc20_balances eb WHERE (eb.contract_add...
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 erc20_balances ( block_number bigint, contract_address varchar, wallet_address varchar, amount varchar, pk varchar ) CR...
[ { "role": "user", "content": "Show me the list of all employees along with the name and city of the service location where their agency operates." }, { "role": "assistant", "content": "SELECT e.employee_id, e.first_name, e.last_name, sl.location_name, sl.city FROM government_services.employees e...
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": "How many achievements were unlocked in total in the year 2023?" }, { "role": "assistant", "content": "SELECT COUNT(*) FROM gaming_technology.player_achievements WHERE unlocked_at >= '2023-01-01 00:00:00+00' AND unlocked_at < '2024-01-01 00:00:00+00';" }, { "...
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 NOT NULL DEFAULT gen_random_uuid(), player_id uuid N...
[ { "role": "user", "content": "Show me every medication manufactured by 'Teva', including the medication ID and the name." }, { "role": "assistant", "content": "SELECT medication_id, medication_name\nFROM healthcare.medications\nWHERE manufacturer = 'Teva';" } ]
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": "I want to see each active agent and the total premium_amount of the policies they sold in 2024." }, { "role": "assistant", "content": "SELECT a.agent_id, a.first_name, a.last_name, SUM(p.premium_amount) AS total_premium\nFROM insurance.agents a\nJOIN insurance.polic...
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...
[ { "role": "user", "content": "List each payment's currency_code, total amount paid, and the number of service orders placed by the same guest for the same reservation." }, { "role": "assistant", "content": "SELECT p.payment_id,\n p.currency_code,\n p.amount AS payment_amount,\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.room_types ( room_type_id text, property_id text, type_name text, description text, base_rate nu...
[ { "role": "user", "content": "Show me all reservations with more than 2 adults, along with their property names and room types." }, { "role": "assistant", "content": "SELECT r.reservation_id, p.property_name, r.room_type_id, r.num_adults FROM hospitality_technology.reservations r JOIN hospitalit...
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": "List documents uploaded for cases of type 'Intellectual Property', showing the document name, upload timestamp, and the case number." }, { "role": "assistant", "content": "SELECT T1.document_name, T1.upload_timestamp, T2.case_number FROM documents AS T1 JOIN cases 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 legal_services.clients ( client_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "Find all review comments that have a staff response, showing the comment and the staff response date." }, { "role": "assistant", "content": "SELECT comment, response_date FROM reviews WHERE response_date IS NOT NULL;" }, { "role": "user", "content": "Now...
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.reviews ( review_id text PRIMARY KEY, property_id text, reservation_id text, guest_id text, rati...
[ { "role": "user", "content": "For applications approved in the past month, list the application ID, reference number, citizen's first and last name, and the number of related notifications sent." }, { "role": "assistant", "content": "SELECT a.application_id, a.reference_number, c.first_name, c.l...
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 each player's last_login and the end_time of their most recent game session." }, { "role": "assistant", "content": "SELECT p.player_id,\n p.username,\n p.last_login,\n gs.last_end_time\nFROM gaming_technology.players p\nLEFT JOIN (\n SELEC...
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": "Show me all doctors who have prescribed medications with frequency 'Once daily', along with the count of such prescriptions per doctor, sorted by the count in descending order." }, { "role": "assistant", "content": "SELECT d.first_name, d.last_name, COUNT(p.prescrip...
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": "I want to retrieve each client's full name along with the subject and start time of their appointments." }, { "role": "assistant", "content": "SELECT c.first_name || ' ' || c.last_name AS client_name, a.subject, a.start_time\nFROM legal_services.clients c\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 legal_services.clients ( client_id text PRIMARY KEY, first_name text, last_name text, company_name text, email text UNI...
[ { "role": "user", "content": "List each item's name, type, and rarity, along with the currency in which it can be purchased and its cost." }, { "role": "assistant", "content": "SELECT item_name, item_type, rarity, cost_currency, cost_amount FROM gaming_technology.in_game_items;" }, { "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 gaming_technology.in_game_items ( item_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for the ite...
[ { "role": "user", "content": "Find all patients who have been prescribed medications with dosage greater than 50mg, along with their medication details and prescribing doctor's name." }, { "role": "assistant", "content": "SELECT p.patient_id, p.first_name, p.last_name, pr.dosage, pr.medication_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.text, first_name.text, last_name.text, date_of_birth.date, gender.text, address.text, ...
[ { "role": "user", "content": "Which exchanges hold the largest total USD value of tokens on the BSC chain in the most recent snapshot, and what is the top token (by usd_value) held by each exchange?" }, { "role": "assistant", "content": "WITH latest_snapshot AS (\n SELECT MAX(snapshot_time) 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 cex_token_balance ( snapshot_time.text, chain.text, address.text, exchange.text, token_address.text, token_symbol.text,...
[ { "role": "user", "content": "List all pairs of lawyers who share the same last name but have different first names. Show the first name, last name, and lawyer ID for both lawyers in each pair." }, { "role": "assistant", "content": "SELECT l1.first_name AS lawyer1_first_name, l1.last_name AS law...
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.text, first_name.text, last_name.text, bar_number.text, firm_id.text, email.text, ph...
[ { "role": "user", "content": "List the first and last names of all lawyers who have worked on time entries for cases associated with clients from the company 'Innovatech Ltd'." }, { "role": "assistant", "content": "SELECT DISTINCT T1.first_name, T1.last_name FROM legal_services.lawyers AS T1 INN...
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": "For each sender address that has sent at least 10 transactions, show the address and the total gas used by their transactions." }, { "role": "assistant", "content": "SELECT from_address, SUM(gas_used) AS total_gas_used\nFROM web3.transactions\nGROUP BY from_address\...
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.transactions ( transaction_id.text, from_address.text, to_address.text, value.numeric, gas_used.integer, gas_price...
[ { "role": "user", "content": "Could you list all medications, including their name, manufacturer, and NDC code from the healthcare.medications table?" }, { "role": "assistant", "content": "SELECT medication_name, manufacturer, ndc_code FROM healthcare.medications;" }, { "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 healthcare.medications ( medication_id text PRIMARY KEY, medication_name text, generic_name text, manufacturer text, nd...
[ { "role": "user", "content": "Show me the first name, last name, and email address for all passengers who are part of the loyalty program with ID 'Gold'." }, { "role": "assistant", "content": "SELECT first_name , last_name , email FROM transportation.passengers WHERE loyalty_program_id = '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 transportation.routes ( route_id text PRIMARY KEY, route_number text, description text, origin_location_id text, destin...
[ { "role": "user", "content": "List the names of all agencies that do not have any associated service locations." }, { "role": "assistant", "content": "SELECT agency_name FROM government_services.agencies a WHERE NOT EXISTS (SELECT 1 FROM government_services.service_locations sl WHERE sl.agency_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 government_services.agencies ( agency_id text PRIMARY KEY, agency_name text, jurisdiction_level text, primary_contact_e...
[ { "role": "user", "content": "Get the full name of guests, the property name, check-in and check-out dates, and total amount for all reservations with more than 2 adults." }, { "role": "assistant", "content": "SELECT g.first_name || ' ' || g.last_name AS guest_full_name, p.property_name, r.check...
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": "For each ERC20 token contract, show the contract address and the total number of approval events recorded." }, { "role": "assistant", "content": "SELECT contract_address, COUNT(*) AS approval_count\nFROM erc20_approval\nGROUP BY contract_address;" }, { "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": "List the first and last names of citizens who have submitted documents with a verification status of 'Rejected', along with the document type and application reference number." }, { "role": "assistant", "content": "SELECT c.first_name, c.last_name, d.document_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 text, national_id_number text, first_name text, last_name text, date_of_birth...
[ { "role": "user", "content": "List all unique document types available in the system." }, { "role": "assistant", "content": "SELECT DISTINCT document_type FROM insurance.claim_documents;" } ]
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.claim_documents ( document_id text PRIMARY KEY, claim_id text, document_type text, file_name text, file_path ...
[ { "role": "user", "content": "List all pairs of narratives where the first narrative has a higher market_cap than the second. Display narrative1, narrative2, cap1, cap2." }, { "role": "assistant", "content": "SELECT n1.narrative AS narrative1, n2.narrative AS narrative2, n1.market_cap AS cap1, 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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume...
[ { "role": "user", "content": "List all pairs of games developed by the same developer, returning developer_id, title of the first game, and title of the second game." }, { "role": "assistant", "content": "SELECT g1.developer_id, g1.title AS game1, g2.title AS game2\nFROM gaming_technology.games ...
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, title.text, developer_id.uuid, publisher_id.uuid, genre.text, release_date.date...
[ { "role": "user", "content": "Show the total maintenance cost for each vehicle." }, { "role": "assistant", "content": "SELECT vehicle_id, SUM(cost) AS total_maintenance_cost FROM transportation.maintenance_logs GROUP BY vehicle_id;" }, { "role": "user", "content": "Can you also inclu...
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": "Find all users whose usernames contain numbers and have email addresses from either Gmail or Yahoo." }, { "role": "assistant", "content": "SELECT user_id, username, email FROM blockchain.users WHERE username ~ '[0-9]' AND (email LIKE '%@gmail.com' OR email LIKE '%@y...
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, ip_address text, port integer, last_seen timestamp ) CREATE TABLE blockchain.users ( ...
[ { "role": "user", "content": "List the email addresses and phone numbers of all active customers." }, { "role": "assistant", "content": "SELECT email, phone_number\nFROM insurance.customers\nWHERE status = 'Active';" } ]
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": "Show the full names and registration dates of citizens who have submitted applications with the status 'Processing'." }, { "role": "assistant", "content": "SELECT DISTINCT c.first_name, c.last_name, c.registration_date\nFROM government_services.citizens c\nJOIN gove...
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 each player's username and the total quantity of all items they possess." }, { "role": "assistant", "content": "SELECT p.username, SUM(pi.quantity) AS total_items FROM gaming_technology.player_inventory pi JOIN gaming_technology.players p ON pi.player_id = 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 gaming_technology.player_inventory ( inventory_id uuid NOT NULL DEFAULT gen_random_uuid(), -- unique identifier for...
[ { "role": "user", "content": "Calculate the total quantity traded for each asset, showing the asset name and symbol." }, { "role": "assistant", "content": "SELECT T1.name, T1.symbol, SUM(T2.quantity) FROM trading_platform.assets AS T1 JOIN trading_platform.trades AS T2 ON T1.asset_id = T2.asset_...
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": "For each route, list the route_number, origin city, destination city, and the total fare collected from completed bookings." }, { "role": "assistant", "content": "SELECT\n r.route_number,\n lo.city AS origin_city,\n ld.city AS destination_city,\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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, make text, model text, year int, t...
[ { "role": "user", "content": "Count the number of servers for each possible status recorded in the servers table." }, { "role": "assistant", "content": "SELECT status, COUNT(server_id) AS server_count FROM gaming_technology.servers GROUP BY status;" }, { "role": "user", "content": "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 gaming_technology.players ( player_id uuid NOT NULL DEFAULT gen_random_uuid(), username character varying(100) NOT NULL...
[ { "role": "user", "content": "List all users who have pending KYC reviews that were submitted more than 7 days ago, along with when they were submitted." }, { "role": "assistant", "content": "SELECT u.user_id, u.email, k.reviewed_at FROM trading_platform.users u JOIN trading_platform.kyc_audit k...
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": "Can you list all the policy numbers and their group_numbers for policies that will expire within the next 90 days from today?" }, { "role": "assistant", "content": "SELECT policy_number, group_number FROM healthcare.patient_insurance WHERE expiration_date BETWEEN CU...
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 character varying(64) NOT NULL, -- unique identifier for this p...
[ { "role": "user", "content": "Show the appointment ID, scheduled start time, and the full name of the citizen for all appointments related to services with a standard fee greater than 150." }, { "role": "assistant", "content": "SELECT a.appointment_id, a.scheduled_start_time, c.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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, first_name text, last_name text, d...
[ { "role": "user", "content": "Show me all managers (agents who have other agents reporting to them) along with their team sizes, sorted by team size in descending order." }, { "role": "assistant", "content": "SELECT m.agent_id, m.first_name, m.last_name, COUNT(a.agent_id) AS team_size FROM insur...
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 PRIMARY KEY, first_name text, last_name text, agency_name text, license_number text, l...
[ { "role": "user", "content": "List all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and belong to the 'Technology' sector." }, { "role": "assistant", "content": "SELECT security_id, ticker_symbol, security_name\nFROM financial_services.securities\...
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.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, ad...
[ { "role": "user", "content": "Get the total number of appointments grouped by status." }, { "role": "assistant", "content": "SELECT status,\n COUNT(*) AS appointment_count\nFROM healthcare.appointments\nGROUP BY status;" }, { "role": "user", "content": "Now filter to include on...
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": "For each department, list the top 3 most expensive services along with their service_name, price, and property_name." }, { "role": "assistant", "content": "SELECT department, service_name, price, property_name\nFROM (\n SELECT s.department,\n s.service_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 hospitality_technology.services ( service_id character varying(64) NOT NULL, property_id character varying(64) NOT NULL...
[ { "role": "user", "content": "How many likes has post 'P789' received in total?" }, { "role": "assistant", "content": "SELECT COUNT(*) AS total_likes\nFROM social_media.likes\nWHERE post_id = 'P789';" } ]
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": "Show me the hashtag IDs and their names." }, { "role": "assistant", "content": "SELECT hashtag_id, tag_name FROM social_media.hashtags;" }, { "role": "user", "content": "I also want to see when each hashtag was created." }, { "role": "assistant",...
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": "Find all combinations of insurance plans and medications where the plan type is 'HMO' and the medication's description mentions 'cream'. List the plan ID, plan name, medication ID, and medication name." }, { "role": "assistant", "content": "SELECT p.plan_id, p.plan_...
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 pairs of medications that share the same generic_name but are produced by different manufacturers. Include medication1_id, medication1_name, medication2_id, medication2_name, and the shared generic_name." }, { "role": "assistant", "content": "SELECT m1.medi...
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": "Find all patients who have active primary insurance plans from providers containing 'Blue' in their name, showing their full names and policy numbers." }, { "role": "assistant", "content": "SELECT p.first_name, p.last_name, pi.policy_number FROM healthcare.patients ...
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 contracts where the deployer address is the same as the contract address, indicating self-deployed contracts." }, { "role": "assistant", "content": "SELECT address, deployer_address FROM web3.contracts WHERE address = deployer_address;" } ]
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": "List the plan_name, contact_phone, and website for all insurance plans offered by 'Optima Health'." }, { "role": "assistant", "content": "SELECT plan_name,\n contact_phone,\n website\nFROM healthcare.insurance_plans\nWHERE insurance_provider = 'Optima He...
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 PRIMARY KEY, plan_name text, insurance_provider text, plan_type text, contact...
[ { "role": "user", "content": "Show me the top 5 projects by valuation that have completed fundraising rounds in the last 12 months, along with their token symbol and price from the token_basic_info table." }, { "role": "assistant", "content": "SELECT pfr.project_name, pfr.valuation, tbi.token_sy...
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": "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 social_media.comments ( comment_id text, post_id text, user_id text, parent_comment_id text, content text, created_at t...
[ { "role": "user", "content": "Retrieve review comments with their reservation's check-in and check-out dates." }, { "role": "assistant", "content": "SELECT rv.comment, r.check_in_date, r.check_out_date\nFROM hospitality_technology.reviews rv\nJOIN hospitality_technology.reservations r ON rv.rese...
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, property_id character varying(64) NOT NULL, room...
[ { "role": "user", "content": "What is the total number of drivers hired each year? Provide the hire_year and driver_count." }, { "role": "assistant", "content": "SELECT EXTRACT(YEAR FROM hire_date) AS hire_year,\n COUNT(*) AS driver_count\nFROM transportation.drivers\nGROU...
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.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens...
[ { "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": "Show me the top 5 blocks with the highest difficulty, along with the username of the user who owns the wallet associated with the merkle_root address." }, { "role": "assistant", "content": "SELECT b.block_id, b.difficulty, w.user_id\nFROM blockchain.blocks b\nJOIN b...
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.blocks ( block_id text, previous_block_id text, timestamp timestamp, nonce integer, merkle_root text, diffic...
[ { "role": "user", "content": "List all users who joined after May 1, 2024." }, { "role": "assistant", "content": "SELECT user_id, username, email, full_name, created_at\nFROM social_media.users\nWHERE created_at > '2024-05-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 social_media.users ( user_id text, username text, email text, password_hash text, full_name text, profile_picture_url t...
[ { "role": "user", "content": "Show me the top 3 tokens by USD value inflow where smart money was buying (type = 1), along with their token symbol and narrative." }, { "role": "assistant", "content": "SELECT token_symbol, narrative, usd_value FROM smart_money_token_inflow WHERE type = 1 ORDER BY ...
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": "Find all peers that haven't been active for more than 30 days, along with their IP addresses." }, { "role": "assistant", "content": "SELECT peer_id, ip_address FROM trading_platform.peers WHERE last_seen < NOW() - INTERVAL '30 days'" }, { "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 trading_platform.wallets ( wallet_id.text, user_id.text, address.text, private_key.text, created_at.timestamp ) CREATE ...
[ { "role": "user", "content": "Show all service orders with the service_id, guest's full name, and the status of each order." }, { "role": "assistant", "content": "SELECT so.order_id, so.service_id, g.first_name, g.last_name, so.status\nFROM hospitality_technology.service_orders so\nJOIN hospital...
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": "List all maintenance logs for vehicles that had 'Tire Rotation' service in the last 6 months, showing vehicle ID and service date." }, { "role": "assistant", "content": "SELECT vehicle_id, service_date FROM transportation.maintenance_logs WHERE service_type = 'Tire ...
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.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "Find the token with the highest total supply and show its name, symbol, and contract address." }, { "role": "assistant", "content": "SELECT token_name, token_symbol, contract_address FROM web3.tokens ORDER BY total_supply 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 web3.tokens ( token_id text, contract_address text, token_name text, token_symbol text, decimals integer, total_supply ...
[ { "role": "user", "content": "List all prescriptions with the corresponding patient's emergency contact name and phone number. Show prescription ID, patient full name, emergency contact name, and emergency contact phone." }, { "role": "assistant", "content": "SELECT pr.prescription_id, p.first_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.patients ( patient_id character varying(64) NOT NULL, first_name character varying(100) NOT NULL, last_name ...
[ { "role": "user", "content": "List all maintenance service records for vehicles that have successfully completed any trip." }, { "role": "assistant", "content": "SELECT DISTINCT ml.* FROM transportation.maintenance_logs AS ml JOIN transportation.trips AS t ON ml.vehicle_id = t.vehicle_id WHERE 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 transportation.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "List the first name, last name, and email of all customers who live in New York or California." }, { "role": "assistant", "content": "SELECT first_name, last_name, email FROM insurance.customers WHERE state IN ('NY', 'CA');" } ]
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": "List all users who performed more than 10 'view' actions in the logs, along with their action counts." }, { "role": "assistant", "content": "SELECT user_id, COUNT(log_id) AS view_action_count FROM trading_platform.logs WHERE action = 'view' GROUP BY user_id HAVING 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 trading_platform.assets ( asset_id text, name text, symbol text, type text ) CREATE TABLE trading_platform.logs ( log_i...
[ { "role": "user", "content": "Provide a count of appointments grouped by their current status." }, { "role": "assistant", "content": "SELECT status, COUNT(*) FROM government_services.appointments 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 government_services.citizens ( citizen_id character varying(64) NOT NULL, -- unique identifier for the citizen ...
[ { "role": "user", "content": "Give me the number of securities and the latest update timestamp for each security_type." }, { "role": "assistant", "content": "SELECT security_type,\n COUNT(*) AS security_count,\n MAX(last_updated) AS latest_update\nFROM financial_services.securities\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.securities ( security_id text PRIMARY KEY, ticker_symbol text, isin_code text, cusip_code text, secu...
[ { "role": "user", "content": "Show me all securities (security_id, ticker_symbol, security_name) that are traded on the NASDAQ exchange and have a daily trading volume exceeding 1 million shares, along with the account details (account_id, account_number, balance) of customers who hold these securities in 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 financial_services.accounts ( account_id text, customer_id text, account_number text, account_type text, balance numeri...
[ { "role": "user", "content": "List all active staff members who are managers, along with their hire dates and email addresses." }, { "role": "assistant", "content": "SELECT staff_id, first_name, last_name, hire_date, work_email FROM hospitality_technology.staff WHERE is_active = true AND positio...
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 me the top 10 NFT collections with the highest token count, along with their names, symbols, and floor prices." }, { "role": "assistant", "content": "SELECT name, symbol, floor_price, token_count FROM nft_collections ORDER BY token_count DESC LIMIT 10;" }, ...
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, block_number bigint NOT NULL, transaction_hash varchar NOT NULL, t...
[ { "role": "user", "content": "Could you list each game title along with its developer's name and the total number of servers hosting it?" }, { "role": "assistant", "content": "SELECT g.title, d.name AS developer_name, COUNT(s.server_id) AS server_count\nFROM gaming_technology.games g\nLEFT JOIN ...
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, title text, developer_id uuid, publisher_id uuid, genre text, release_date date...
[ { "role": "user", "content": "List all invoices issued between '2024-01-01' and '2024-06-30', including the invoice_number, issue_date, total_amount, client's first and last name, and the case_name. Order the results by issue_date ascending." }, { "role": "assistant", "content": "SELECT i.invoic...
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": "Which drivers have licenses expiring before 2025-01-01, and what are their first and last names along with the license expiry date?" }, { "role": "assistant", "content": "SELECT driver_id, first_name, last_name, license_expiry_date FROM transportation.drivers WHERE ...
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.drivers ( driver_id.text, employee_id.text, first_name.text, last_name.text, license_number.text, licens...
[ { "role": "user", "content": "Find all pairs of appointments that are scheduled for the same case and overlap in time. Show the IDs of the two overlapping appointments and the shared case ID." }, { "role": "assistant", "content": "SELECT t1.appointment_id AS appointment1_id, t2.appointment_id 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 legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, case_id.text, start_time.timestamp, ...
[ { "role": "user", "content": "How many documents are in each verification status?" }, { "role": "assistant", "content": "SELECT verification_status, COUNT(*) FROM documents GROUP BY verification_status" }, { "role": "user", "content": "For 'Verified' documents, show the count uploade...
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 character varying(64) NOT NULL, application_id character varying(64), citiz...
[ { "role": "user", "content": "List the order ID, type, and quantity for all orders placed using the wallet with ID 'wallet123'." }, { "role": "assistant", "content": "SELECT order_id, order_type, quantity FROM orders WHERE wallet_id = 'wallet123'" }, { "role": "user", "content": "Als...
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": "Show the usernames of players who have started at least one game session." }, { "role": "assistant", "content": "SELECT DISTINCT T1.username FROM gaming_technology.players AS T1 JOIN gaming_technology.game_sessions AS T2 ON T1.player_id = T2.player_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 gaming_technology.players ( player_id uuid, username text, email text, password_hash text, registration_date timestamp ...
[ { "role": "user", "content": "List all tokens along with the contract addresses for symbols that appear more than once." }, { "role": "assistant", "content": "SELECT t.token_id, t.token_symbol, t.contract_address\nFROM web3.tokens t\nJOIN (\n SELECT token_symbol\n FROM web3.tokens\n GROUP BY ...
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 text PRIMARY KEY, contract_address text, token_name text, token_symbol text, decimals int, total...
[ { "role": "user", "content": "For each token, show the token_id and the total number of unique addresses that have ever received it." }, { "role": "assistant", "content": "SELECT token_id, COUNT(DISTINCT to_address) AS unique_recipients\nFROM web3.token_transfers\nGROUP BY token_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 web3.token_transfers ( transfer_id character varying(64) NOT NULL, -- unique identifier for the transfer token...
[ { "role": "user", "content": "List all users and the total value of all transactions they have initiated. Show user_id, username, and total_transaction_value." }, { "role": "assistant", "content": "SELECT u.user_id, u.username, COALESCE(SUM(t.value), 0) AS total_transaction_value\nFROM web3.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 web3.contracts ( contract_id character varying(64) NOT NULL, -- unique identifier for the contract address cha...
[ { "role": "user", "content": "Which vehicles have a total maintenance cost exceeding 10000 across all their maintenance logs?" }, { "role": "assistant", "content": "SELECT vehicle_id, SUM(cost) AS total_maintenance_cost FROM transportation.maintenance_logs GROUP BY vehicle_id HAVING SUM(cost) > ...
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 all service orders including order_id, service_name, guest full name, order_timestamp, and status for orders placed in the 'Spa' category." }, { "role": "assistant", "content": "SELECT so.order_id, s.service_name, CONCAT(g.first_name, ' ', g.last_name) AS g...
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": "Find all customers whose email address ends with '@gmail.com'. Please show the customer_id, first name, and email." }, { "role": "assistant", "content": "SELECT customer_id, first_name, email FROM insurance.customers WHERE email LIKE '%@gmail.com';" }, { "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 insurance.customers ( customer_id.text, first_name.text, last_name.text, date_of_birth.date, ssn_hash.text, address_lin...
[ { "role": "user", "content": "Show me the total number of invoices issued." }, { "role": "assistant", "content": "SELECT COUNT(*) FROM invoices;" }, { "role": "user", "content": "How many invoices were issued in each status?" }, { "role": "assistant", "content": "SELECT 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 legal_services.invoices ( invoice_id.text, invoice_number.text, client_id.text, case_id.text, issue_date.date, due_date...
[ { "role": "user", "content": "For all claims filed in 2024, show the claim ID, incident date, policy number, and the name of the associated insurance product." }, { "role": "assistant", "content": "SELECT c.claim_id, c.incident_date, p.policy_number, ip.product_name\nFROM insurance.claims c\nJOI...
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 the first name and last name of the driver and the license plate of the vehicle used for each trip." }, { "role": "assistant", "content": "SELECT T1.first_name , T1.last_name , T3.license_plate FROM transportation.drivers AS T1 JOIN transportation.trips AS T2 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 transportation.vehicles ( vehicle_id.text, license_plate.text, vin.text, make.text, model.text, year.integer, type.text...
[ { "role": "user", "content": "Give me a count of employees hired in each department for employees currently active or terminated." }, { "role": "assistant", "content": "SELECT department, status, COUNT(employee_id) AS employee_count FROM financial_services.employees WHERE status IN ('Active', '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 financial_services.employees ( employee_id character varying(64) NOT NULL, -- unique identifier for the employee ...
[ { "role": "user", "content": "List all invoices that do not have any associated documents for their case. Show the invoice number, total amount, and case_id." }, { "role": "assistant", "content": "SELECT i.invoice_number, i.total_amount, i.case_id\nFROM legal_services.invoices i\nLEFT JOIN legal...
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, first_name character varying(100) NOT NULL, last_nam...
[ { "role": "user", "content": "Give me the count of developers per country." }, { "role": "assistant", "content": "SELECT country,\n COUNT(*) AS developer_count\nFROM gaming_technology.developers\nGROUP BY country;\n" }, { "role": "user", "content": "Actually, include only 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 gaming_technology.developers ( developer_id uuid, name text, country text, founded_year integer, website text, created_...
[ { "role": "user", "content": "Find narrative pairs where the sum of their price_change_percentage_1h is greater than 5. Show narrative1, change1, narrative2, change2, and the sum as total_change." }, { "role": "assistant", "content": "SELECT n1.narrative AS narrative1, n1.price_change_percentage...
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 narrative_info ( narrative.text, top_3_coins.text, price_change_percentage_1h.numeric, price_change_percentage_24h.nume...
[ { "role": "user", "content": "For the 'Binance-Smart-Chain' chain, list the total USD value of tokens held by each centralized exchange. Display the exchange name and the calculated total USD value, ordered by total value descending." }, { "role": "assistant", "content": "SELECT exchange, SUM(us...
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": "List the names of employees and the names of the cities where their agency operates service locations." }, { "role": "assistant", "content": "SELECT e.first_name, e.last_name, sl.city\nFROM government_services.employees e\nJOIN government_services.service_locations ...
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": "List all fuel logs where the fuel type is diesel and the quantity is more than 50 liters, including the vehicle ID and total cost." }, { "role": "assistant", "content": "SELECT fuel_log_id, vehicle_id, trip_id, log_timestamp, quantity, total_cost FROM transportation...
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.drivers ( driver_id text, employee_id text, first_name text, last_name text, license_number text, licens...
[ { "role": "user", "content": "Identify agents who have sold overlapping policies. Return agent_id, policy_number1, policy_number2, and their coverage dates." }, { "role": "assistant", "content": "SELECT p1.agent_id,\n p1.policy_number AS policy_number1,\n p2.policy_number AS policy_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 insurance.policies ( policy_id character varying(64) NOT NULL, -- unique identifier for the policy customer_id ...
[ { "role": "user", "content": "List all NFT collections and their current floor price." }, { "role": "assistant", "content": "SELECT name, floor_price FROM nft_collections" }, { "role": "user", "content": "Also include the number of tokens in each collection." }, { "role": "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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transaction_index integer, transaction_hash ...