mysql> create database xscj;
ERROR 1007 (HY000): Can't create database 'xscj'; database exists
mysql> drop database xscj;
Query OK, 6 rows affected (0.01 sec)
mysql> create database xscj;
Query OK, 1 row affected (0.00 sec)
mysql> set names gbk;
Query OK, 0 rows affected (0.00 sec)
mysql> use xscj;
Database changed
mysql> source e:/sy121.sql;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 6 rows affected (0.00 sec)
Records: 6 Duplicates: 0 Warnings: 0
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 12 rows affected (0.00 sec)
Records: 12 Duplicates: 0 Warnings: 0
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 21 rows affected (0.00 sec)
Records: 21 Duplicates: 0 Warnings: 0
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> set @x='刘王章赵李钱朱何孙曾陈吴黄刘邓周毛江胡子';
Query OK, 0 rows affected (0.00 sec)
mysql> set @len1=char_length(@x);
Query OK, 0 rows affected (0.00 sec)
mysql> set @m1='依秋香巧花紫萱莉玉芳菊碧丽念雅红燕艳莲荷蕾紫莹颖琪';
Query OK, 0 rows affected (0.00 sec)
mysql> set @len2=char_length(@m1);
Query OK, 0 rows affected (0.00 sec)
mysql> set @m2='澄德海超阳昌瀚亮锋涵煦杰俊诚毅峰衍皓广邈言博畅';
Query OK, 0 rows affected (0.00 sec)
mysql> set @len3=char_length(@m2);
Query OK, 0 rows affected (0.00 sec)
mysql> set @xb=floor(rand()*2);
Query OK, 0 rows affected (0.00 sec)
mysql> set @xh='191100';
Query OK, 0 rows affected (0.00 sec)
mysql> set @xing=substring(@x,floor(rand()*@len1)+1,1);
Query OK, 0 rows affected (0.00 sec)
mysql> set @ming1=substring(@m1,floor(rand()*@len2)+1,1);
Query OK, 0 rows affected (0.00 sec)
mysql> set @xm1=concat(@xing,@ming1);
Query OK, 0 rows affected (0.00 sec)
mysql> set @xing=substring(@x,floor(rand()*@len1)+1,1);
Query OK, 0 rows affected (0.00 sec)
mysql> set @ming2=substring(@m2,floor(rand()*@len2)+1,1);
Query OK, 0 rows affected (0.00 sec)
mysql> set @xm2=concat(@xing,@ming2);
Query OK, 0 rows affected (0.00 sec)
mysql> create table xs1 as select 学号,姓名,性别 from xs where 1=2;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> set @xm=if(@xb=0,@xm2,@xm1);
Query OK, 0 rows affected (0.00 sec)
mysql> insert into xs1(学号,姓名,性别)values(@xh,@xm,if(@xb=0,'男','女'));
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> set @xing4=substring(@x,floor(rand()*@len1)+1,1);
Query OK, 0 rows affected (0.00 sec)
mysql> set @ming4=substring(@m2,floor(rand()*@len3)+1,1);
Query OK, 0 rows affected (0.00 sec)
mysql> set @xm3=concat(@xing4,@xing4,@ming4);
Query OK, 0 rows affected (0.00 sec)
mysql> insert into xs1 (学号,姓名,性别)values('191111',@xm3,@xb);
Query OK, 1 row affected (0.00 sec)
mysql> select *from xs1;
+--------+--------+------+
| 学号 | 姓名 | 性别 |
+--------+--------+------+
| 191100 | 朱畅 | 0 |
| 191111 | 吴吴阳 | 0 |
+--------+--------+------+
2 rows in set (0.00 sec)
mysql>
04-28
1930