Sql Create Context
Hugging FaceOverview This dataset builds from WikiSQL and Spider. There are 78,577 examples of natural language queries, SQL CREATE TABLE statements, and SQL Query answering the question using the CREATE statement as context. This dataset was built with text-to-sql LLMs in mind, intending to prevent hallucination of column and table names often seen when trained on text-to-sql datasets. The CREATE TABLE statement can often be copy and pasted from different DBMS and provides table names, column… See the full description on the dataset page: https://huggingface.co/datasets/b-mc2/sql-create-context.
Ask a question about this data
Type any question in plain English — Helix builds the chart with AI. Sign in to run it and save your charts.
Data preview
500 rows · 3 columns · showing first 12| # | answer text | question text | context text |
|---|---|---|---|
| 1 | SELECT COUNT(*) FROM head WHERE age > 56 | How many heads of the departments are older than 56 ? | CREATE TABLE head (age INTEGER) |
| 2 | SELECT name, born_state, age FROM head ORDER BY age | List the name, born state and age of the heads of departments ordered by age. | CREATE TABLE head (name VARCHAR, born_state VARCHAR, age VARCHAR) |
| 3 | SELECT creation, name, budget_in_billions FROM department | List the creation year, name and budget of each department. | CREATE TABLE department (creation VARCHAR, name VARCHAR, budget_in_billions VARCHAR) |
| 4 | SELECT MAX(budget_in_billions), MIN(budget_in_billions) FROM department | What are the maximum and minimum budget of the departments? | CREATE TABLE department (budget_in_billions INTEGER) |
| 5 | SELECT AVG(num_employees) FROM department WHERE ranking BETWEEN 10 AND 15 | What is the average number of employees of the departments whose rank is between 10 and 15? | CREATE TABLE department (num_employees INTEGER, ranking INTEGER) |
| 6 | SELECT name FROM head WHERE born_state <> 'California' | What are the names of the heads who are born outside the California state? | CREATE TABLE head (name VARCHAR, born_state VARCHAR) |
| 7 | SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_i… | What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'? | CREATE TABLE department (creation VARCHAR, department_id VARCHAR); CREATE TABLE management (department_id VARCHAR, head_id VARCHAR); CREATE… |
| 8 | SELECT born_state FROM head GROUP BY born_state HAVING COUNT(*) >= 3 | What are the names of the states where at least 3 heads were born? | CREATE TABLE head (born_state VARCHAR) |
| 9 | SELECT creation FROM department GROUP BY creation ORDER BY COUNT(*) DESC LIMIT 1 | In which year were most departments established? | CREATE TABLE department (creation VARCHAR) |
| 10 | SELECT T1.name, T1.num_employees FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id WHERE T2.temporary_acti… | Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'? | CREATE TABLE management (department_id VARCHAR, temporary_acting VARCHAR); CREATE TABLE department (name VARCHAR, num_employees VARCHAR, de… |
| 11 | SELECT COUNT(DISTINCT temporary_acting) FROM management | How many acting statuses are there? | CREATE TABLE management (temporary_acting VARCHAR) |
| 12 | SELECT COUNT(*) FROM department WHERE NOT department_id IN (SELECT department_id FROM management) | How many departments are led by heads who are not mentioned? | CREATE TABLE management (department_id VARCHAR); CREATE TABLE department (department_id VARCHAR) |
Interesting queries to try
Columns
- answer text
- question text
- context text