创建学生表的sql语句,包含年龄,名字,手机号,成绩,10条数据
时间: 2024-09-18 16:10:09 浏览: 39
在 MySQL 数据库中创建学生表.zip
创建一个名为"students"的学生表的SQL语句可以如下所示,包含了年龄(age),名字(name),手机号(phone_number),以及成绩(score)字段,并插入10条示例数据:
```sql
CREATE TABLE students (
id INT AUTO_INCREMENT PRIMARY KEY,
age INT,
name VARCHAR(50),
phone_number VARCHAR(15),
score DECIMAL(5, 2)
);
INSERT INTO students (age, name, phone_number, score) VALUES
(18, '张三', '13912345678', 85.5),
(19, '李四', '13687654321', 90.0),
(20, '王五', '13700000000', 88.5),
(17, '赵六', '13857111111', 92.0),
(18, '刘七', '13522222222', 87.0),
(21, '陈八', '13333333333', 91.5),
(19, '周九', '15244444444', 89.5),
(18, '吴十', '13155555555', 90.5),
(20, '郑十一', '13266666666', 87.5),
(19, '冯十二', '13477777777', 91.0);
```
阅读全文