-- insert into userinfo(rid,pass,username) values(2,'123','tom');
-- update userinfo set pass='666' where rid=2;
--delete from userinfo where rid=2;
--select * from userinfo;
--drop table userinfo;
中文描述
创建一个表(table):create table 表名(列名1 类型(长度) primary key, 列名2 类型(长度), 列名3 类型(长度)) 增加内容:insert into 表名(列名1,列名2,列名3)values(列表1内容,列表1内容,列表1内容) 删除内容:delete 表名 where 列表1/列表2/列表3=列表1内容/列表2内容/列表3内容 改变内容:update 表名 set 列表2/列表3=内容 where 列表1/列表3/列表2=原来内容 查看内容:select*from 表名 删除该表:drop table 表名
数据库的操作
show databases;createdatabase ltwdb;
use ltwdb;
show tables;createtable userinfo(
id int auto_increment primarykey,
name varchar(20),
pwd varchar(20));select * from userinfo;
desc userinfo;
insertinto userinfo(name,pwd) values("ltw","123");update userinfo set name="gg"where id=2;deletefrom userinfo where id=2;