MySQL16

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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值