mysql基础

懵懂的女人 提交于 2020-02-15 23:29:24
  • 数据库
  • 显示所有数据库:show databases
  • 创建数据库:create database 数据库名
  • 选择数据库:use 数据库名
  • 显示当前数据库:select database()
  • 删除数据库:drop database 数据库名
 
  • 创建表:create table 表名(字段名 字段类型 [not null][unique][auto_increment][primary key][comment '']);
  • 查看表结构:
    • describe 表名
    • show columns 表名
    • show create table 表名
  • 删除表:drop table 表名
  • 删除表内容,保留表结构:truncate table 表名
  • 删除表内容:delete from 表名 where 删除条件
 
 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!