on primary -- 默认就属于primary文件组,可省略
--------创建数据库
create database message
go
--------使用数据库
use message
----------创建用户表
create table login
(
uname varchar(20) primary key, ------主键
upass varchar(20),
email varchar(50),
phone varchar(12),
addr varchar(50),
)
-----------创建留言信息表
create table message
(
uname varchar(20) foreign key(uname) references login,-----外键约束
title varchar(50),
content varchar(7500),
times datetime,
)
create table Product
(
ProductId int identity (1, 1) not null primary key,------主键,自动增长编号从1开始步长为1
PName varchar(50),
PDetail ntext,
PPrice money,
PMemberPrice money,
PFewPrice money,
PPictyre image,
BClassName varchar(50),
PTime datetime,
PStock int,
PClick int,
Detail1 varchar(50),
Detail2 varchar(50),
Detail3 varchar(50),
Detail4 varchar(50)
)