学习总结

今天学习了一下数据库方面的相关知识,以前的一些知识有所遗忘。

1.显示数据库列表。

show databases;
2.显示库中的数据表:
use mysql; //打开库
3.显示数据表的结构:
describe 表名;
4.建库:
create database 库名;
5.建表:
use 库名;
create table 表名 (字段设定列表);
CREATE TABLE table_name (column_name column_type);
6.删库和删表:
drop database 库名;
drop table 表名;
7.将表中记录清空:
delete from 表名;
8.显示表中的记录:
select * from 表名;
posted @ 2022-01-20 21:06  今天又双叒叕在敲代码  阅读(16)  评论(0编辑  收藏  举报