修改mysql密码:update user set authentication_string=password('root') where user='root' ;
-----------------------------------------------------------------------------------------------------
cd C:\xampp\mysql\bin
mysql -uroot -p
create database eisc;
#创建数据库
use eisc;
#进入数据库
create table eisc(id int,xingming varchar(10),b1 int,b2 int,primary key(id));
#新建键,最后一个设置id为主键
insert into eisc(id,xingming,b1,b2) values(1000,'zhangshan',2001,3001);
#加入表数据,重复输入为加入多个数据
select * from eisc;
#查询表中所有数据
select banzhurenhao from eisc where banjihao in(1701002);
#找班主任号,从eisc表中找班级号是1701002的班主任号
select xingmin from eisc where banjihao in (1701001,1701002);
#查找姓名,从eisc表中找班级号是(1701001,1701002)的所有姓名
select max(b2) as max_b2 from eisc;
#选中一个列b2的最大值,并在新列表中打印,在eisc表格中选取;
#参数:max:最大; min:最小; count avg
======================================================================
#数据库联接查询(链接2个表)
------------------------
select shuhao,chengji,banhao,name
#联接后需要显示这些表列(在一个表列里添加要显示的表列)
from lianjie,xueshengbiao
#联接这两个表,从这两个表中选取要显示的表列(课程表与连接表)
where xueshengbiao.xuehao=lianjie.xuehao
#执行要求显示,按照两个列表中共有表列且相等的值为链接条件
========================================================================
#链接三个表
-------------
select shuhao,chengji,banhao,name,kecheng
from lianjie,kecheng,xueshengbiao
where xueshengbiao.xuehao=lianjie.xuehao
and kecheng.shuhao=lianjie.shuhao
下载>>>>>MySQL建表导入
===========================================================================
Powered by ddoss.cn 12.0
©2015 - 2025 ddoss
渝公网安备50011302222260号
渝ICP备2024035333号
【实验平台安全承诺书】
小绿叶技术社区,优化网络中,点击查看配置信息
主机监控系统: 安全防火墙已开启检查cc攻击-下载文件完成后等待10s 恢复访问,检查连接数低于峰值恢复访问
您的IP:216.73.216.110,2025-12-01 14:24:30,Processed in 0.01241 second(s).