DDL

数据库操作

  1. 查询
  • 查询所有数据库:show databases;
  • 查询当前数据库:select database();
  1. 使用
  • 使用数据库:use 数据库名;
  1. 创建
  • 创建数据库:create database [if not exists] 数据库名;
  1. 删除
  • 删除数据库:drop database [if exists] 数据库名;

表结构操作

  1. 创建
    create table 表名( 字段1 字段类型 [约束] [comment 字段1注释], ... 字段n 字段类型 [约束] [comment 字段n注释], ) [comment 表注释];
posted @ 2025-01-08 10:52  HMei  阅读(35)  评论(0)    收藏  举报