ArthurHsiehTW HuParser commited on
Commit
954af70
·
verified ·
0 Parent(s):

Duplicate from InfiniFlow/text2sql

Browse files

Co-authored-by: kevinhu <HuParser@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
12
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
13
+ *.model filter=lfs diff=lfs merge=lfs -text
14
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
15
+ *.npy filter=lfs diff=lfs merge=lfs -text
16
+ *.npz filter=lfs diff=lfs merge=lfs -text
17
+ *.onnx filter=lfs diff=lfs merge=lfs -text
18
+ *.ot filter=lfs diff=lfs merge=lfs -text
19
+ *.parquet filter=lfs diff=lfs merge=lfs -text
20
+ *.pb filter=lfs diff=lfs merge=lfs -text
21
+ *.pickle filter=lfs diff=lfs merge=lfs -text
22
+ *.pkl filter=lfs diff=lfs merge=lfs -text
23
+ *.pt filter=lfs diff=lfs merge=lfs -text
24
+ *.pth filter=lfs diff=lfs merge=lfs -text
25
+ *.rar filter=lfs diff=lfs merge=lfs -text
26
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
27
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
29
+ *.tar filter=lfs diff=lfs merge=lfs -text
30
+ *.tflite filter=lfs diff=lfs merge=lfs -text
31
+ *.tgz filter=lfs diff=lfs merge=lfs -text
32
+ *.wasm filter=lfs diff=lfs merge=lfs -text
33
+ *.xz filter=lfs diff=lfs merge=lfs -text
34
+ *.zip filter=lfs diff=lfs merge=lfs -text
35
+ *.zst filter=lfs diff=lfs merge=lfs -text
36
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
37
+ # Audio files - uncompressed
38
+ *.pcm filter=lfs diff=lfs merge=lfs -text
39
+ *.sam filter=lfs diff=lfs merge=lfs -text
40
+ *.raw filter=lfs diff=lfs merge=lfs -text
41
+ # Audio files - compressed
42
+ *.aac filter=lfs diff=lfs merge=lfs -text
43
+ *.flac filter=lfs diff=lfs merge=lfs -text
44
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
45
+ *.ogg filter=lfs diff=lfs merge=lfs -text
46
+ *.wav filter=lfs diff=lfs merge=lfs -text
47
+ # Image files - uncompressed
48
+ *.bmp filter=lfs diff=lfs merge=lfs -text
49
+ *.gif filter=lfs diff=lfs merge=lfs -text
50
+ *.png filter=lfs diff=lfs merge=lfs -text
51
+ *.tiff filter=lfs diff=lfs merge=lfs -text
52
+ # Image files - compressed
53
+ *.jpg filter=lfs diff=lfs merge=lfs -text
54
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
55
+ *.webp filter=lfs diff=lfs merge=lfs -text
56
+ # Video files - compressed
57
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
58
+ *.webm filter=lfs diff=lfs merge=lfs -text
Database Description EN.txt ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ### Users Table (users)
3
+ The users table stores user information for the website or application. Below are the definitions of each column in this table:
4
+ - `id`: INTEGER, an auto-incrementing field that uniquely identifies each user (primary key). It automatically increases with every new user added, guaranteeing a distinct ID for every user.
5
+ - `username`: VARCHAR, stores the user’s login name; this value is typically the unique identifier used during authentication.
6
+ - `password`: VARCHAR, holds the user’s password; for security, the value must be encrypted (hashed) before persistence.
7
+ - `email`: VARCHAR, stores the user’s e-mail address; it can serve as an alternate login credential and is used for notifications or password-reset flows.
8
+ - `mobile`: VARCHAR, stores the user’s mobile phone number; it can be used for login, receiving SMS notifications, or identity verification.
9
+ - `create_time`: TIMESTAMP, records the timestamp when the user account was created; defaults to the current timestamp.
10
+ - `update_time`: TIMESTAMP, records the timestamp of the last update to the user’s information; automatically refreshed to the current timestamp on every update.
11
+ ### Products Table(products)
12
+ The products table stores information about items available for purchase. Below are the meanings of each field:
13
+ - `id`: INTEGER, auto-incrementing field that serves as the unique identifier (primary key) for each product.
14
+ - `name`: VARCHAR, stores the product’s name.
15
+ - `description`: TEXT, holds the detailed description of the product, which may include specifications, features, usage instructions, and other relevant information.
16
+ - `price`: DECIMAL(10,2), stores the product’s price with up to 10 total digits, 2 of which are reserved for the decimal portion.
17
+ - `stock`: INTEGER, stores the current inventory quantity of the product.
18
+ - `category_id`: INTEGER, stores the ID of the category to which the product belongs; this field can be linked to a product-category table to enable product categorization.
19
+ - `merchant_id`: INTEGER, stores the ID of the merchant selling the product. This field is a foreign key referencing the corresponding record in the merchants table.
20
+ - `create_time`: TIMESTAMP, records the timestamp when the product was created.
21
+ - `update_time`: TIMESTAMP, records the timestamp of the last update to the product information.
22
+ ### Merchants Table(merchants)
23
+ The merchants table stores information about the merchants who sell products. Below is a description of each field in this table:
24
+ - `id`: INTEGER, an auto-incrementing field that serves as the unique identifier (primary key) for the merchant.
25
+ - `name`: VARCHAR, stores the merchant’s name or brand name.
26
+ - `description`: TEXT, stores the merchant’s detailed description, which may include an introduction, services offered, contact information, etc.
27
+ - `email`: VARCHAR, stores the merchant’s email address for contact purposes.
28
+ - `mobile`: VARCHAR, stores the merchant’s contact phone number.
29
+ - `address`: VARCHAR, stores the merchant’s physical address.
30
+ - `create_time`: TIMESTAMP, records the timestamp when the merchant account was created.
31
+ - `update_time`: TIMESTAMP, records the timestamp of the last update to the merchant’s information.
32
+ These tables are designed to be interrelated; for instance, the merchant_id field in the product table links each product to a specific merchant in the merchant table.
Database Description.txt ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ### 用户表(users)
3
+ 用户表用于存储网站或应用的用户信息。以下是该表中每个字段的含义:
4
+ - `id`: 这是一个整数类型的自增字段,作为用户的唯一标识符(主键)。每次添加新用户时,该字段会自动增加,确保每个用户都有一个唯一的ID。
5
+ - `username`: 字符串类型,用于存储用户的用户名。用户名通常是用户登录时使用的唯一标识符。
6
+ - `password`: 字符串类型,用于存储用户的密码。出于安全考虑,密码在存储前应进行加密处理。
7
+ - `email`: 字符串类型,用于存储用户的电子邮件地址。电子邮件地址可以是用户的另一个登录凭证,并且用于接收通知或重置密码。
8
+ - `mobile`: 字符串类型,用于存储用户的手机号码。手机号码可用于登录、接收短信通知或进行身份验证。
9
+ - `create_time`: 时间戳类型,记录用户账户创建的时间。默认值为当前时间。
10
+ - `update_time`: 时间戳类型,记录用户信息最后更新的时间。每次更新用户信息时,该字段都会自动更新为当前时间。
11
+ ### 商品表(products)
12
+ 商品表用于存储可供购买的商品信息。以下是该表中每个字段的含义:
13
+ - `id`: 这是一个整数类型的自增字段,作为商品的唯一标识符(主键)。
14
+ - `name`: 字符串类型,用于存储商品的名称。
15
+ - `description`: 文本类型,用于存储商品的详细描述,可能包括规格、特点、使用说明等。
16
+ - `price`: 小数类型,用于存储商品的价格。这里的格式设置为最多10位数字,其中2位是小数。
17
+ - `stock`: 整数类型,用于存储商品的库存数量。
18
+ - `category_id`: 整数类型,用于存储商品所属类别的ID。这个字段可以与一个商品分类表关联,以实现商品分类。
19
+ - `merchant_id`: 整数类型,用于存储销售该商品的商家的ID。该字段是一个外键,指向商家表中的相应记录。
20
+ - `create_time`: 时间戳类型,记录商品创建的时间。
21
+ - `update_time`: 时间戳类型,记录商品信息最后更新的时间。
22
+ ### 商家表(merchants)
23
+ 商家表用于存储销售商品的商家信息。以下是该表中每个字段的含义:
24
+ - `id`: 这是一个整数类型的自增字段,作为商家的唯一标识符(主键)。
25
+ - `name`: 字符串类型,用于存储商家的名称或品牌名。
26
+ - `description`: 文本类型,用于存储商家的详细描述,可能包括商家简介、服务内容、联系方式等。
27
+ - `email`: 字符串类型,用于存储商家的电子邮件地址,可以用于联系商家。
28
+ - `mobile`: 字符串类型,用于存储商家的联系电话。
29
+ - `address`: 字符串类型,用于存储商家的地址信息。
30
+ - `create_time`: 时间戳类型,记录商家账户创建的时间。
31
+ - `update_time`: 时间戳类型,记录商家信息最后更新的时间。
32
+ 这些表的设计是相互关联的,例如,商品表中的`merchant_id`字段将商品与商家表中的特定商家关联起来。
Question to SQL.csv ADDED
The diff for this file is too large to render. See raw diff
 
