MySQL CREATE TABLE and INSERT: Card Information Database Example
CREATE TABLE card_information( id INT auto_increment PRIMARY KEY, --ID name VARCHAR(20) NOT NULL, --姓名 age INT UNSIGNED ZEROFILL, --年龄 sex VARCHAR(2) DEFAULT'男', --性别 address CHAR(10), --地址 score DOUBLE, --成绩 balance DECIMAL(5,2), --余额 time DATETIME, --时间 BeijingTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP --北京时间 ); INSERT INTO card_information (name, age, sex, address, score, balance, time) VALUES ('Alice', 25, '女', '北京', 90.5, 100.50, NOW());
INSERT INTO card_information (name, age, sex, address, score, balance, time) VALUES ('Bob', 28, '男', '上海', 85.2, 500.00, NOW());
INSERT INTO card_information (name, age, sex, address, score, balance, time) VALUES ('Cathy', 30, '女', '广州', 95.0, 300.25, NOW());
INSERT INTO card_information (name, age, sex, address, score, balance, time) VALUES ('David', 23, '男', '深圳', 80.0, 200.75, NOW());
INSERT INTO card_information (name, age, sex, address, score, balance, time) VALUES ('Emily', 27, '女', '成都', 87.5, 150.00, NOW());
INSERT INTO card_information (name, age, sex, address, score, balance, time) VALUES ('Frank', 32, '男', '重庆', 93.2, 400.50, NOW());
INSERT INTO card_information (name, age, sex, address, score, balance, time) VALUES ('Grace', 26, '女', '武汉', 89.8, 350.25, NOW());
INSERT INTO card_information (name, age, sex, address, score, balance, time) VALUES ('Henry', 29, '男', '南京', 84.6, 600.75, NOW());
INSERT INTO card_information (name, age, sex, address, score, balance, time) VALUES ('Iris', 31, '女', '杭州', 92.0, 250.00, NOW());
INSERT INTO card_information (name, age, sex, address, score, balance, time) VALUES ('Jack', 24, '男', '苏州', 88.7, 450.50, NOW());
原文地址: https://www.cveoy.top/t/topic/p7k6 著作权归作者所有。请勿转载和采集!