📄 questionnaire.sql
字号:
/*==============================================================*/
/* Database name: PhysicalDataModel_1 */
/* DBMS name: Microsoft SQL Server 2000 */
/* Created on: 2003-4-16 8:59:11 */
/*==============================================================*/
alter table dbo.Items
drop constraint FK_ITEMS_QUESTIONI_QUESTION
go
if exists (select 1
from sysobjects
where id = object_id('dbo.Admins')
and type = 'U')
drop table dbo.Admins
go
if exists (select 1
from sysobjects
where id = object_id('dbo.Items')
and type = 'U')
drop table dbo.Items
go
if exists (select 1
from sysobjects
where id = object_id('dbo.Questions')
and type = 'U')
drop table dbo.Questions
go
/*==============================================================*/
/* Table: Admins */
/*==============================================================*/
create table dbo.Admins (
Admname varchar(50) not null,
Admpwd varchar(50) not null,
constraint PK_ADMIN primary key clustered (Admname)
)
go
/*==============================================================*/
/* Table: Items */
/*==============================================================*/
create table dbo.Items (
ItemID int identity,
QuestionID int not null,
Item varchar(500) not null,
ItemCount bigint not null default 0,
constraint PK_ITEMS primary key clustered (ItemID)
)
go
/*==============================================================*/
/* Table: Questions */
/*==============================================================*/
create table dbo.Questions (
QuestionID int identity,
Question varchar(500) not null,
IsVisable int not null default 0,
Date varchar(50) null,
IsOpen int null default 1,
constraint PK_QUESTIONS primary key clustered (QuestionID)
)
go
alter table dbo.Items
add constraint FK_ITEMS_QUESTIONI_QUESTION foreign key (QuestionID)
references dbo.Questions (QuestionID)
go
insert into Admins values('admin','admin')
go
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -