创建以这些字段,人名,性别,电话号码, 电子邮件,住址,年龄 ,学历,身份证号的假数据1000条并写出导入数据库的sql语句
时间: 2023-12-15 10:05:12 浏览: 163
假设表名为`person_info`,SQL语句如下:
```
CREATE TABLE person_info (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(50) NOT NULL,
gender ENUM('male', 'female') NOT NULL,
phone VARCHAR(20) NOT NULL,
email VARCHAR(50) NOT NULL,
address VARCHAR(100) NOT NULL,
age INT NOT NULL,
education VARCHAR(50) NOT NULL,
id_card VARCHAR(20) NOT NULL
);
INSERT INTO person_info (name, gender, phone, email, address, age, education, id_card)
VALUES
('张三', 'male', '13911111111', 'zhangsan@163.com', '北京市海淀区中关村', 35, '本科', '110101198001010011'),
('李四', 'male', '13922222222', 'lisi@163.com', '上海市浦东新区张江', 28, '硕士', '310101199301010022'),
('王五', 'female', '13933333333', 'wangwu@163.com', '广东省深圳市南山区', 23, '本科', '440101199812310033'),
('赵六', 'male', '13944444444', 'zhaoliu@163.com', '河北省石家庄市裕华区', 42, '博士', '130101197901010044'),
('钱七', 'female', '13955555555', 'qianqi@163.com', '江苏省南京市鼓楼区', 31, '本科', '320101198801010055'),
...
-- 插入 995 条假数据
('张三丰', 'male', '13910000001', 'zsf@163.com', '湖北省武当山', 127, '无', '110101000000000001'),
('李白', 'male', '13910000002', 'libai@163.com', '陕西省咸阳市', 133, '无', '610101000000000002'),
('林黛玉', 'female', '13910000003', 'lindaiyu@163.com', '江苏省苏州市', 18, '高中', '320101200001010003'),
('贾宝玉', 'male', '13910000004', 'jiabaoyu@163.com', '北京市宣武门大街', 16, '初中', '110101200301010004'),
('薛宝钗', 'female', '13910000005', 'xuebaochai@163.com', '江苏省无锡市', 22, '本科', '320101199901010005');
```
注:这里生成的身份证号为随机生成,不涉及真实身份证号,仅供参考。
阅读全文