This project is read-only.
USE BD_PARQUE
GO
/****** Object: Table dbo.PESQUISA Script Date: 11/11/2012 14:27:38 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE dbo.PESQUISA(
PESQUISA_ID int NOT NULL,
PERGUNTA text NOT NULL,
RESPOSTA_UM nvarchar(max) NULL,
RESPOSTA_DOIS nvarchar(max) NULL,
RESPOSTA_TRES nvarchar(max) NULL,
CONSTRAINT PK__PESQUISA__4EEE50BA1273C1CD PRIMARY KEY CLUSTERED
(
PESQUISA_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY TEXTIMAGE_ON PRIMARY
GO
/****** Object: Table dbo.CRIANCA Script Date: 11/11/2012 14:27:38 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE dbo.CRIANCA(
CRIANCA_ID int IDENTITY(1,1) NOT NULL,
CRIANCA_NOME varchar(60) NOT NULL,
CRIANCA_RESTRICOES text NULL,
CRIANCA_NASCIMENTO date NOT NULL,
CRIANCA_FOTO text NULL,
CRIANCA_COUNT int NOT NULL,
CONSTRAINT PK__CRIANCA__F75EA46A03317E3D PRIMARY KEY CLUSTERED
(
CRIANCA_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY TEXTIMAGE_ON PRIMARY
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table dbo.COMBO Script Date: 11/11/2012 14:27:38 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE dbo.COMBO(
COMBO_ID int IDENTITY(1,1) NOT NULL,
COMBO_NOME varchar(60) NOT NULL,
COMBO_DESCRICAO text NOT NULL,
CONSTRAINT PK__COMBO__643B8FFA7F60ED59 PRIMARY KEY CLUSTERED
(
COMBO_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY TEXTIMAGE_ON PRIMARY
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table dbo.CADASTRO_LOGIN Script Date: 11/11/2012 14:27:38 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE dbo.CADASTRO_LOGIN(
CADASTRO_LOGIN_ID int IDENTITY(1,1) NOT NULL,
USUARIO varchar(20) NOT NULL,
SENHA varchar(12) NOT NULL,
TIPO nchar(20) NOT NULL,
PRIMARY KEY CLUSTERED
(
CADASTRO_LOGIN_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table dbo.ENDERECO Script Date: 11/11/2012 14:27:38 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE dbo.ENDERECO(
ENDERECO_ID int IDENTITY(1,1) NOT NULL,
ENDERECO_RUA nvarchar(max) NULL,
ENDERECO_NUMERO nvarchar(max) NOT NULL,
ENDERECO_BAIRRO nvarchar(max) NOT NULL,
ENDERECO_CEP nchar(8) NOT NULL,
ENDERECO_COMPLEMENTO nchar(50) NOT NULL,
CONSTRAINT PK__ENDERECO__C2DD61A821B6055D PRIMARY KEY CLUSTERED
(
ENDERECO_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY
GO
/****** Object: Table dbo.FUNCIONARIO Script Date: 11/11/2012 14:27:38 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE dbo.FUNCIONARIO(
FUNCIONARIO_ID int IDENTITY(1,1) NOT NULL,
FUNCIONARIO_NOME varchar(60) NOT NULL,
FUNCIONARIO_NASCIMENTO date NOT NULL,
FUNCIONARIO_CPF varchar(18) NULL,
FUNCIONARIO_ADMISSAO date NOT NULL,
FUNCIONARIO_SAIDA date NULL,
FUNCIONARIO_CARGO nchar(30) NULL,
CADASTRO_LOGIN_ID int NOT NULL,
CONSTRAINT PK__FUNCIONA__A60795AD0AD2A005 PRIMARY KEY CLUSTERED
(
FUNCIONARIO_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table dbo.RESPOSTA_CRIANCA Script Date: 11/11/2012 14:27:39 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE dbo.RESPOSTA_CRIANCA(
RESPOSTA_ID int IDENTITY(1,1) NOT NULL,
PESQUISA_ID int NOT NULL,
RESPOSTA_CRIACA_CONT_UM int NULL,
RESPOSTA_CRIACA_CONT_DOIS int NULL,
RESPOSTA_CRIACA_CONT_TRES int NULL,
CONSTRAINT PK__RESPOSTA__229A9C4A164452B1 PRIMARY KEY CLUSTERED
(
RESPOSTA_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY
GO
/****** Object: Table dbo.RESPONSAVEL Script Date: 11/11/2012 14:27:38 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE dbo.RESPONSAVEL(
RESPONSAVEL_ID int IDENTITY(1,1) NOT NULL,
RESPONSAVEL_NOME varchar(60) NOT NULL,
RESPONSAVEL_NASCIMENTO date NOT NULL,
RESPONSAVEL_PARENTESCO varchar(20) NOT NULL,
ENDERECO_ID int NOT NULL,
RESPONSAVEL_DATA_CADASTRO date NOT NULL,
RESPONSAVEL_CPF varchar(11) NOT NULL,
CONSTRAINT PK__RESPONSA__CFABC7B61A14E395 PRIMARY KEY CLUSTERED
(
RESPONSAVEL_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table dbo.TELEFONE_RESPONSAVEL Script Date: 11/11/2012 14:27:39 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE dbo.TELEFONE_RESPONSAVEL(
TELEFONE_RESPONSAVEL_ID int IDENTITY(1,1) NOT NULL,
TELEFONE varchar(30) NOT NULL,
RESPONSAVEL_ID int NOT NULL,
CONSTRAINT PK__TELEFONE__4DA15C80108B795B PRIMARY KEY CLUSTERED
(
TELEFONE_RESPONSAVEL_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table dbo.TELEFONE_FUNCIONARIO Script Date: 11/11/2012 14:27:39 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE dbo.TELEFONE_FUNCIONARIO(
TELEFONE_ID int IDENTITY(1,1) NOT NULL,
TELEFONE varchar(15) NULL,
FUNCIONARIO_ID int NOT NULL,
CONSTRAINT PK__TELEFONE__741D6BAF1DE57479 PRIMARY KEY CLUSTERED
(
TELEFONE_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table dbo.INGRESSO Script Date: 11/11/2012 14:27:38 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE dbo.INGRESSO(
INGRESSO_ID int IDENTITY(1,1) NOT NULL,
FUNCIONARIO_ID int NOT NULL,
CRIANCA_ID int NOT NULL,
RESPONSAVEL_ID int NOT NULL,
INGRESSO_VALOR float NOT NULL,
INGRESSO_DATA date NOT NULL,
INGRESSO_DESCONTO float NULL,
CONSTRAINT PK__INGRESSO__9770E0B50EA330E9 PRIMARY KEY CLUSTERED
(
INGRESSO_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY
GO
/****** Object: Table dbo.DEPENDENCIA Script Date: 11/11/2012 14:27:38 /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE dbo.DEPENDENCIA(
DEPENDENCIA_ID int IDENTITY(1,1) NOT NULL,
CRIANCA_ID int NOT NULL,
RESPONSAVEL_ID int NOT NULL,
DEPENDENCIA_DATA date NOT NULL,
CONSTRAINT PK__DEPENDEN__A139C74407020F21 PRIMARY KEY CLUSTERED
(
DEPENDENCIA_ID ASC
)WITH (PADINDEX = OFF, STATISTICSNORECOMPUTE = OFF, IGNOREDUPKEY = OFF, ALLOWROWLOCKS = ON, ALLOWPAGELOCKS = ON) ON PRIMARY
) ON PRIMARY
GO
/****** Object: ForeignKey FK_DEPENDENCIA_CRIANCA Script Date: 11/11/2012 14:27:38 /
ALTER TABLE dbo.DEPENDENCIA WITH CHECK ADD CONSTRAINT FK_DEPENDENCIA_CRIANCA FOREIGN KEY(CRIANCA_ID)
REFERENCES dbo.CRIANCA (CRIANCA_ID)
GO
ALTER TABLE dbo.DEPENDENCIA CHECK CONSTRAINT FK_DEPENDENCIA_CRIANCA
GO
/****** Object: ForeignKey FK_DEPENDENCIA_RESPONSAVEL Script Date: 11/11/2012 14:27:38 /
ALTER TABLE dbo.DEPENDENCIA WITH CHECK ADD CONSTRAINT FK_DEPENDENCIA_RESPONSAVEL FOREIGN KEY(RESPONSAVEL_ID)
REFERENCES dbo.RESPONSAVEL (RESPONSAVEL_ID)
GO
ALTER TABLE dbo.DEPENDENCIA CHECK CONSTRAINT FK_DEPENDENCIA_RESPONSAVEL
GO
/****** Object: ForeignKey FK__FUNCIONAR__CADAS__1A14E395 Script Date: 11/11/2012 14:27:38 /
ALTER TABLE dbo.FUNCIONARIO WITH CHECK ADD FOREIGN KEY(CADASTRO_LOGIN_ID)
REFERENCES dbo.CADASTRO_LOGIN (CADASTRO_LOGIN_ID)
GO
/****** Object: ForeignKey FK_INGRESSO_CRIANCA Script Date: 11/11/2012 14:27:38 /
ALTER TABLE dbo.INGRESSO WITH CHECK ADD CONSTRAINT FK_INGRESSO_CRIANCA FOREIGN KEY(CRIANCA_ID)
REFERENCES dbo.CRIANCA (CRIANCA_ID)
GO
ALTER TABLE dbo.INGRESSO CHECK CONSTRAINT FK_INGRESSO_CRIANCA
GO
/****** Object: ForeignKey FK_INGRESSO_FUNCIONARIO Script Date: 11/11/2012 14:27:38 /
ALTER TABLE dbo.INGRESSO WITH CHECK ADD CONSTRAINT FK_INGRESSO_FUNCIONARIO FOREIGN KEY(FUNCIONARIO_ID)
REFERENCES dbo.FUNCIONARIO (FUNCIONARIO_ID)
GO
ALTER TABLE dbo.INGRESSO CHECK CONSTRAINT FK_INGRESSO_FUNCIONARIO
GO
/****** Object: ForeignKey FK_INGRESSO_RESPONSAVEL Script Date: 11/11/2012 14:27:38 /
ALTER TABLE dbo.INGRESSO WITH CHECK ADD CONSTRAINT FK_INGRESSO_RESPONSAVEL FOREIGN KEY(RESPONSAVEL_ID)
REFERENCES dbo.RESPONSAVEL (RESPONSAVEL_ID)
GO
ALTER TABLE dbo.INGRESSO CHECK CONSTRAINT FK_INGRESSO_RESPONSAVEL
GO
/****** Object: ForeignKey FK_RESPONSAVEL_ENDERECO Script Date: 11/11/2012 14:27:38 /
ALTER TABLE dbo.RESPONSAVEL WITH CHECK ADD CONSTRAINT FK_RESPONSAVEL_ENDERECO FOREIGN KEY(ENDERECO_ID)
REFERENCES dbo.ENDERECO (ENDERECO_ID)
GO
ALTER TABLE dbo.RESPONSAVEL CHECK CONSTRAINT FK_RESPONSAVEL_ENDERECO
GO
/****** Object: ForeignKey FK_RESPOSTA_CRIANCA_PESQUISA Script Date: 11/11/2012 14:27:39 /
ALTER TABLE dbo.RESPOSTA_CRIANCA WITH CHECK ADD CONSTRAINT FK_RESPOSTA_CRIANCA_PESQUISA FOREIGN KEY(PESQUISA_ID)
REFERENCES dbo.PESQUISA (PESQUISA_ID)
GO
ALTER TABLE dbo.RESPOSTA_CRIANCA CHECK CONSTRAINT FK_RESPOSTA_CRIANCA_PESQUISA
GO
/****** Object: ForeignKey FK_TELEFONE_FUNCIONARIO_FUNCIONARIO Script Date: 11/11/2012 14:27:39 /
ALTER TABLE dbo.TELEFONE_FUNCIONARIO WITH CHECK ADD CONSTRAINT FK_TELEFONE_FUNCIONARIO_FUNCIONARIO FOREIGN KEY(FUNCIONARIO_ID)
REFERENCES dbo.FUNCIONARIO (FUNCIONARIO_ID)
GO
ALTER TABLE dbo.TELEFONE_FUNCIONARIO CHECK CONSTRAINT FK_TELEFONE_FUNCIONARIO_FUNCIONARIO
GO
/****** Object: ForeignKey FK_TELEFONE_RESPONSAVEL_RESPONSAVEL Script Date: 11/11/2012 14:27:39 /
ALTER TABLE dbo.TELEFONE_RESPONSAVEL WITH CHECK ADD CONSTRAINT FK_TELEFONE_RESPONSAVEL_RESPONSAVEL FOREIGN KEY(RESPONSAVEL_ID)
REFERENCES dbo.RESPONSAVEL (RESPONSAVEL_ID)
GO
ALTER TABLE dbo.TELEFONE_RESPONSAVEL CHECK CONSTRAINT FK_TELEFONE_RESPONSAVEL_RESPONSAVEL
GO

Last edited Nov 12, 2012 at 12:52 PM by GabrielLima01, version 1

Comments

No comments yet.