File size: 3,880 Bytes
ff8e02c
 
 
 
 
 
 
 
 
 
 
 
d0c1853
 
 
 
 
 
 
 
 
fbe116b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
license: other
license_name: openrail-d
license_link: >-
  https://www.licenses.ai/blog/2022/8/18/naming-convention-of-responsible-ai-licenses
task_categories:
- text-generation
language:
- en
pretty_name: annotated SQL
size_categories:
- 1M<n<10M
tags:
- code
- sql
---

This dataset focuses the SQL corpus of the [Stack v2 dedup](https://huggingface.co./datasets/bigcode/the-stack-v2-dedup) dataset and provides annotations to each SQL file therein.
[sqlparse](https://github.com/andialbrecht/sqlparse) is used to parse the SQL code, then count keywords and symbols.

Below are the annotation columns.
| **Column Name**                | **Column Description**                               |
|--------------------------------|-----------------------------------------------|
| **Keyword.DML**                | Data Manipulation Language commands for modifying database records, e.g. `SELECT`, `INSERT`, `UPDATE`, `DELETE`, `COMMIT`, `MERGE`, `ROLLBACK`. |
| **Keyword.DDL**                | Data Definition Language commands for defining or altering database structure, e.g. `ALTER`, `CREATE`, `DROP`. |
| **Keyword.DCL**                | Data Control Language commands for managing access and permissions, e.g. `GRANT`, `REVOKE`. |
| **Keyword**                    | Reserved words in SQL that represent operations or command, e.g. `FROM`, `WHERE`, `JOIN`, `GROUP`, `ORDER`, `IF`, `WHILE`, `MIN`, `MAX`, `AND`, `OR`, `ON`. |
| **Name.Builtin**               | Built-in data types or reserved names in SQL, e.g. `INTEGER`, `FLOAT`, `CHAR`, `VARCHAR`, `DATE`, `TIMESTAMP`. |
| **Operator**                   | Arithmetic, logical, or other operators used for SQL expressions, e.g. `+`, `-`, `*`. |
| **Operator.Comparison**        | Operators for comparing values in SQL expressions, e.g. `==`, `>=`, `<=`, `<>`, `LIKE`, `REGEXP`. |
| **Assignment**                 | Symbols used for assigning values in SQL expressions, e.g. `:=`. |
| **Punctuation**                | Symbols used for structuring SQL syntax, e.g.`(`, `)`, `,`, `.`, `:`, `::`, `;`, `[`, `]`. |
| **Wildcard**                   | Symbols representing a selection of all columns or rows, e.g. `*`. |
| **Keyword.Order**              | Keywords for specifying sorting orders in query results, e.g. `ASC`, `DESC`. |
| **Keyword.CTE**                | Common Table Expression keywords for defining temporary result sets, e.g. `WITH`. |
| **Keyword.TZCast**             | Keywords for casting time zones in SQL queries, e.g. `AT TIME ZONE 'UTC'`. |
| **Name**                       | Represents identifiers such as table or column names. |
| **Name.Placeholder**           | Placeholders used for dynamic or parameterized queries. |
| **Literal**                    | Literal values like numbers, strings, or other constants. |
| **Literal.Number.Integer**     | Integer numeric literals in SQL expressions. |
| **Literal.Number.Float**       | Floating-point numeric literals in SQL expressions. |
| **Literal.Number.Hexadecimal** | Hexadecimal numeric literals in SQL expressions. |
| **Literal.String.Single**      | Single-quoted string literals in SQL expressions. |
| **Literal.String.Symbol**      | Symbolic literals used in SQL expressions or commands. |
| **Comment.Multiline**          | Represents multi-line comments in SQL code. |
| **Comment.Multiline.Hint**     | Multi-line comments providing additional context or hints. |
| **Comment.Single**             | Represents single-line comments in SQL code. |
| **Comment.Single.Hint**        | Single-line comments providing additional context or hints. |
| **Text.Whitespace**            | Represents spaces or tabs in the SQL code for formatting. |
| **Text.Whitespace.Newline**    | Represents newline characters in SQL code for line breaks. |
| **Generic.Command**            | General commands that may not fall into specific SQL categories. |