1.创建数据库
create database 数据库名称;
2.查看所有数据库
show databases;
3.使用(进入)数据库
use 数据库名称;
4.删除数据库
drop database 数据库名称;
5.查看当前数据库里所有表
show tables;
6.删除某个表
drop table 表名;
7.往表里插入数据
insert into 表名(字段)value(对应类型数据);
8.满足条件的更新数据
update 表名 set 字段名称=数据 where 字段=数据
注意:where 后面为条件,满足where后面的数据才能修改为where前面的数据
9.删除数据
delete from 表名 where 字段 =数据;
10.查询表内所有数据
select * from 表名
11.查询表中某几个字段的数据
select 字段1,字段2 from 表名;
12.查询满足条件的表中某几个字段
select 字段1,字段2 from 表名 where 字段=数据
13.查询某个字段不为空
select *from 表名where 字段 is null;
14.查询出某几个字段且满足某个字段不为空
select 字段1,字段2 from 表名 where 字段 is null;
15查询某个字开头的数据
select * from 表名 where 字段 like ’字%‘;
16.满足一个条件就可以查出来
select * from 表名 where 字段=数据 or 字段&
unity里常用数据库语句
最新推荐文章于 2023-01-05 16:55:44 发布