Home > Database > Mysql Tutorial > mysql 复习与学习(二)_MySQL

mysql 复习与学习(二)_MySQL

WBOY
Release: 2016-06-01 13:29:37
Original
976 people have browsed it

bitsCN.com

mysql -h localhost -uroot -p123456 //连接数据库

show databases; //查看数据库

create database if not exists db_goods; //创建数据库

use db_goods; //使用数据库

show tables; //查看数据库里表

create table goods(id int, name varchar(10)); //创建表

desc goods; //查看标结构

insert into goods(id, name) values('1', 'zhangsan'); //表中插入数据

update goods set name = 'lisi', id = '3' where id = '1'; // 更新数据

delete from goods where id = '1';//删除数据

drop table if exists goods; //删除表

drop database if exists db_goods; //删除数据库

? contents; //查看帮助

? create table;//查看创建表帮助

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template