初学之sql基础语法单表系列!

新手福利

  • 创建数据库
create database 数据库名;
  • 创建表
create table 表名(
  列名 类型 约束,
  列名2 类型 约束
);
  • 类型:char、varchar、int、double、date

  • 约束:primary key、unique、not null、foreign key

  • 增**
    insert into 表名(列名,...) values('值',...);


  • update 表名 set 列名=值,.... where 条件;


  • delete from 表名 where 条件;

  • 查(可以参照sql手册)

select
 distinct | 列名,...
from 表名
where 条件
group by 分组
	having 分组条件
order by 列名 asc|desc
limit 开始索引,每页显示个数

下面为各种手册地址(很全)

https://www.php.cn/course/type/3.html

猜你喜欢

转载自blog.csdn.net/weixin_47900124/article/details/108518674