![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sql
文章平均质量分 78
hello~你好
这个作者很懒,什么都没留下…
展开
-
sql基础进阶篇三
三、高级查询 1.补充概念:主键和外键in/exists 主从表、一对多、从表的外键指向主表的主键in/exists SELECT * FROM emp WHERE deptno EXISTS(SELECT deptno FROM dept WHERE dname='Research');//先从内表进行查询 然后查询内表的dept字段 条件是dname='Research SELECT * from emp where EXISTS (SELECT * FROM dep...原创 2020-06-15 10:10:08 · 116 阅读 · 0 评论 -
mysql基础班进阶二
一、单表增删改查基础篇 1.ALTER TABLE emp add money DECIMAL; //修改表的结构 ALTER TABLE emp DROP money; 2.select *[字段名列表] from [表名] where 过滤条件1 and 过滤条件2 //多个条件查询 select * from student where sex='男'; 3.insert into tb(字段列表) value (?,?,?) //添加一个字段 INSERT i...原创 2020-06-10 17:21:39 · 131 阅读 · 0 评论 -
mysql基础进阶版一
SQL 数据库表的创建,修改,删除 【1】创建、删除表格 create table 表名(字段定义)/drop table 表名 当tb存在时删除重建 drop TABLE if EXISTS shopping; CREATE TABLE shopping ( id INT PRIMARY KEY auto_increment, name VARCHAR(50), price DECIMAL(这里不能有逗号) ); SELECT * from shopping; //删除 dro...原创 2020-06-10 12:15:53 · 122 阅读 · 0 评论