system stringlengths 315 8.06k | conversations listlengths 2 48 |
|---|---|
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.post_hashtags ( post_hashtag_id text, post_id text, hashtag_id text )
C... | [
{
"role": "user",
"content": "How many unique hashtags has each post been associated with? Please return post_id and unique_hashtag_count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT post_id, COUNT(DISTINCT hashtag_id) AS unique_hashtag_count\nFROM social_media.post_hashtags\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 legal_services.appointments ( appointment_id.text, client_id.text, lawyer_id.text, c... | [
{
"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.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT t1.appointment_id AS appointment1_id, t2.... |
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_inventory (
inventory_id uuid NOT NULL DEFAULT gen_rand... | [
{
"role": "user",
"content": "Show the latest time each player acquired any item.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT player_id, MAX(acquired_at) AS last_acquired_at FROM gaming_technology.player_inventory GROUP BY player_id;",
"sql": null
},
{
"role": "use... |
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, cod... | [
{
"role": "user",
"content": "Show me the earliest created smart contract for each creator address.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT ON (creator_address) contract_id, creator_address, code, timestamp FROM blockchain.smart_contracts ORDER BY creator_address,... |
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.reviews ( review_id.text, property_id.text, reservation_id.te... | [
{
"role": "user",
"content": "Show me reviews from 'Expedia' that have an overall rating of 1 or 2.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT review_id, property_id, guest_id, rating_overall, review_date, comment FROM hospitality_technology.reviews WHERE review_source = 'Exp... |
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 PRIMARY KEY, username text, email text, password_h... | [
{
"role": "user",
"content": "How many users have non-empty full_name and bio fields? Return only the count.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*)\nFROM social_media.users\nWHERE full_name IS NOT NULL\n AND full_name <> ''\n AND bio IS NOT NULL\n AND bio <> '... |
You are an 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.text, project_id.text, project_name.text, rounds_nam... | [
{
"role": "user",
"content": "What is the total investment_value per fundraising round for the year 2023? Order by total investment descending.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT\n substr(investment_date,1,7) AS month,\n rounds_name,\n SUM(investment_value) AS tota... |
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.employees (
employee_id character varying(64) NOT NULL, -- u... | [
{
"role": "user",
"content": "List employees whose job title is different from their manager's job title, showing the employee's full name and their manager's full name.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT e.first_name, e.last_name, m.first_name AS manager_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 financial_services.transactions ( transaction_id text PRIMARY KEY, account_id text, ... | [
{
"role": "user",
"content": "Show me all transactions along with the related account IDs where the transaction type is 'Transfer'.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, account_id, related_account_id, transaction_type, amount, currency, transaction_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 project_fundraising_record ( id character varying(32) NOT NULL, -- fundraising reco... | [
{
"role": "user",
"content": "Which projects that raised funds in 2023 have an associated token, and what are their fundraising amounts, token symbols, and token market caps?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT T1.project_name, T1.investment_value, T2.token_symbol, T2.... |
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.messages (
message_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "How many messages currently have a media file attached?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT COUNT(*) FROM social_media.messages WHERE media_url IS NOT NULL;",
"sql": null
},
{
"role": "user",
"content": "For each user, show... |
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": "Show usernames of players who own items of 'Legendary' rarity.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT DISTINCT T1.username FROM players AS T1 JOIN player_inventory AS T2 ON T1.player_id = T2.player_id JOIN in_game_items AS T3 ON T2.item_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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Show me all male patients who have received more than one prescription, including their full name, date of birth, and the total number of prescriptions.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.patient_id, p.first_name, p.last_name, p.date_of... |
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.game_sessions ( session_id uuid PRIMARY KEY, player_id uuid, game_... | [
{
"role": "user",
"content": "For each server, what is the earliest and latest start time of its sessions?",
"sql": null
},
{
"role": "assistant",
"content": "SELECT server_id, MIN(start_time), MAX(start_time) FROM gaming_technology.game_sessions GROUP BY server_id;",
"sql": null
},
... |
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.loans (
loan_id character varying(64) NOT NULL, -- unique ide... | [
{
"role": "user",
"content": "Retrieve all pairs of loans for the same account where both loans are active and have different loan types. Show account_id, loan_id as loan_a, loan_type as type_a, loan_id as loan_b, and loan_type as type_b.",
"sql": null
},
{
"role": "assistant",
"content": "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
CREATE TABLE web3.transactions ( transaction_id text, from_address text, to_address text, value n... | [
{
"role": "user",
"content": "List all failed transactions where the gas_used is greater than 100,000, including the transaction_id and timestamp.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT transaction_id, timestamp FROM web3.transactions WHERE status = 'failed' AND gas_used ... |
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 PRIMARY KEY, username text, email text, p... | [
{
"role": "user",
"content": "Show me a list of players and, for each, list all the different games where they have acquired items. Also include the number of unique item types they've acquired per game.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.player_id, p.username, g.ti... |
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.nodes ( node_id text PRIMARY KEY, ip_address text, port int, last_seen ti... | [
{
"role": "user",
"content": "Show me all nodes that were last seen in the past 30 days, along with their IP addresses and ports.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT node_id, ip_address, port, last_seen FROM blockchain.nodes WHERE last_seen >= NOW() - INTERVAL '30 days... |
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.doctors ( doctor_id text, first_name text, last_name text, specialty text... | [
{
"role": "user",
"content": "Count the total number of distinct specialties listed in the doctors table.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT count(DISTINCT specialty) FROM healthcare.doctors;",
"sql": null
},
{
"role": "user",
"content": "Show the lice... |
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.text, first_name.text, last_name.text, date_of_bir... | [
{
"role": "user",
"content": "List the first name, last name, and email of all customers who live in New York or California.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, email FROM insurance.customers WHERE state IN ('NY', 'CA');",
"sql": null
},
... |
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 text PRIMARY KEY, first_name text, last_name text... | [
{
"role": "user",
"content": "I need the case_number and case_name along with the total billing amount (hours_spent * billing_rate) for cases that are currently open.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.case_number, c.case_name, SUM(te.hours_spent * te.billing_rate) ... |
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.contracts ( contract_id text, address text, abi text, bytecode text, deployer_a... | [
{
"role": "user",
"content": "Show all token transfers where the token_symbol contains 'ETH' and include the transfer id, value, transaction id, and the contract address where the token was created.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT tt.transfer_id, tt.value, tt.trans... |
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.trips ( trip_id text PRIMARY KEY, route_id text, vehicle_id text, dri... | [
{
"role": "user",
"content": "Give me all trips where the trip status is 'Completed' with their trip ID, vehicle ID, and number of passengers.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT trip_id, vehicle_id, passenger_count FROM transportation.trips WHERE status = 'Completed';... |
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_profit ( address character varying(100) NOT NULL, -- the user's address ... | [
{
"role": "user",
"content": "Show me the top 5 smart money addresses by profit on the Ethereum chain, along with their most profitable token and ROI, but only include addresses with a realized profit ratio above 70%.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT address, most_p... |
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 text, customer_id text, product_id text, agent_id tex... | [
{
"role": "user",
"content": "Retrieve the policy_number, start_date, end_date, premium_amount, and corresponding product_name for policies with a coverage_limit greater than 500000.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT p.policy_number, p.start_date, p.end_date, p.premi... |
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.claims ( claim_id text, policy_id text, customer_id text, incident_date ti... | [
{
"role": "user",
"content": "Show me all claims with police reports that were handled by agents hired in the last 2 years, along with the agent's full name and agency.",
"sql": null
},
{
"role": "assistant",
"content": "SELECT c.claim_id, c.policy_id, c.incident_date, c.police_report_number... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 3