数据库基础 - 1:基础杂谈

admin
2022-03-06 / 0 评论 / 32 阅读 / 正在检测是否收录...

net stop/star msyl80

sql通用语法
单行注释 -- # 多行注释/ /

create database [if not exists] [default charset字符集] [collate排序规则]

drop database [if exists] 数据库名

use 数据库名 使用/切换数据库

select database() 查询当前数据库名

show tables 查询单签数据库的所有表
desc 表名 查询表结构
show create table 表明 查询指定表的建表

create table 表名(
id int(5) comment '123' not null,
字段1 字段1类型 [comment 字段1注释],
字段2 字段2类型 [comment 字段2注释],
字段3 字段3类型 [comment 字段3注释]
)[comment 表注释]

select database():查看数据库
select version():查看数据库版本
select now():查看数据库当前时间

0

打赏

海报

正在生成.....

评论 (0)

取消