随笔分类 -  mysql

摘要:SELECT a.class,e.course,AVG(e.score) from account a,exam e where a.id=e.aid GROUP BY a.class,e.course 阅读全文
posted @ 2020-12-17 19:34 高登汗 阅读(172) 评论(0) 推荐(0)
摘要:分组1、limit start (开始,从第几行开始查),count(从开始行下一行,往后查几行数据)select * from 表名 limit start,countselect * from 表名 limie 9,5外键定义、连接两个表的1、先建主表 插入数据2、再建子表注意 一定先创建与主表 阅读全文
posted @ 2020-10-08 07:44 高登汗 阅读(180) 评论(0) 推荐(0)
摘要:-- 查询类型 cate_name 为 '超级本' 的商品名称 name 、价格 price ( where )select name,price from goods where cate_name = "超级本"; -- 显示商品的种类-- 1 分组的方式( group by ) select 阅读全文
posted @ 2020-10-08 07:41 高登汗 阅读(1553) 评论(0) 推荐(0)
摘要:-- 查询练习 -- 查询所有字段 -- select * from 表名; select * from students; -- 查询指定字段 -- select 列1,列2,... from 表名; select name,gender from students; -- 使用 as 给字段起别 阅读全文
posted @ 2020-10-08 07:40 高登汗 阅读(159) 评论(0) 推荐(0)
摘要:--sql语句的注意 : 1 以;作为结束符 2 不区分大小写--01 mysql 数据库的操作 -- 链接数据库 mysql -uroot -pmysql -- 不显示密码 mysql -uroot -p mysql -- 退出数据库 exit/quti/ctrl + d -- sql语句最后需要 阅读全文
posted @ 2020-10-08 07:34 高登汗 阅读(113) 评论(0) 推荐(0)
摘要:1.先进入MySQL 2.在进入user库 3执行以下命令 create user root@'%' identified by'1'; 注释(root用户名 1 密码) drop user root@'%'; flush privileges; grant all on *.* to 'root' 阅读全文
posted @ 2020-10-08 07:33 高登汗 阅读(261) 评论(0) 推荐(0)