让我们首先创建一个表-
mysql> create table DemoTable1907 ( UserId int NOT NULL AUTO_INCREMENT, UserName varchar(20), UserAge int, UserCountryName varchar(20), PRIMARY KEY(UserId) )ENGINE=MyISAM,AUTO_INCREMENT=100;
使用插入命令在表中插入一些记录-
mysql> insert into DemoTable1907(UserName,UserAge,UserCountryName) values('Chris',26,'US'); mysql> insert into DemoTable1907(UserName,UserAge,UserCountryName) values('David',38,'UK'); mysql> insert into DemoTable1907(UserName,UserAge,UserCountryName) values('John',28,'AUS');
使用select语句显示表中的所有记录-
mysql> select * from DemoTable1907;
这将产生以下输出-
+--------+----------+---------+-----------------+ | UserId | UserName | UserAge | UserCountryName | +--------+----------+---------+-----------------+ | 100 | Chris | 26 | US | | 101 | David | 38 | UK | | 102 | John | 28 | AUS | +--------+----------+---------+-----------------+ 3 rows in set (0.00 sec)