MySQL权威开发指南.pdf
- 小布个人认证 |
- 2021-11-27 发布|
- 252.06 KB|
- 45页
MySQL 开发者 SQL 权威指南 SQL For MySQL Developers
A Comprehensive Tutorial and Reference 整理:侯杰
MySQL 开发范例 第一章 SQL 概要
1. 引入一个名为 BOOKSQL 的新用户,他的密码是 BOOKSQLPW 。
CREATE USER ‘BOOKSQL’@’LOCALHOST’ IDENTIFIED BY ‘BOOKSQLPW’
create user houjie410782‘ ’@ ’localhost ’ identified by 630529‘ ’
2. 给 SQL 用户 BOOKSQL 创建和操作表的权限。
grant all privileges on *.* to ‘BOOKSQL’@’LOCALHOST’ with grant option;
grat all privileges on *.* to houjie410782‘ ’@ ’localhost ’ with grant option;
3. 创建数据库 tennis 。
create database tennis;
4. 指定 tennis 为当前数据库。
use tennis;
5. 创建表 players ,teams ,matches ,penalties ,committee_members 。 create table players
(playerno integer not null,
name char(15) not null,
initials char(3) not null,
birth_date date,
sex char(1) not null,
joined smallint not null,
street varchar(30) not null,
houseno