数据库的使用实例
一、概述
二、MySql
1.概述
2.命令使用
(1)登录:mysql -u root -p
(2)显示数据库:show databases;
(3)创建数据库:create database db1;
(4)删除数据库:drop db2;
(5)使用数据库:use db1;
(6)显示表:show tables;
(7)创建表:create table student(name varchar(20),age int);
(8)显示所有表:show tables;
(9)显示表结构:describe student;
(10)删除表:drop table car,person;
(11)向表中添加一条记录:insert into student values(‘zhang yi’,20);
(12)从表中查下所有数据:select * from student;
(13)修正/更新记录:update student set age=21 where name=‘zhang yi’;
(14)选择特定行:select * from student where name = ‘zhang yi’;
或:select * from student where name=‘li li’ AND age=‘21’;
(15)增加1列:alter table student add column single char(1);
(16)删除1条记录:delete from student where name=‘li qiang’;
(17)
三、Redis
四、MongoDB