创建一个表people,id列设为主键,且自动递增
在mysql中,
create people (id int not null primary key auto_increment, name varchar(20), sexvarchar(20))
在sql server中
create table people(
id INT not null identity,
name varchar(20),
sex varchar(20)
)
MS SQL 使用 IDENTITY 关键字来执行 auto-increment 任务。默认地,IDENTITY 的开始值是 1,每条新纪录递增 1。如果以 20 起始且递增 10,要把 identity 改为 IDENTITY(20,10)在mysql中,要创建一个用户并赋给他某个数据库的权限,可以使用
grant权限 on 数据库.* to 用户名@登录主机 identified by "密码"
例如 grant * on hntest.* to username@localhost identified by password
表示赋予用户username对于hntest数据库的所有权限,用户的密码是password