Your SlideShare is downloading. ×
TABLA FESTIVAL<br />USE [cine]<br />GO<br />/****** Object:  Table [dbo].[festival]    Script Date: 09/24/2011 19:52:09 **...
Codigo Server  Festival
Codigo Server  Festival
Codigo Server  Festival
Codigo Server  Festival
Codigo Server  Festival
Codigo Server  Festival
Codigo Server  Festival
Codigo Server  Festival
Codigo Server  Festival
Codigo Server  Festival
Codigo Server  Festival
Codigo Server  Festival
Codigo Server  Festival
Upcoming SlideShare
Loading in...5
×

Codigo Server Festival

202

Published on

Codigo de Oracle a Server

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
202
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Codigo Server Festival"

  1. 1. TABLA FESTIVAL<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[festival] Script Date: 09/24/2011 19:52:09 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[festival]') AND type in (N'U'))<br />DROP TABLE [dbo].[festival]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[festival] Script Date: 09/24/2011 19:52:09 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[festival](<br />[festival] [nvarchar](50) NOT NULL,<br />[fundacion] [date] NULL,<br /> CONSTRAINT [PK_festival] PRIMARY KEY CLUSTERED <br />(<br />[festival] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />TABLA CERTAMEN<br />USE [cine]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_certamen_festival]') AND parent_object_id = OBJECT_ID(N'[dbo].[certamen]'))<br />ALTER TABLE [dbo].[certamen] DROP CONSTRAINT [FK_certamen_festival]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[certamen] Script Date: 09/24/2011 19:53:38 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[certamen]') AND type in (N'U'))<br />DROP TABLE [dbo].[certamen]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[certamen] Script Date: 09/24/2011 19:53:38 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[certamen](<br />[festival] [nvarchar](50) NOT NULL,<br />[certamen] [numeric](4, 0) NOT NULL,<br />[organizador] [nvarchar](50) NULL,<br /> CONSTRAINT [PK_certamen] PRIMARY KEY CLUSTERED <br />(<br />[festival] ASC,<br />[certamen] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />ALTER TABLE [dbo].[certamen] WITH CHECK ADD CONSTRAINT [FK_certamen_festival] FOREIGN KEY([festival])<br />REFERENCES [dbo].[festival] ([festival])<br />GO<br />ALTER TABLE [dbo].[certamen] CHECK CONSTRAINT [FK_certamen_festival]<br />GO<br />TABLA RECONOCIMIENTO<br />USE [cine]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_reconocimiento_festival_premio]') AND parent_object_id = OBJECT_ID(N'[dbo].[reconocimiento]'))<br />ALTER TABLE [dbo].[reconocimiento] DROP CONSTRAINT [FK_reconocimiento_festival_premio]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_reconocimiento_personaje]') AND parent_object_id = OBJECT_ID(N'[dbo].[reconocimiento]'))<br />ALTER TABLE [dbo].[reconocimiento] DROP CONSTRAINT [FK_reconocimiento_personaje]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[reconocimiento] Script Date: 09/24/2011 19:54:43 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[reconocimiento]') AND type in (N'U'))<br />DROP TABLE [dbo].[reconocimiento]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[reconocimiento] Script Date: 09/24/2011 19:54:43 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[reconocimiento](<br />[festival] [nvarchar](50) NOT NULL,<br />[certamen] [numeric](4, 0) NOT NULL,<br />[premio] [nvarchar](50) NOT NULL,<br />[nombre_persona] [nvarchar](50) NOT NULL,<br /> CONSTRAINT [PK_reconocimiento] PRIMARY KEY CLUSTERED <br />(<br />[festival] ASC,<br />[certamen] ASC,<br />[premio] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />ALTER TABLE [dbo].[reconocimiento] WITH CHECK ADD CONSTRAINT [FK_reconocimiento_festival_premio] FOREIGN KEY([premio], [festival])<br />REFERENCES [dbo].[festival_premio] ([festival], [premio])<br />GO<br />ALTER TABLE [dbo].[reconocimiento] CHECK CONSTRAINT [FK_reconocimiento_festival_premio]<br />GO<br />ALTER TABLE [dbo].[reconocimiento] WITH CHECK ADD CONSTRAINT [FK_reconocimiento_personaje] FOREIGN KEY([nombre_persona])<br />REFERENCES [dbo].[personaje] ([nombre_persona])<br />GO<br />ALTER TABLE [dbo].[reconocimiento] CHECK CONSTRAINT [FK_reconocimiento_personaje]<br />GO<br />TABLA PERSONAJE<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[personaje] Script Date: 09/24/2011 19:56:58 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[personaje]') AND type in (N'U'))<br />DROP TABLE [dbo].[personaje]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[personaje] Script Date: 09/24/2011 19:56:58 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[personaje](<br />[nombre_persona] [nvarchar](50) NOT NULL,<br />[nacionalidad_persona] [nvarchar](50) NULL,<br />[sexo_persona] [nchar](10) NULL,<br /> CONSTRAINT [PK_personaje] PRIMARY KEY CLUSTERED <br />(<br />[nombre_persona] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />TABLA PREMIO<br />USE [cine]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_premio_tarea]') AND parent_object_id = OBJECT_ID(N'[dbo].[premio]'))<br />ALTER TABLE [dbo].[premio] DROP CONSTRAINT [FK_premio_tarea]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[premio] Script Date: 09/24/2011 19:57:33 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[premio]') AND type in (N'U'))<br />DROP TABLE [dbo].[premio]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[premio] Script Date: 09/24/2011 19:57:33 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[premio](<br />[premio] [nvarchar](50) NOT NULL,<br />[tarea] [nvarchar](50) NOT NULL,<br /> CONSTRAINT [PK_premio] PRIMARY KEY CLUSTERED <br />(<br />[premio] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />ALTER TABLE [dbo].[premio] WITH CHECK ADD CONSTRAINT [FK_premio_tarea] FOREIGN KEY([tarea])<br />REFERENCES [dbo].[tarea] ([tarea])<br />GO<br />ALTER TABLE [dbo].[premio] CHECK CONSTRAINT [FK_premio_tarea]<br />GO<br />TABLA FESTIVAL_PREMIO<br />USE [cine]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_festival_premio_festival]') AND parent_object_id = OBJECT_ID(N'[dbo].[festival_premio]'))<br />ALTER TABLE [dbo].[festival_premio] DROP CONSTRAINT [FK_festival_premio_festival]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_festival_premio_premio]') AND parent_object_id = OBJECT_ID(N'[dbo].[festival_premio]'))<br />ALTER TABLE [dbo].[festival_premio] DROP CONSTRAINT [FK_festival_premio_premio]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[festival_premio] Script Date: 09/24/2011 19:58:18 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[festival_premio]') AND type in (N'U'))<br />DROP TABLE [dbo].[festival_premio]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[festival_premio] Script Date: 09/24/2011 19:58:18 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[festival_premio](<br />[festival] [nvarchar](50) NOT NULL,<br />[premio] [nvarchar](50) NOT NULL,<br />[galardon] [nvarchar](50) NULL,<br /> CONSTRAINT [PK_festival_premio] PRIMARY KEY CLUSTERED <br />(<br />[festival] ASC,<br />[premio] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />ALTER TABLE [dbo].[festival_premio] WITH CHECK ADD CONSTRAINT [FK_festival_premio_festival] FOREIGN KEY([festival])<br />REFERENCES [dbo].[festival] ([festival])<br />GO<br />ALTER TABLE [dbo].[festival_premio] CHECK CONSTRAINT [FK_festival_premio_festival]<br />GO<br />ALTER TABLE [dbo].[festival_premio] WITH CHECK ADD CONSTRAINT [FK_festival_premio_premio] FOREIGN KEY([premio])<br />REFERENCES [dbo].[premio] ([premio])<br />GO<br />ALTER TABLE [dbo].[festival_premio] CHECK CONSTRAINT [FK_festival_premio_premio]<br />GO<br />TABLA OTORGO<br />USE [cine]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_otorgo_certamen]') AND parent_object_id = OBJECT_ID(N'[dbo].[otorgo]'))<br />ALTER TABLE [dbo].[otorgo] DROP CONSTRAINT [FK_otorgo_certamen]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_otorgo_festival_premio]') AND parent_object_id = OBJECT_ID(N'[dbo].[otorgo]'))<br />ALTER TABLE [dbo].[otorgo] DROP CONSTRAINT [FK_otorgo_festival_premio]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_otorgo_pelicula]') AND parent_object_id = OBJECT_ID(N'[dbo].[otorgo]'))<br />ALTER TABLE [dbo].[otorgo] DROP CONSTRAINT [FK_otorgo_pelicula]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[otorgo] Script Date: 09/24/2011 19:58:52 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[otorgo]') AND type in (N'U'))<br />DROP TABLE [dbo].[otorgo]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[otorgo] Script Date: 09/24/2011 19:58:52 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[otorgo](<br />[festival] [nvarchar](50) NOT NULL,<br />[certamen] [numeric](4, 0) NOT NULL,<br />[premio] [nvarchar](50) NOT NULL,<br />[cip] [nvarchar](50) NOT NULL,<br /> CONSTRAINT [PK_otorgo] PRIMARY KEY CLUSTERED <br />(<br />[festival] ASC,<br />[certamen] ASC,<br />[premio] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />ALTER TABLE [dbo].[otorgo] WITH CHECK ADD CONSTRAINT [FK_otorgo_certamen] FOREIGN KEY([festival], [certamen])<br />REFERENCES [dbo].[certamen] ([festival], [certamen])<br />GO<br />ALTER TABLE [dbo].[otorgo] CHECK CONSTRAINT [FK_otorgo_certamen]<br />GO<br />ALTER TABLE [dbo].[otorgo] WITH CHECK ADD CONSTRAINT [FK_otorgo_festival_premio] FOREIGN KEY([premio], [festival])<br />REFERENCES [dbo].[festival_premio] ([festival], [premio])<br />GO<br />ALTER TABLE [dbo].[otorgo] CHECK CONSTRAINT [FK_otorgo_festival_premio]<br />GO<br />ALTER TABLE [dbo].[otorgo] WITH CHECK ADD CONSTRAINT [FK_otorgo_pelicula] FOREIGN KEY([cip])<br />REFERENCES [dbo].[pelicula] ([cip])<br />GO<br />ALTER TABLE [dbo].[otorgo] CHECK CONSTRAINT [FK_otorgo_pelicula]<br />GO<br />TABLA TRABAJO<br />USE [cine]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_trabajo_pelicula]') AND parent_object_id = OBJECT_ID(N'[dbo].[trabajo]'))<br />ALTER TABLE [dbo].[trabajo] DROP CONSTRAINT [FK_trabajo_pelicula]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_trabajo_personaje]') AND parent_object_id = OBJECT_ID(N'[dbo].[trabajo]'))<br />ALTER TABLE [dbo].[trabajo] DROP CONSTRAINT [FK_trabajo_personaje]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_trabajo_tarea]') AND parent_object_id = OBJECT_ID(N'[dbo].[trabajo]'))<br />ALTER TABLE [dbo].[trabajo] DROP CONSTRAINT [FK_trabajo_tarea]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[trabajo] Script Date: 09/24/2011 19:59:23 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[trabajo]') AND type in (N'U'))<br />DROP TABLE [dbo].[trabajo]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[trabajo] Script Date: 09/24/2011 19:59:24 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[trabajo](<br />[cip] [nvarchar](50) NOT NULL,<br />[nombre_persona] [nvarchar](50) NOT NULL,<br />[tarea] [nvarchar](50) NOT NULL,<br /> CONSTRAINT [PK_trabajo] PRIMARY KEY CLUSTERED <br />(<br />[cip] ASC,<br />[nombre_persona] ASC,<br />[tarea] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />ALTER TABLE [dbo].[trabajo] WITH CHECK ADD CONSTRAINT [FK_trabajo_pelicula] FOREIGN KEY([cip])<br />REFERENCES [dbo].[pelicula] ([cip])<br />GO<br />ALTER TABLE [dbo].[trabajo] CHECK CONSTRAINT [FK_trabajo_pelicula]<br />GO<br />ALTER TABLE [dbo].[trabajo] WITH CHECK ADD CONSTRAINT [FK_trabajo_personaje] FOREIGN KEY([nombre_persona])<br />REFERENCES [dbo].[personaje] ([nombre_persona])<br />GO<br />ALTER TABLE [dbo].[trabajo] CHECK CONSTRAINT [FK_trabajo_personaje]<br />GO<br />ALTER TABLE [dbo].[trabajo] WITH CHECK ADD CONSTRAINT [FK_trabajo_tarea] FOREIGN KEY([tarea])<br />REFERENCES [dbo].[tarea] ([tarea])<br />GO<br />ALTER TABLE [dbo].[trabajo] CHECK CONSTRAINT [FK_trabajo_tarea]<br />GO<br />TABLA CINE<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[cine] Script Date: 09/24/2011 19:59:55 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[cine]') AND type in (N'U'))<br />DROP TABLE [dbo].[cine]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[cine] Script Date: 09/24/2011 19:59:56 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[cine](<br />[cine] [nvarchar](50) NOT NULL,<br />[ciudad_cine] [nvarchar](50) NULL,<br />[direccion_cine] [nvarchar](50) NULL,<br /> CONSTRAINT [PK_cine] PRIMARY KEY CLUSTERED <br />(<br />[cine] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />TABLA PROYECCION<br />USE [cine]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_proyeccion_pelicula]') AND parent_object_id = OBJECT_ID(N'[dbo].[proyeccion]'))<br />ALTER TABLE [dbo].[proyeccion] DROP CONSTRAINT [FK_proyeccion_pelicula]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_proyeccion_sala]') AND parent_object_id = OBJECT_ID(N'[dbo].[proyeccion]'))<br />ALTER TABLE [dbo].[proyeccion] DROP CONSTRAINT [FK_proyeccion_sala]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[proyeccion] Script Date: 09/24/2011 20:00:30 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[proyeccion]') AND type in (N'U'))<br />DROP TABLE [dbo].[proyeccion]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[proyeccion] Script Date: 09/24/2011 20:00:31 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[proyeccion](<br />[cine] [nvarchar](50) NOT NULL,<br />[sala] [numeric](2, 0) NOT NULL,<br />[cip] [nvarchar](50) NOT NULL,<br />[fecha_estreno] [date] NOT NULL,<br />[dia_estreno] [numeric](3, 0) NULL,<br />[espectadores] [numeric](6, 0) NULL,<br />[recaudacion] [numeric](8, 0) NULL,<br /> CONSTRAINT [PK_proyeccion] PRIMARY KEY CLUSTERED <br />(<br />[cine] ASC,<br />[sala] ASC,<br />[cip] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />ALTER TABLE [dbo].[proyeccion] WITH CHECK ADD CONSTRAINT [FK_proyeccion_pelicula] FOREIGN KEY([cip])<br />REFERENCES [dbo].[pelicula] ([cip])<br />GO<br />ALTER TABLE [dbo].[proyeccion] CHECK CONSTRAINT [FK_proyeccion_pelicula]<br />GO<br />ALTER TABLE [dbo].[proyeccion] WITH CHECK ADD CONSTRAINT [FK_proyeccion_sala] FOREIGN KEY([cine], [sala])<br />REFERENCES [dbo].[sala] ([cine], [sala])<br />GO<br />ALTER TABLE [dbo].[proyeccion] CHECK CONSTRAINT [FK_proyeccion_sala]<br />GO<br />TABLA PELICULA<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[pelicula] Script Date: 09/24/2011 20:01:04 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[pelicula]') AND type in (N'U'))<br />DROP TABLE [dbo].[pelicula]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[pelicula] Script Date: 09/24/2011 20:01:04 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[pelicula](<br />[cip] [nvarchar](50) NOT NULL,<br />[titulo_p] [nvarchar](50) NOT NULL,<br />[ano_produccion] [numeric](4, 0) NOT NULL,<br />[titulo_s] [nvarchar](50) NULL,<br />[nacionalidad] [nvarchar](50) NULL,<br />[presupuesto] [numeric](11, 0) NULL,<br />[duracion] [numeric](3, 0) NULL,<br /> CONSTRAINT [PK_pelicula] PRIMARY KEY CLUSTERED <br />(<br />[cip] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />TABLA TAREA<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[tarea] Script Date: 09/24/2011 20:01:52 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tarea]') AND type in (N'U'))<br />DROP TABLE [dbo].[tarea]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[tarea] Script Date: 09/24/2011 20:01:53 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[tarea](<br />[tarea] [nvarchar](50) NOT NULL,<br />[sexo_tarea] [nchar](1) NULL,<br /> CONSTRAINT [PK_tarea] PRIMARY KEY CLUSTERED <br />(<br />[tarea] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />TABLA SALA<br />USE [cine]<br />GO<br />IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_sala_cine]') AND parent_object_id = OBJECT_ID(N'[dbo].[sala]'))<br />ALTER TABLE [dbo].[sala] DROP CONSTRAINT [FK_sala_cine]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[sala] Script Date: 09/24/2011 20:02:23 ******/<br />IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sala]') AND type in (N'U'))<br />DROP TABLE [dbo].[sala]<br />GO<br />USE [cine]<br />GO<br />/****** Object: Table [dbo].[sala] Script Date: 09/24/2011 20:02:23 ******/<br />SET ANSI_NULLS ON<br />GO<br />SET QUOTED_IDENTIFIER ON<br />GO<br />CREATE TABLE [dbo].[sala](<br />[cine] [nvarchar](50) NOT NULL,<br />[sala] [numeric](2, 0) NOT NULL,<br />[aforo] [numeric](4, 0) NULL,<br /> CONSTRAINT [PK_sala] PRIMARY KEY CLUSTERED <br />(<br />[cine] ASC,<br />[sala] ASC<br />)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]<br />) ON [PRIMARY]<br />GO<br />ALTER TABLE [dbo].[sala] WITH CHECK ADD CONSTRAINT [FK_sala_cine] FOREIGN KEY([cine])<br />REFERENCES [dbo].[cine] ([cine])<br />GO<br />ALTER TABLE [dbo].[sala] CHECK CONSTRAINT [FK_sala_cine]<br />GO<br />

×