Sql udesc

Disponível somente no TrabalhosFeitos
  • Páginas : 6 (1351 palavras )
  • Download(s) : 0
  • Publicado : 29 de março de 2012
Ler documento completo
Amostra do texto
PLANO DE TRABALHO INDIVIDUAL TRABALHO FINAL
Diego P. Bonano Luiz Torres Tony Hass

SQL

CREATES
PROFESSOR
BEGIN

CREATE TABLE [dbo].[PROFESSOR](
[matricula] [int] NOT NULL, [nome] [nvarchar](50) NOT NULL, [centro] [nvarchar](10) NOT NULL, [dpto] [nvarchar](10) NOT NULL,

[semestre] [nvarchar](5) NOT NULL,
[catego_func] [nvarchar](10) NOT NULL, [titulacao] [nvarchar](10) NOT NULL,[regime] [nvarchar](10) NOT NULL, [classe] [nvarchar](10) NOT NULL, CONSTRAINT [PK_PROFESSOR] PRIMARY KEY CLUSTERED ( [matricula] ASC ) ) ON [PRIMARY] END GO
19/05 2

CREATES
ORIENTAÇÃO
CREATE TABLE [dbo].[AT_ORIENTACAO]( [cod_at] [int] IDENTITY(1,1) NOT NULL, [codpro] [int] NOT NULL, [modalidade] [nvarchar](10) NOT NULL, [nm_orientado] [nvarchar](50) NOT NULL, [curso_hab] [nvarchar](30)NULL, [fase] [char](2) NOT NULL, [ch_semestre] [int] NOT NULL, CONSTRAINT [PK_AT_ORIENTACAO] PRIMARY KEY CLUSTERED (

[modalidade] ASC,
[nm_orientado] ASC, [fase] ASC ) ) ON [PRIMARY]

19/05

3

CREATES
EXTENSÃO
CREATE TABLE [dbo].[AT_EXTENSAO]( [cod_at] [int] IDENTITY(1,1) NOT NULL, [codpro] [int] NOT NULL, [categoria] [nvarchar](200) NOT NULL, [carga_horaria] [decimal](4, 2) NULL,[autorizacao] [nvarchar](25) NULL, [dt_inicio] [date] NOT NULL, [dt_fim] [date] NOT NULL, CONSTRAINT [PK_AT_EXTENSAO] PRIMARY KEY CLUSTERED (

[cod_at] ASC
) ) ON [PRIMARY] ALTER TABLE [dbo].[AT_EXTENSAO] WITH CHECK ADD CONSTRAINT [FK_AT_EXTENSAO_PROFESSOR] FOREIGN KEY([codpro]) REFERENCES [dbo].[PROFESSOR] ([matricula]) ALTER TABLE [dbo].[AT_EXTENSAO] CHECK CONSTRAINT [FK_AT_EXTENSAO_PROFESSOR]19/05

4

CREATES
ENSINO PROJ
CREATE TABLE [dbo].[AT_ENSINO_PROJ]( [cod_at] [int] IDENTITY(1,1) NOT NULL, [codpro] [int] NOT NULL, [projeto] [nvarchar](50) NOT NULL, [carga_horaria] [decimal](4, 2) NOT NULL, [autorizacao] [nvarchar](25) NOT NULL, [dt_inicio] [date] NOT NULL, [dt_fim] [date] NOT NULL, CONSTRAINT [PK_AT_ENSINO_PROJ] PRIMARY KEY CLUSTERED (

[cod_at] ASC
) ) ON [PRIMARY]ALTER TABLE [dbo].[AT_ENSINO_PROJ] WITH CHECK ADD CONSTRAINT [FK_AT_ENSINO_PROJ_PROFESSOR] FOREIGN KEY([codpro]) REFERENCES [dbo].[PROFESSOR] ([matricula]) ALTER TABLE [dbo].[AT_ENSINO_PROJ] CHECK CONSTRAINT [FK_AT_ENSINO_PROJ_PROFESSOR]

5

CREATES
ENSINO POS
CREATE TABLE [dbo].[AT_ENSINO_POS]( [cod_at] [int] IDENTITY(1,1) NOT NULL, [codpro] [int] NOT NULL, [disciplina] [nvarchar](50) NOTNULL, [programa] [nvarchar](30) NULL, [semestre] [varchar](5) NULL, [credito] [int] NOT NULL,

CONSTRAINT [PK_AT_ENSINO_POS] PRIMARY KEY CLUSTERED
( [cod_at] ASC ) ) ON [PRIMARY] ALTER TABLE [dbo].[AT_ENSINO_POS] WITH CHECK ADD CONSTRAINT [FK_AT_ENSINO_POS_PROFESSOR] FOREIGN KEY([codpro]) REFERENCES [dbo].[PROFESSOR] ([matricula]) ALTER TABLE [dbo].[AT_ENSINO_POS] CHECK CONSTRAINT[FK_AT_ENSINO_POS_PROFESSOR]
6

CREATES
ENSINO GRAD
CREATE TABLE [dbo].[AT_ENSINO_GRAD]( [codpro] [int] NOT NULL, [disciplina] [nvarchar](50) NOT NULL, [curso_hab] [nvarchar](50) NOT NULL, [fase] [int] NOT NULL, [ch_ens] [decimal](4, 2) NULL, [ch_pedag] [decimal](4, 2) NULL, CONSTRAINT [PK_AT_ENSINO_GRAD] PRIMARY KEY CLUSTERED ( [codpro] ASC, [disciplina] ASC, [curso_hab] ASC, [fase] ASC ) ) ON [PRIMARY]ALTER TABLE [dbo].[AT_ENSINO_GRAD] WITH CHECK ADD CONSTRAINT [FK_AT_ENSINO_GRAD_PROFESSOR] FOREIGN KEY([codpro]) REFERENCES [dbo].[PROFESSOR] ([matricula]) ALTER TABLE [dbo].[AT_ENSINO_GRAD] CHECK CONSTRAINT [FK_AT_ENSINO_GRAD_PROFESSOR]

7

CREATES
CONFERENCIA
CREATE TABLE [dbo].[AT_CONFERENCIA]( [codigo] [int] IDENTITY(1,1) NOT NULL, [codpro] [int] NOT NULL, [plano_atividade][nvarchar](30) NOT NULL, [setor] [nvarchar](30) NOT NULL, CONSTRAINT [PK_AT_CONFERENCIA] PRIMARY KEY CLUSTERED ( [codigo] ASC ) ) ON [PRIMARY] ALTER TABLE [dbo].[AT_CONFERENCIA] WITH CHECK ADD CONSTRAINT [FK_AT_CONFERENCIA_PROFESSOR] FOREIGN KEY([codpro]) REFERENCES [dbo].[PROFESSOR] ([matricula]) ALTER TABLE [dbo].[AT_CONFERENCIA] CHECK CONSTRAINT [FK_AT_CONFERENCIA_PROFESSOR]

8

CREATES
ADMIN...
tracking img