首页
学习
活动
专区
圈层
工具
发布
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    MySQL数据库 SQL语句详解

    数据库常用操作 操作 语句 创建数据库 create database if not exists 数据库名; 查看所有数据库 show databases; 切换数据库 use 数据库名; 删除数据库...drop database if exists 数据库名; 修改数据库编码 alter database 数据库名 character set utf8; 表结构常用操作 操作 语句 创建表 create...table if not exists 表名(字段名 数据类型, 字段名 数据类型, ...); 查看当前数据库所有表 show tables; 查看表结构 desc 表名; 查看指定表的创建语句 show...值1); 数据修改 update 表名 set 字段名=值, ... , 字段名=值 where 条件 删除表中数据 delete from 表名 where 条件 删除表 truncate 表名 MYSQL...约束 操作 语句 主键 primary key 删除主键约束 alter table 表名 drop primary key; 自增长 auto_increment 非空 not null 创建表前指定

    6.8K30
    领券