范列sql:
CREATE TABLE example6 (
id INT PRIMARY KEY AUTO_INCREMENT ,
stu_id INT NOT NULL,
name VARCHAR(20) NOT NULL
);
insert into example6 values (1,002,'黎明');
insert into example6 values (2,003,'黎明2');
select * from example6;
执行过程如下所示:
mysql> CREATE TABLE example6 (
-> id INT PRIMARY KEY AUTO_INCREMENT ,
-> stu_id INT NOT NULL,
-> name VARCHAR(20) NOT NULL
-> );
Query OK, 0 rows affected (0.03 sec)
mysql>
mysql> insert into example6 values (1,002,'黎明');
Query OK, 1 row affected (0.02 sec)
mysql> select * from example6;
+----+--------+--------+
| id | stu_id | name |
+----+--------+--------+
| 1 | 2 | 黎明 |
+----+--------+--------+
1 row in set (0.00 sec)
mysql> insert into example6 values (2,003,'黎明2');
Query OK, 1 row affected (0.01 sec)
mysql> select * from example6;
+----+--------+---------+
| id | stu_id | name |
+----+--------+---------+
| 1 | 2 | 黎明 |
| 2 | 3 | 黎明2 |
+----+--------+---------+
2 rows in set (0.00 sec)
mysql>
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。