system stringlengths 315 8.06k | conversations listlengths 2 8 |
|---|---|
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.servers ( server_id uuid, game_id uuid, server_name text, region t... | [
{
"role": "user",
"content": "For each game_id and region, show me the server that currently has the highest current_players and the server that has the highest max_players. Return game_id, region, top_current_server_id, top_current_players, top_capacity_server_id, and top_capacity."
},
{
"role": "a... |
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 trading_platform.notifications ( notification_id text PRIMARY KEY, user_id text, mes... | [
{
"role": "user",
"content": "For each user, list their user_id along with their first and last notification messages and the sent_at timestamps."
},
{
"role": "assistant",
"content": "WITH firsts AS (\n SELECT user_id, notification_id AS first_id, message AS first_message, sent_at AS first_sen... |
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 trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Find the username, email, and total number of orders placed by each user."
},
{
"role": "assistant",
"content": "SELECT u.username, u.email, COUNT(o.order_id) AS order_count\nFROM trading_platform.users u\nLEFT JOIN trading_platform.wallets w ON u.user_id = w.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 trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "List each asset's name and symbol along with the total number of open orders for that asset."
},
{
"role": "assistant",
"content": "SELECT a.name,\n a.symbol,\n COUNT(o.order_id) AS open_order_count\nFROM trading_platform.assets a\nLEFT JOIN trading_plat... |
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 trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "I want a report of user IDs with their KYC status and the count of wallets they have."
},
{
"role": "assistant",
"content": "SELECT k.user_id, k.status, COUNT(w.wallet_id) AS wallet_count\nFROM trading_platform.kyc_audit k\nLEFT JOIN trading_platform.wallets w ON k.... |
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 trading_platform.orders ( order_id.text, user_id.text, wallet_id.text, asset_id.text... | [
{
"role": "user",
"content": "For each user, calculate the total value of 'buy' and 'sell' orders (quantity * price)."
},
{
"role": "assistant",
"content": "SELECT b.user_id,\n b.total_buy_value,\n s.total_sell_value\nFROM (\n SELECT user_id,\n SUM(quantity * price) AS total... |
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 trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "For each asset, calculate the total quantity and average price of orders that have status 'filled'."
},
{
"role": "assistant",
"content": "SELECT o.asset_id,\n SUM(o.quantity) AS total_quantity,\n AVG(o.price) AS average_price\nFROM trading_platform.... |
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, title.text, developer_id.uuid, publisher_id.... | [
{
"role": "user",
"content": "List each game along with the title and release_date of the next game released by the same developer."
},
{
"role": "assistant",
"content": "SELECT g1.game_id AS original_game_id,\n g1.title AS original_title,\n g2.game_id AS next_game_id,\n g2.tit... |
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 character varying(64) NOT NULL, route_id character va... | [
{
"role": "user",
"content": "Find consecutive pairs of trips for each vehicle based on the scheduled departure time."
},
{
"role": "assistant",
"content": "WITH RankedTrips AS (\n SELECT\n trip_id,\n vehicle_id,\n scheduled_departure,\n origin_location_id,\n destination_location... |
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.developers ( developer_id uuid, name text, country text, founded_y... | [
{
"role": "user",
"content": "I want to find pairs of developers that share the same website domain. For each pair, show both developer names and the domain."
},
{
"role": "assistant",
"content": "SELECT d1.name AS developer1, d2.name AS developer2, d1.domain AS domain\nFROM (\n SELECT develope... |
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 trading_platform.users (
user_id character varying(64) NOT NULL, -- unique iden... | [
{
"role": "user",
"content": "Show all wallet addresses that have ever received a UTXO."
},
{
"role": "assistant",
"content": "SELECT DISTINCT address\nFROM trading_platform.utxos;"
}
] |
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 trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "I need to get the total trading volume for each asset along with the asset name."
},
{
"role": "assistant",
"content": "SELECT a.asset_id, a.name, SUM(t.quantity * t.price) AS total_volume\nFROM trading_platform.trades t\nJOIN trading_platform.assets a ON t.asset_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 gaming_technology.player_achievements ( player_achievement_id uuid, player_id uuid, ... | [
{
"role": "user",
"content": "List each achievement with the very next achievement unlocked by the same player using a self-join. Show player_id, current_ach, current_unlocked_at, next_ach, and next_unlocked_at."
},
{
"role": "assistant",
"content": "SELECT pa1.player_id,\n pa1.achievement... |
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 identifi... | [
{
"role": "user",
"content": "List all group chats and the total count of messages sent in each one."
},
{
"role": "assistant",
"content": "SELECT T1.group_name, count(T2.message_id) AS message_count FROM social_media.conversations AS T1 JOIN social_media.messages AS T2 ON T1.conversation_id = 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 insurance.insurance_products (
product_id character varying(64) NOT NULL, -- uni... | [
{
"role": "user",
"content": "Find pairs of products with the same product_type but different is_active statuses. Include product_type, active product_id, active product_name, inactive product_id, and inactive product_name."
},
{
"role": "assistant",
"content": "SELECT\n p_active.product_type,\... |
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 identifi... | [
{
"role": "user",
"content": "Show me the usernames and full names of all users who have liked at least one post that was created in May 2024."
},
{
"role": "assistant",
"content": "SELECT DISTINCT u.username, u.full_name\nFROM social_media.users u\nJOIN social_media.likes l ON u.user_id = l.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 healthcare.patients ( patient_id text, first_name text, last_name text, date_of_birt... | [
{
"role": "user",
"content": "Show me all pairs of patients who share the same emergency contact phone, including both patient IDs, their names, and the shared emergency contact phone."
},
{
"role": "assistant",
"content": "SELECT p1.patient_id,\n p1.first_name,\n p1.last_name,\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 gaming_technology.player_inventory ( inventory_id uuid PRIMARY KEY, player_id uuid, ... | [
{
"role": "user",
"content": "For each player, show their username and the total quantity of items they own in their inventory, alongside the total number of game sessions they have played."
},
{
"role": "assistant",
"content": "SELECT T1.username, COALESCE(T2.total_item_quantity, 0) AS total_it... |
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 identifi... | [
{
"role": "user",
"content": "Can you list all group conversations and the number of participants in each?"
},
{
"role": "assistant",
"content": "SELECT c.conversation_id, c.group_name, COUNT(cp.user_id) AS participant_count\nFROM social_media.conversations c\nJOIN social_media.conversation_part... |
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 trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "Get the number of log entries for each user where the action contains 'fail' in the last 30 days."
},
{
"role": "assistant",
"content": "SELECT l.user_id, COUNT(*) AS fail_count\nFROM trading_platform.logs l\nWHERE l.action ILIKE '%fail%' AND l.logged_at >= NOW() - ... |
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 identifi... | [
{
"role": "user",
"content": "Could you show me the usernames of users who have received likes on their posts, along with the total number of likes each user's posts have received?"
},
{
"role": "assistant",
"content": "SELECT T1.username, count(T3.like_id) AS total_likes_received FROM social_me... |
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 character varying(64) NOT NULL, first_name characte... | [
{
"role": "user",
"content": "Find pairs of patients who share the same last name. Show the patient IDs, full names, and the shared last name."
},
{
"role": "assistant",
"content": "SELECT p1.patient_id AS patient1_id, p1.first_name AS patient1_first_name, p1.last_name AS patient1_last_name, p2.... |
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.appointments ( appointment_id text, patient_id text, doctor_id text, appo... | [
{
"role": "user",
"content": "Find overlapping appointments for each doctor. Return doctor_id, appointment_id_1, appointment_id_2, and overlap duration in minutes."
},
{
"role": "assistant",
"content": "SELECT a.doctor_id,\n a.appointment_id AS appointment_id_1,\n b.appointment_id AS... |
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 /stations
{
"mappings": {
"properties": {
"station_id": { "type": "keyword" },... | [
{
"role": "user",
"content": "Can you help me find all schedules for a specific route with route_id 'RT789' that includes the train details and the departure times?"
},
{
"role": "assistant",
"content": "SELECT s.schedule_id, s.departure_datetime, s.arrival_datetime, s.status, t.train_id\nFROM 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 trading_platform.wallets (
wallet_id character varying(64) NOT NULL, -- unique ... | [
{
"role": "user",
"content": "Give me all unspent UTXOs for address '1A2b3C4d5E', sorted by amount descending."
},
{
"role": "assistant",
"content": "SELECT utxo_id, transaction_id, output_index, address, amount\nFROM trading_platform.utxos\nWHERE address = '1A2b3C4d5E' AND spent = FALSE\nORDER ... |
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 identifi... | [
{
"role": "user",
"content": "Show me the usernames and email addresses for users who have a non-empty bio and are verified."
},
{
"role": "assistant",
"content": "SELECT username, email FROM social_media.users WHERE bio IS NOT NULL AND bio != '' AND is_verified = TRUE;"
}
] |
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 identifi... | [
{
"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 expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.
##Table Structure
CREATE TABLE blockchain.blocks (
block_id character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Find all smart contract IDs and the block IDs that were mined within 5 minutes before or after the contract deployment timestamp."
},
{
"role": "assistant",
"content": "SELECT T1.contract_id, T2.block_id FROM blockchain.smart_contracts AS T1 JOIN blockchain.blocks A... |
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 trading_platform.users ( user_id character varying(64) NOT NULL, username character ... | [
{
"role": "user",
"content": "List all users, showing their user ID, username, and the total number of wallets they have created. Include users who have no wallets."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, COUNT(w.wallet_id) AS wallet_count FROM trading_platform.users... |
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 identifi... | [
{
"role": "user",
"content": "List each user and their total number of followers, including username, ordered by follower count descending."
},
{
"role": "assistant",
"content": "SELECT u.user_id, u.username, COUNT(f.follower_user_id) AS follower_count FROM social_media.users u LEFT JOIN social_... |
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 identifi... | [
{
"role": "user",
"content": "For each user, show their username, email, and the number of posts they've created that contain at least one hashtag. Only include users who have created such posts."
},
{
"role": "assistant",
"content": "SELECT u.username, u.email, COUNT(DISTINCT p.post_id) AS post... |
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 character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "For each token, list its symbol and the number of transfers recorded in token_transfers."
},
{
"role": "assistant",
"content": "SELECT\n t.token_symbol,\n COUNT(tt.transfer_id) AS transfer_count\nFROM web3.tokens t\nLEFT JOIN web3.token_transfers tt\n ON t.token_... |
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 character varying(64) NOT NULL, -- unique identifi... | [
{
"role": "user",
"content": "Show each contract's address along with the total number of events it has emitted and the total number of transactions sent to it."
},
{
"role": "assistant",
"content": "SELECT\n c.address,\n COUNT(e.event_id) AS event_count,\n COUNT(t.transaction_id) AS tx_count... |
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.servers ( server_id uuid NOT NULL DEFAULT gen_random_uuid(), game_... | [
{
"role": "user",
"content": "Find pairs of servers in the same region where one server's last heartbeat was recorded within the last hour, and the other server's last heartbeat was recorded between 1 and 2 hours ago. Show the server names, regions, and last heartbeat timestamps for both servers in each pai... |
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 /stations
{
"mappings": {
"properties": {
"station_id": { "type": "keyword" },... | [
{
"role": "user",
"content": "Can you provide the total capacity of all train cars for a specific train with train_id 'TR789'?"
},
{
"role": "assistant",
"content": "SELECT SUM(capacity) AS total_capacity\nFROM train_cars\nWHERE train_id = 'TR789';"
}
] |
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": "Retrieve all pairs of nodes that share the same port and were last seen on the same day. Include node_id, ip_address, and last_seen of both nodes."
},
{
"role": "assistant",
"content": "SELECT n1.node_id AS node_id1, n1.ip_address AS ip1, n1.last_seen AS last_seen1,... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 3