README.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
Schema.txt ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE TABLE `users` (
2
+ `id` INT NOT NULL AUTO_INCREMENT,
3
+ `username` VARCHAR(50) NOT NULL,
4
+ `password` VARCHAR(50) NOT NULL,
5
+ `email` VARCHAR(100),
6
+ `mobile` VARCHAR(20),
7
+ `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
8
+ `update_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
9
+ PRIMARY KEY (`id`),
10
+ UNIQUE KEY `uk_username` (`username`),
11
+ UNIQUE KEY `uk_email` (`email`),
12
+ UNIQUE KEY `uk_mobile` (`mobile`)
13
+ );
14
+
15
+ CREATE TABLE `products` (
16
+ `id` INT NOT NULL AUTO_INCREMENT,
17
+ `name` VARCHAR(100) NOT NULL,
18
+ `description` TEXT,
19
+ `price` DECIMAL(10, 2) NOT NULL,
20
+ `stock` INT NOT NULL,
21
+ `category_id` INT,
22
+ `merchant_id` INT NOT NULL,
23
+ `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
24
+ `update_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
25
+ PRIMARY KEY (`id`),
26
+ FOREIGN KEY (`merchant_id`) REFERENCES `merchants` (`id`)
27
+ );
28
+
29
+ CREATE TABLE `merchants` (
30
+ `id` INT NOT NULL AUTO_INCREMENT,
31
+ `name` VARCHAR(100) NOT NULL,
32
+ `description` TEXT,
33
+ `email` VARCHAR(100),
34
+ `mobile` VARCHAR(20),
35
+ `address` VARCHAR(255),
36
+ `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
37
+ `update_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
38
+ PRIMARY KEY (`id`),
39
+ UNIQUE KEY `uk_name` (`name`),
40
+ UNIQUE KEY `uk_email` (`email`),
41
+ UNIQUE KEY `uk_mobile` (`mobile`)
42
+ );