system stringlengths 3.56k 8.72k | conversations listlengths 4 26 |
|---|---|
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 government_services.services ( service_id text PRIMARY KEY, agency_id text, service_n... | [
{
"role": "user",
"content": "For each type of entity a notification can be related to, how many notifications have been successfully sent?"
},
{
"role": "assistant",
"content": "SELECT related_entity_type, COUNT(*) AS sent_notification_count FROM government_services.notifications WHERE status =... |
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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transactio... | [
{
"role": "user",
"content": "Show me all wallet addresses that hold more than 3 different NFTs from any ERC1155 contract. For each wallet, list the contract address and the count of distinct token_ids."
},
{
"role": "assistant",
"content": "SELECT contract_address, wallet_address, COUNT(DISTINC... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp, block_number bigint, transaction_hash varcha... | [
{
"role": "user",
"content": "List the top 5 Avalanche tokens by total transfer volume in token_activities_avalanche."
},
{
"role": "assistant",
"content": "SELECT tick, SUM(amt) AS total_volume\nFROM token_activities_avalanche\nGROUP BY tick\nORDER BY total_volume DESC\nLIMIT 5;"
},
{
"... |
You are an 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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transactio... | [
{
"role": "user",
"content": "Show me the current ERC20 token balances for the wallet address '0x1A2b3C4dE5f6A7b8C9d0E1f2A3b4C5d6E7f8A9b0'."
},
{
"role": "assistant",
"content": "SELECT contract_address, amount FROM erc20_balances WHERE wallet_address = '0x1A2b3C4dE5f6A7b8C9d0E1f2A3b4C5d6E7f8A9b... |
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 insurance.customers ( customer_id character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "List the customer ID, first_name, last_name, city, and the number of active policies each customer has, but only include customers who live in 'CA' and have at least 2 active policies."
},
{
"role": "assistant",
"content": "SELECT cu.customer_id, cu.first_name, cu.l... |
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
// Use Hashes to store station details. Key format: station:<station_id>
// Example:
// HSET stati... | [
{
"role": "user",
"content": "能否帮我查询特定路线(route_id 为 'route_ne_corr')上的所有车站信息,并包含每个车站的平台数量?"
},
{
"role": "assistant",
"content": "ZRANGE route:route_ne_corr:stops 0 -1\nHGETALL route_station:<route_station_id> for each route_station_id in result\nHGETALL station:<station_id> for each station_id ... |
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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, ... | [
{
"role": "user",
"content": "Retrieve the service names, location names, and cities for active services offered at accessible locations in California."
},
{
"role": "assistant",
"content": "SELECT s.service_name,\n sl.location_name,\n sl.city\nFROM government_services.services AS s\... |
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
// Node Label: :Station
// Properties:
// station_id: String (Constraint: UNIQUE)
// station_n... | [
{
"role": "user",
"content": "能否帮我统计特定车站(station_id 为 'station_xyz')的所有工作人员数量?"
},
{
"role": "assistant",
"content": "MATCH (s:Station {station_id: 'station_xyz'})<-[:BASED_AT]-(staff:Staff)\nRETURN COUNT(staff) AS total_staff"
},
{
"role": "user",
"content": "What is the manufacturi... |
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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifie... | [
{
"role": "user",
"content": "List all users who have a non-empty bio and a profile picture URL."
},
{
"role": "assistant",
"content": "SELECT\n user_id,\n username,\n full_name,\n bio,\n profile_picture_url\nFROM social_media.users\nWHERE\n bio IS NOT NULL AND profile_picture_url IS NOT N... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, tr... | [
{
"role": "user",
"content": "Show me wallet addresses that hold more than 1000 of any ERC20 token, along with the token symbol and amount."
},
{
"role": "assistant",
"content": "SELECT eb.wallet_address, tm.symbol, eb.amount FROM erc20_balances eb JOIN token_metas tm ON eb.contract_address = tm... |
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 government_services.employees (
employee_id character varying(64) NOT NULL, -- un... | [
{
"role": "user",
"content": "List the first name, last name, and job title of each employee, along with the job title of their manager."
},
{
"role": "assistant",
"content": "SELECT e.first_name AS employee_first_name, e.last_name AS employee_last_name, e.job_title AS employee_job_title, m.job_... |
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 government_services.citizens (
citizen_id character varying(64) NOT NULL, -- uni... | [
{
"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;"
},
{
"role": "user",
"content": "Show me all appointments where the su... |
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 government_services.citizens ( citizen_id character varying(64) NOT NULL, national_id... | [
{
"role": "user",
"content": "List the sent notifications related to appointments, including notification ID, message subject, citizen full name, and scheduled start time of the appointment."
},
{
"role": "assistant",
"content": "SELECT\n n.notification_id,\n n.message_subject,\n c.first_name... |
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 transportation.locations ( location_id text PRIMARY KEY, name text, type text, addres... | [
{
"role": "user",
"content": "What is the average cost per unit for fuel at each location type? Show the location type and the average cost."
},
{
"role": "assistant",
"content": "SELECT T2.type , AVG(T1.cost_per_unit) FROM transportation.fuel_logs AS T1 JOIN transportation.locations AS T2 ON T... |
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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising recor... | [
{
"role": "user",
"content": "Calculate the average 24-hour trading volume for all tokens listed in DEX pools on the 'BSC' chain."
},
{
"role": "assistant",
"content": "SELECT AVG(volume_24h) FROM token_dexpool_info WHERE chain = 'BSC'"
},
{
"role": "user",
"content": "List all insur... |
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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising recor... | [
{
"role": "user",
"content": "Show me the top 5 projects by valuation that completed fundraising rounds in the last 3 months, along with their narrative information if available."
},
{
"role": "assistant",
"content": "SELECT pfr.project_name, pfr.valuation, pfr.rounds_name, pfr.investment_date, ... |
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 erc1155_approval_for_all ( block_number bigint, block_timestamp timestamp, transactio... | [
{
"role": "user",
"content": "Can you list all SUI coins with 'active' status and their owner addresses and balances?"
},
{
"role": "assistant",
"content": "SELECT object_id, coin_type, owner, balance\nFROM sui_coins\nWHERE status = 'active';"
},
{
"role": "user",
"content": "Add the... |
You are an 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 social_media.users ( user_id.text, username.text, email.text, password_hash.text, ful... | [
{
"role": "user",
"content": "Show the usernames and their profile picture URLs for users who have a profile picture set and are also verified."
},
{
"role": "assistant",
"content": "SELECT username, profile_picture_url FROM social_media.users WHERE profile_picture_url IS NOT NULL AND profile_pi... |
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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth... | [
{
"role": "user",
"content": "List the plan_id, plan_name, and plan_type for all insurance plans where the insurance_provider is 'Humana'."
},
{
"role": "assistant",
"content": "SELECT\n plan_id,\n plan_name,\n plan_type\nFROM healthcare.insurance_plans\nWHERE\n insurance_provider = 'Humana'... |
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 web3.events ( event_id.text, contract_id.text, event_name.text, data.text, emitted_at... | [
{
"role": "user",
"content": "Find all users and the total value of transactions they have received, showing user_id, username, and total_received_value."
},
{
"role": "assistant",
"content": "SELECT u.user_id,\n u.username,\n COALESCE(SUM(t.value), 0) AS total_received_value\nFROM w... |
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 financial_services.trades ( trade_id character varying(64) NOT NULL, account_id chara... | [
{
"role": "user",
"content": "Show me the total number of trades and the sum of total_amount for each status in the trades table."
},
{
"role": "assistant",
"content": "SELECT\n t.status,\n COUNT(t.trade_id) AS trade_count,\n SUM(t.total_amount) AS total_amount_by_status\nFROM financial_servi... |
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 legal_services.lawyers (
lawyer_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Show each lawyer's first and last name along with the number of open cases they lead, ordered by the highest number of open cases first."
},
{
"role": "assistant",
"content": "SELECT l.first_name, l.last_name, COUNT(c.case_id) AS open_case_count\nFROM legal_services... |
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 insurance.policies ( policy_id character varying(64) NOT NULL, customer_id character ... | [
{
"role": "user",
"content": "List all replacement policies where a customer received a new policy starting the day after their previous policy was cancelled. Return customer_id, original_policy_id, original_cancellation_date, new_policy_id, new_start_date."
},
{
"role": "assistant",
"content": ... |
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. You are an expert in writing database language and you can refuse the user's question if the question is not related... | [
{
"role": "user",
"content": "What is the schedule of trains arriving at station with ID 'ST789' tomorrow?"
},
{
"role": "assistant",
"content": "I'm sorry, but I can't provide the train schedule for station ID 'ST789' as this information is not available in the current database. The table only ... |
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
// PUT /schedules
{
"mappings": {
"properties": {
"schedule_id": { "type": "keyword" }... | [
{
"role": "user",
"content": "能否帮我统计数据库中所有乘客的数量,按忠诚计划ID分组?"
},
{
"role": "assistant",
"content": "SELECT loyalty_program_id, COUNT(*) as passenger_count\nFROM passengers\nGROUP BY loyalty_program_id;"
},
{
"role": "user",
"content": "Find the total number of distinct lawyers and dist... |
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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth... | [
{
"role": "user",
"content": "Show the plan name and insurance provider for all insurance plans along with the total number of unique patients enrolled in each plan."
},
{
"role": "assistant",
"content": "SELECT ip.plan_name, ip.insurance_provider, COUNT(DISTINCT pi.patient_id) AS enrolled_patie... |
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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising recor... | [
{
"role": "user",
"content": "List narratives that have a 24-hour trading volume exceeding $50,000,000 and include at least 100 distinct tokens. Show the narrative name, volume, and token count."
},
{
"role": "assistant",
"content": "SELECT narrative, volume_24h, token_num FROM narrative_info WH... |
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 smart_money_token_performance ( token_address character varying(100) NOT NULL, -- the... | [
{
"role": "user",
"content": "What is the average ROI for tokens with a realized ratio above 50% across all chains?"
},
{
"role": "assistant",
"content": "SELECT AVG(roi) AS average_roi FROM smart_money_token_performance WHERE realized_ratio > 50;"
},
{
"role": "user",
"content": "Fi... |
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 transportation.vehicles ( vehicle_id text PRIMARY KEY, license_plate text, vin text, ... | [
{
"role": "user",
"content": "Show the full name and email of each driver and the number of vehicles currently assigned to their depot."
},
{
"role": "assistant",
"content": "SELECT d.first_name, d.last_name, d.email, COUNT(v.vehicle_id) AS vehicles_at_depot\nFROM transportation.drivers d\nJOIN ... |
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 government_services.citizens ( citizen_id text PRIMARY KEY, national_id_number text, ... | [
{
"role": "user",
"content": "List the city and the count of accessible and inaccessible service locations separately. Return city, accessible_count, and inaccessible_count."
},
{
"role": "assistant",
"content": "SELECT city,\n SUM(CASE WHEN is_accessible THEN 1 ELSE 0 END) AS accessible_c... |
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 government_services.documents ( document_id character varying(64) NOT NULL, applicati... | [
{
"role": "user",
"content": "How many documents of each type currently have a verification_status of 'Pending'?"
},
{
"role": "assistant",
"content": "SELECT\n document_type,\n COUNT(*) AS pending_count\nFROM government_services.documents\nWHERE verification_status = 'Pending'\nGROUP BY docum... |
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 government_services.citizens ( citizen_id.text, national_id_number.text, first_name.t... | [
{
"role": "user",
"content": "Count the total number of employees who have a direct manager assigned."
},
{
"role": "assistant",
"content": "SELECT COUNT(employee_id) FROM government_services.employees WHERE manager_employee_id IS NOT NULL;"
},
{
"role": "user",
"content": "For each ... |
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 social_media.users ( user_id character varying(64) NOT NULL, username character varyi... | [
{
"role": "user",
"content": "Which hashtags have never been used in any post? Show their tag_name and creation date."
},
{
"role": "assistant",
"content": "SELECT h.tag_name, h.created_at\nFROM social_media.hashtags h\nLEFT JOIN social_media.post_hashtags ph ON h.hashtag_id = ph.hashtag_id\nWHE... |
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 social_media.users ( user_id character varying(64) NOT NULL, username character varyi... | [
{
"role": "user",
"content": "List all posts that have received at least one like and at least one comment, showing the post_id and the total number of likes and comments each has."
},
{
"role": "assistant",
"content": "SELECT p.post_id, COUNT(DISTINCT l.like_id) AS like_count, COUNT(DISTINCT c.... |
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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifie... | [
{
"role": "user",
"content": "List the post_id and the count of distinct hashtags associated with each post that has at least 3 hashtags."
},
{
"role": "assistant",
"content": "SELECT ph.post_id, COUNT(DISTINCT ph.hashtag_id) AS hashtag_count FROM social_media.post_hashtags ph GROUP BY ph.post_i... |
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 financial_services.accounts ( account_id text, customer_id text, account_number text,... | [
{
"role": "user",
"content": "For each trade in the past 14 days, show the trade_id, account_id, security_id, and the latest close_price for that security from market_data."
},
{
"role": "assistant",
"content": "SELECT tr.trade_id, tr.account_id, tr.security_id, md.close_price AS latest_close_pr... |
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 hospitality_technology.rooms (
room_id character varying(64) NOT NULL, -- unique... | [
{
"role": "user",
"content": "List all properties and the room types they offer, including the base rate for each room type."
},
{
"role": "assistant",
"content": "SELECT T1.property_name, T2.type_name, T2.base_rate FROM hospitality_technology.properties AS T1 JOIN hospitality_technology.room_ty... |
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 gaming_technology.games ( game_id uuid PRIMARY KEY, title text, developer_id uuid, pu... | [
{
"role": "user",
"content": "Could you provide a report showing each in-game item's name and the total quantity currently held in player inventories?"
},
{
"role": "assistant",
"content": "SELECT ii.item_name, SUM(pi.quantity) AS total_held FROM gaming_technology.player_inventory pi JOIN gaming... |
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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising recor... | [
{
"role": "user",
"content": "Which tokens have a current price above $20 and belong to the 'DeFi' narrative?"
},
{
"role": "assistant",
"content": "SELECT token_symbol, token_name, chain, price\nFROM token_basic_info\nWHERE price > 20 AND narrative = 'DeFi';"
},
{
"role": "user",
"c... |
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 transportation.vehicles (
vehicle_id character varying(64) NOT NULL, -- unique i... | [
{
"role": "user",
"content": "For each route, show the route_number, origin and destination location names with their cities, and the average departure delay (in minutes) for trips where actual_departure was later than scheduled_departure."
},
{
"role": "assistant",
"content": "SELECT r.route_nu... |
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 social_media.users (
user_id character varying(64) NOT NULL, -- unique identifie... | [
{
"role": "user",
"content": "Count the number of posts that have a media URL but no textual content."
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.posts AS T1 WHERE T1.media_url IS NOT NULL AND (T1.content IS NULL OR T1.content = '');"
},
{
"role": "user",
... |
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 web3.wallets ( wallet_id text, user_id text, address text, private_key text, created_... | [
{
"role": "user",
"content": "Find pairs of wallet IDs that belong to the same user, showing the user ID and the two wallet IDs."
},
{
"role": "assistant",
"content": "SELECT w1.user_id, w1.wallet_id AS wallet1_id, w2.wallet_id AS wallet2_id FROM web3.wallets w1 JOIN web3.wallets w2 ON w1.user_i... |
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 transportation.routes ( route_id character varying(64) NOT NULL, route_number charact... | [
{
"role": "user",
"content": "Please provide a list of all trips along with their route details, including the route_number, origin city, and destination city, ordered by scheduled_departure."
},
{
"role": "assistant",
"content": "SELECT t.trip_id,\n t.vehicle_id,\n t.driver_id,\n ... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
CREATE TABLE token_metas ( block_timestamp timestamp(6) NOT NULL, block_number bigint NOT NULL, tr... | [
{
"role": "user",
"content": "For all NFT collections on the Ethereum blockchain, show me the collection name and the current floor price. Sort by floor price descending."
},
{
"role": "assistant",
"content": "SELECT name, floor_price FROM nft_collections WHERE blockchain = 'Ethereum' ORDER BY C... |
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 gaming_technology.players (
player_id uuid NOT NULL DEFAULT gen_random_uuid(), --... | [
{
"role": "user",
"content": "Could you provide the total number of game sessions and the number of distinct players for each game genre? Display the genre, session count, and player count."
},
{
"role": "assistant",
"content": "SELECT g.genre, COUNT(gs.session_id) AS session_count, COUNT(DISTIN... |
You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement. ##Table Structure
CREATE TABLE blockchain.smart_contracts ( contract_id text PRIMARY KEY, creator_address text, code... | [
{
"role": "user",
"content": "Show me the earliest created smart contract for each creator address."
},
{
"role": "assistant",
"content": "SELECT DISTINCT ON (creator_address) contract_id, creator_address, code, timestamp FROM blockchain.smart_contracts ORDER BY creator_address, timestamp ASC;"
... |
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 hospitality_technology.properties (
property_id character varying(64) NOT NULL, ... | [
{
"role": "user",
"content": "Get the property name, room type name, base rate, and star rating for all room types with a base_rate above 200 in properties located in the USA, sorted by base_rate in descending order."
},
{
"role": "assistant",
"content": "SELECT p.property_name, rt.type_name, rt... |
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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birth... | [
{
"role": "user",
"content": "How many patients have at least one medical record associated with them?"
},
{
"role": "assistant",
"content": "SELECT COUNT(DISTINCT patient_id) FROM healthcare.medical_records;"
},
{
"role": "user",
"content": "Now, can you show me the count of patient... |
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 gaming_technology.player_achievements ( player_achievement_id.uuid, player_id.uuid, a... | [
{
"role": "user",
"content": "List each player's most recent achievement unlock, showing the player_id, achievement_id, and unlocked_at timestamp."
},
{
"role": "assistant",
"content": "SELECT pa.player_id, pa.achievement_id, pa.unlocked_at FROM gaming_technology.player_achievements pa INNER JOI... |
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 financial_services.market_data ( data_point_id bigserial NOT NULL, security_id charac... | [
{
"role": "user",
"content": "Provide for each security its ticker_symbol, the most recent close_price and corresponding timestamp."
},
{
"role": "assistant",
"content": "SELECT s.ticker_symbol, md.close_price, md.data_timestamp\nFROM financial_services.market_data md\nJOIN financial_services.se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.