system stringlengths 96 6.34k | conversations listlengths 2 24 |
|---|---|
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, -- unique identifier for the vehicle
license_pl... | [
{
"role": "user",
"content": "Show the first name, last name, and the date they joined (created_at) for all passengers."
},
{
"role": "assistant",
"content": "SELECT first_name, last_name, created_at FROM transportation.passengers;"
},
{
"role": "user",
"content": "Only include passe... |
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 ecommerce.stores ( store_id text, store_name text, address_line1 text, address_line2 text, city text, state_province te... | [
{
"role": "user",
"content": "Show the store name, rating, and number of products for each store."
},
{
"role": "assistant",
"content": "SELECT s.store_name, s.rating, COUNT(p.product_id) AS product_count\nFROM ecommerce.stores s\nLEFT JOIN ecommerce.products p ON s.store_id = p.store_id\nGROUP ... |
You are an SQL expert helping analyze data from a university management system. Given the table structure described by the CREATE TABLE statement, write SQL queries that provide solutions to analytical questions.
##Table Structure
CREATE TABLE education.students (student_id varchar(64) PRIMARY KEY, first_name varchar(1... | [
{
"role": "user",
"content": "Find the top 5 departments by the number of students enrolled in their courses this semester."
},
{
"role": "assistant",
"content": "SELECT c.department, COUNT(DISTINCT e.student_id) AS enrolled_students\nFROM education.courses c\nJOIN education.enrollments e ON c.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 elearning.courses (
course_id uuid NOT NULL DEFAULT gen_random_uuid(),
title character varying(200) NOT NULL,
... | [
{
"role": "user",
"content": "I need to analyze our e-learning platform's performance. First, show me which servers are hosting courses that launched in 2023 or later, along with their current student load. Include server name, region, course launch date, and current students, but only for servers that are ... |
You are an SQL expert who helps solve complex database challenges. Given table structures, write optimized SQL queries that provide solutions to various business problems. | [
{
"role": "user",
"content": "I'm working on multiple data analysis challenges for our e-commerce platform:\n\n1. For our gaming marketplace (tables: games, sessions, players), I need to find each player's last login and their most recent game session end time, filtered to active players only, with the game... |
You are an SQL expert specializing in financial analytics platforms. Given table structures, write optimized queries to solve complex business intelligence questions. | [
{
"role": "user",
"content": "I need to analyze our trading platform's performance. First, show me all cryptocurrency assets where the trading volume is between 100K and 1M USD, including their symbols and contract addresses."
},
{
"role": "assistant",
"content": "SELECT symbol, contract_address... |
You are an SQL expert specializing in complex financial analytics queries. Given the table structures, write SQL queries that solve the user's analytical challenges. | [
{
"role": "user",
"content": "I need to analyze our investment portfolio performance. First, show me securities grouped by sector with their total market value, including only sectors with at least 5 securities. Include the latest price and trading volume for each."
},
{
"role": "assistant",
"co... |
You are an SQL expert for an educational technology platform. Given the table structure, write optimized SQL queries to solve complex data analysis challenges.
##Tables
CREATE TABLE students (student_id uuid PRIMARY KEY, name text, email text, enrollment_date date, status text, grade_level int)
CREATE TABLE courses (co... | [
{
"role": "user",
"content": "Analyze student performance: For each department, show courses with completion rates below 70%, include instructor ratings, average scores by assignment category, and identify students at risk (multiple late submissions). Also calculate weekend vs weekday submission patterns an... |
You are an SQL expert for an e-commerce platform. Write queries based on the table structures provided to solve complex business analytics challenges.
##Tables
CREATE TABLE products (product_id varchar(64) PRIMARY KEY, name varchar(200), category_id varchar(64), brand varchar(100), price decimal(10,2), cost decimal(10,... | [
{
"role": "user",
"content": "I need to analyze product performance across categories. For each category, show the total revenue, average product rating, and identify the top-selling product by revenue. Include the category commission rate and only categories with at least 5 products."
},
{
"role": ... |
You are an SQL expert. Given CREATE TABLE statements, write SQL queries to solve the user's questions. ##Tables: CREATE TABLE ecommerce.products (product_id varchar(64) PRIMARY KEY, name varchar(255), category varchar(128), price numeric(10,2), stock_quantity int, supplier_id varchar(64), created_at timestamp, is_activ... | [
{
"role": "user",
"content": "Show me all premium customers who have placed orders in the last 30 days, including their total order value and average rating given in reviews."
},
{
"role": "assistant",
"content": "SELECT c.customer_id, c.first_name, c.last_name, SUM(o.total_amount) AS total_orde... |
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 ecommerce.customers ( customer_id character varying(64) PRIMARY KEY, first_name text NOT NULL, last_name text NOT NULL,... | [
{
"role": "user",
"content": "I need help with several SQL queries for our e-commerce analytics:\n\n1. Show all successful payments over $500 with customer names and the staff who processed them\n2. Summarize order totals by status, but only statuses with more than 10 orders\n3. For each product category, c... |
You are an SQL expert for an online learning platform. Given the table structure, write SQL queries to solve analytical challenges.
##Table Structure
CREATE TABLE learning.users (user_id VARCHAR(64) PRIMARY KEY, username VARCHAR(128) UNIQUE, email VARCHAR(128) UNIQUE, full_name VARCHAR(200), registration_date TIMESTAMP... | [
{
"role": "user",
"content": "I need a comprehensive analysis of user engagement. Show me each user with their most recent learning activity, including the date and type of their last action, plus their total activities in the past 30 days. Only include activities related to 'video' or 'assignment'."
},
... |
You are an SQL expert helping users with database queries for an e-learning platform. The platform manages courses, students, instructors, enrollments, assessments, and analytics across multiple educational institutions. | [
{
"role": "user",
"content": "I need to analyze student performance across different courses. Show me the top and bottom performing students by course completion rate, excluding courses with less than 50 enrollments. Include their assessment scores and time spent."
},
{
"role": "assistant",
"con... |
You are an SQL expert assistant for a university management system. Given the table structures described by CREATE TABLE statements, write SQL queries that solve the user's questions. Focus on educational data analysis including student records, course management, faculty information, and campus resources. | [
{
"role": "user",
"content": "I need to analyze our course enrollment patterns. First, show me each course with total historical enrollments and unique students from enrollments_historical. Include course_code, total_seats_filled, student_count, course_name, and credits."
},
{
"role": "assistant",
... |
You are an SQL expert helping analyze data in a university research platform. Given the CREATE TABLE statements, write SQL queries to solve the user's questions about research papers, collaborations, and analytics.
##Table Structure
CREATE TABLE research.papers ( paper_id varchar(64) PRIMARY KEY, title text NOT NULL, ... | [
{
"role": "user",
"content": "Show me the top 5 departments with the highest number of unique authors who have published papers, along with their department names and the average h-index of authors in each department."
},
{
"role": "assistant",
"content": "SELECT a.department, COUNT(DISTINCT a.a... |
You are an SQL expert helping analyze data across various business domains. Given table structures described by CREATE TABLE statements, write optimized SQL queries that solve complex analytical challenges. | [
{
"role": "user",
"content": "I need help with several SQL challenges across our company's databases:\n\n1. LOGISTICS: Find shipments that arrived earlier than scheduled. Tables: logistics.shipments (shipment_id, route_id, vehicle_id, driver_id, scheduled_arrival timestamp, actual_arrival timestamp), logist... |
You are an SQL expert specializing in complex analytical queries across multiple database systems. Given the table structures described by CREATE TABLE statements, write SQL queries that efficiently solve the user's requirements, demonstrating advanced SQL techniques including window functions, subqueries, self-joins, ... | [
{
"role": "user",
"content": "I need to analyze our e-commerce platform's performance. Show me products with the word 'Premium' in their name, along with the total number of orders and average rating for each product, but only include products where the average rating (excluding null ratings) is at least 4.... |
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 ecommerce.customers (customer_id varchar(64) PRIMARY KEY, email varchar(128) UNIQUE, full_name varchar(200), join_date ... | [
{
"role": "user",
"content": "I need a comprehensive analysis of our top customers. Show me customers who have placed more than 5 orders in 2024, their total spending, average order value, and the most frequent product category they purchase. Include only active customers."
},
{
"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 courses ( course_id integer PRIMARY KEY, course_code varchar(20) NOT NULL, course_name varchar(200) NOT NULL, departmen... | [
{
"role": "user",
"content": "List the top 5 courses by student activity count in the past 7 days."
},
{
"role": "assistant",
"content": "SELECT ca.course_id,\n c.course_name,\n COUNT(*) AS activity_count\nFROM course_activities ca\nJOIN courses c ON ca.course_id = c.course_id\nWHERE... |
You are an SQL expert for an educational institution's database. Given the table structure, write SQL queries to solve analytical challenges.
##Tables
CREATE TABLE education.students (student_id uuid PRIMARY KEY, first_name text, last_name text, email text UNIQUE, enrollment_date timestamp, status text, gpa numeric(3,2... | [
{
"role": "user",
"content": "I need a comprehensive analysis: For each department, show the top 3 performing students (by GPA) who have submitted more than 80% of their assignments on time, along with their average assignment score and the most common grade they receive. Include only departments with at le... |
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 university.students (student_id varchar(64) PRIMARY KEY, first_name varchar(100), last_name varchar(100), email varchar... | [
{
"role": "user",
"content": "Show me departments with more than 5 courses that have an average course credit value greater than 3."
},
{
"role": "assistant",
"content": "SELECT department_id, COUNT(course_id) AS course_count, AVG(credits) AS avg_credits\nFROM university.courses\nGROUP BY depart... |
You are an SQL expert specializing in e-commerce analytics. Given database tables with customer, product, order, and supplier information, write SQL queries to analyze business performance and operations. | [
{
"role": "user",
"content": "I need to analyze our high-value product suppliers. Show me all products from suppliers in Canada with quality ratings, including product names, supplier names, quality scores, and product costs."
},
{
"role": "assistant",
"content": "SELECT p.product_name, s.suppli... |
You are an SQL expert. Write queries for the e-commerce platform database.
##Tables
CREATE TABLE commerce.customers (customer_id text PRIMARY KEY, first_name text, last_name text, email text, registration_date timestamp, loyalty_tier text, lifetime_value numeric)
CREATE TABLE commerce.products (product_id text PRIMARY ... | [
{
"role": "user",
"content": "I need to analyze our highest-value customers. Show me customers with their total order amounts, including names and loyalty tiers, but only those who've spent over $5000 in the last 90 days. Order by spending descending and limit to top 10."
},
{
"role": "assistant",
... |
You are an SQL expert specializing in complex analytical queries. Given table structures described by CREATE TABLE statements, write precise SQL queries that solve the user's analytical challenges progressively. | [
{
"role": "user",
"content": "I need help with multiple SQL challenges across our enterprise systems:\n\n1. **E-Commerce Analytics**: Show customers with active subscriptions > $50/month who made purchases in Q1, including their total spending and subscription details.\n\n2. **NFT Trading Platform**: Find t... |
You are an SQL expert helping with an e-commerce platform database. Write precise SQL queries to answer user questions about the platform's data. | [
{
"role": "user",
"content": "I need to analyze several aspects of our platform. First, show me the order history for customer 'C-789456' for product 'P-12345' with order amounts and timestamps."
},
{
"role": "assistant",
"content": "SELECT order_id, amount, created_at\nFROM order_history\nWHERE... |
You are an SQL expert helping analyze data for a global e-commerce platform. Given the table structure described by the CREATE TABLE statements, write SQL queries that provide solutions to complex analytical challenges.
##Table Structure
CREATE TABLE ecommerce.users (user_id varchar(64) PRIMARY KEY, username varchar(10... | [
{
"role": "user",
"content": "I need comprehensive analytics on our platform. First, show orders from Q1 2024 with customer details and warehouse info. Then analyze product performance by finding items with overlapping campaign periods where both campaigns had budgets over $50k. Next, identify power users w... |
You are an SQL expert specializing in e-commerce analytics. Given the table structures, write SQL queries to analyze business metrics and customer behavior. | [
{
"role": "user",
"content": "I need to analyze our marketplace performance. First, show me the top 5 vendors by total sales volume (quantity * unit_price) as sellers, including their store addresses, distinct product categories sold, and average sale price. Only include sales from the last 30 days where th... |
You are an SQL expert. Given the table structure, write SQL queries to solve the user's questions.
##Tables
CREATE TABLE edu.students (student_id text, first_name text, last_name text, enrollment_date date, status text, grade_level int)
CREATE TABLE edu.instructors (instructor_id text, first_name text, last_name text, ... | [
{
"role": "user",
"content": "I need a comprehensive SQL analysis covering multiple scenarios:\n1. List active department heads with their supervised instructor count\n2. Show students with both merit scholarships and need-based aid\n3. Find course pairs taught by the same instructor\n4. Calculate departmen... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 2