license:mit size_categories:n<1K format:csv modality:text library:datasets library:pandas library:mlcroissant library:polars region:us infinite-dataset-hub synthetic
---
license: mit
tags:
- infinite-dataset-hub
- synthetic
---

# SchemaQueryLab

tags: text2sql, ML, Wikipedia-like

_Note: This is an AI-generated dataset so its content may be inaccurate or false_

**Dataset Description:**

The 'SchemaQueryLab' dataset is curated to support the development and training of machine learning models, particularly those focused on the text-to-SQL task. It contains a collection of wikipedia-like articles, which are formatted into structured datasets comprising text queries, SQL queries, and the corresponding table schemas. Each row in the dataset represents a unique example where a natural language text query is translated into a precise SQL query, following a detailed table schema. The queries focus on filtering, statistical analysis, and aggregation operations, aimed at various topics such as science, news, tutorials, and technology.

The dataset is segmented into distinct labels based on the complexity and domain of the queries. These labels serve as a guide for categorizing the queries, enhancing the model's ability to generalize and learn from diverse topics and query structures.

**CSV Content Preview:**

```csv
"text query","sql query","table schema","labels"
"What is the total number of articles related to machine learning in the 'Science' category?","SELECT COUNT(*) FROM Articles WHERE category = 'Science' AND topic = 'Machine Learning';","category (string), topic (string), type (string), title (string), content (text)",["complex", "technology", "education"]
"List all tutorials for the Python programming language.","SELECT title FROM Tutorials WHERE programming_language = 'Python';","title (string), programming_language (string), type (string), difficulty (string), category (string)",["education", "programming", "intermediate"]
"How many news articles mention 'quantum computing'?","SELECT COUNT(*) FROM News WHERE content LIKE '%quantum computing%';","title (string), content (text), category (string)",["news", "technology", "advanced"]
"Find the average number of views for tutorials on 'Data Science' across all tutorials.","SELECT AVG(views) FROM Tutorials WHERE category = 'Data Science';","title (string), views (int), category (string), publication_date (date)",["data science", "education", "analytics"]
"Retrieve the list of article titles that fall under 'Science' and 'Machine Learning' categories.","SELECT title FROM Articles WHERE category = 'Science' AND topic = 'Machine Learning';","title (string), category (string), topic (string), content (text)",["machine learning", "science", "research"]
```

This CSV preview provides a glimpse into the 'SchemaQueryLab' dataset, showcasing a variety of queries relevant to the fields of science, technology, and education. The dataset aims to support the development of robust text-to-SQL models capable of handling complex queries and learning from diverse subject matter.

**Source of the data:**

The dataset was generated using the [Infinite Dataset Hub](https://huggingface.co/spaces/infinite-dataset-hub/infinite-dataset-hub) and microsoft/Phi-3-mini-4k-instruct using the query 'text2sql dataset containing SQL schemas of text datasets as well as natural language text query and the actual SQL queries, specialized for text datasets used to train large language models, mostly SQL about filtering/stats/aggregates, the data consists of wikipedia-like articles, include columns "text query", "sql query", "table schema", data should be about various topics like science, news, tutorials, tech':

- **Dataset Generation Page**: https://huggingface.co/spaces/infinite-dataset-hub/infinite-dataset-hub?q=text2sql+dataset+containing+SQL+schemas+of+text+datasets+as+well+as+natural+language+text+query+and+the+actual+SQL+queries,+specialized+for+text+datasets+used+to+train+large+language+models,+mostly+SQL+about+filtering/stats/aggregates,+the+data+consists+of+wikipedia-like+articles,+include+columns+"text+query",+"sql+query",+"table+schema",+data+should+be+about+various+topics+like+science,+news,+tutorials,+tech&dataset=SchemaQueryLab&tags=text2sql,+ML,+Wikipedia-like
- **Model**: https://huggingface.co/microsoft/Phi-3-mini-4k-instruct
- **More Datasets**: https://huggingface.co/datasets?other=infinite-dataset-hub
