必备sql和表关系及授权
graph LR 执行1[必备sql和授权] 执行2[SQL强化和实践] 执行3[索引和函数以及存储过程] 执行4[Python操作mysql和应用] 执行5[常见SQL语句] 执行6[表关系] 执行7[授权管理] 执行8[一对多] 执行9[多对多] Mysql --> 执行1 Mysql --> 执行2 Mysql --> 执行3 Mysql --> 执行4 执行1 --> 执行5 执行1 --> 执行6 执行1 --> 执行7 执行6 --> 执行8 执行6 --> 执行9简要:
- 必备SQL(八个必备)
- 表关系
- 授权
1.必备SQL语句
通过下面这两张表进行SQL语句延申测试
depart表跟info表
create database test default charset utf8 collate utf8_general_ci;
在test数据库创建两个需要关联的表
use test;
create table depart (
id int not null auto_increment primary key,
title varchar(16) not null
)default charset utf8;
create table info (
id int not null auto_increment key,
name varchar(16) not null ,
age int,
depart_id int
)
插入数据
use test;
insert into depart(title) value ("开发"),("运营"),("销售");
insert into info(name,email,age,depart_id) value("吴佩琦","[email protected]",19,1);
insert into info(name,email,age,depart_id) value("张三","[email protected]",49,1);
insert into info(name,email,age,depart_id) value("李氏","[email protected]",9,2);
insert into info(name,email,age,depart_id) value("王五","[email protected]",29,1);
insert into info(name,email,age,depart_id) value("李杰","[email protected]",39,3);
insert into info(name,email,age,depart_id) value("超","[email protected]",49,1);
insert into info(name,email,age,depart_id) value("关羽","[email protected]",49,1);
1.1.条件
根据条件搜索结果
select * from info where id > 1;
标签:info,depart,--,数据库,MySQL,SQL,into,执行,id
From: https://www.cnblogs.com/powell/p/16801686.html