SET NAMES utf8mb4; SET FOREIGNKEYCHECKS = 0; -- ---------------------------- -- Table…
- User
SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0;
-- Table structure for order_master
DROP TABLE IF EXISTS
order_master; CREATE TABLEorder_master(order_idint(18) NOT NULL AUTO_INCREMENT COMMENT '订单主键',buyer_namevarchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '买家名字',buyer_phonevarchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '买家电话',order_amountdecimal(8, 2) NOT NULL COMMENT '总金额',statustinyint(3) NOT NULL DEFAULT 0 COMMENT '订单状态',create_timetimestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',create_uservarchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',update_timetimestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',update_uservarchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '修改人', PRIMARY KEY (order_id) USING BTREE, INDEXidx_buyer_openid(buyer_phone) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Compact;SET FOREIGN_KEY_CHECKS = 1;
- Assistant
This SQL script creates a table called
order_masterwith the following columns:order_id(integer): The primary key of the order.buyer_name(varchar): The name of the buyer.buyer_phone(varchar): The phone number of the buyer.order_amount(decimal): The total amount of the order.status(tinyint): The status of the order.create_time(timestamp): The timestamp when the order was created.create_user(varchar): The user who created the order.update_time(timestamp): The timestamp when the order was last updated.update_user(varchar): The user who last updated the order.
Note: The table uses the
utf8mb4character set andutf8mb4_general_cicollation to support the storage of Unicode characters. Theorder_idcolumn is set as the primary key, and there is also an index on the column. - User
根据这个脚本 ,给一个生成一万条数据的脚本
- Assistant
Here is a script that generates 10,000 rows of data for the
order_mastertable based on the table structure provided:sql