热线电话:13121318867

登录
2023-08-11 阅读量: 822
CDA数据分析一级教材SQL语句02

2.DDL

-- 创建一个名为 test 的数据库

create database test;


-- 查看当前用户权限内的所有数据库

show databases;

+----------+

|Database |

|information schema |

|test |

|performance schema |

|Sys|

-- 使用创建好的 test 数据库

use test;

-- 删除创建好的 test 数据库

drop database test;


-- 1。使用 test 数据库

use test;

-- 2. 创建部门信息表

create table dept(

depid char(3),

depname varchar(20),

peoplecount int

);


-- 查看当前数据库所有的表

show tables;


--查看表结构

describe test.dept;



0.0000
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子