USE [master]
GO
/****** Object: Database [workshops] Script Date: 6/2/2018 3:59:50 PM ******/
CREATE DATABASE [workshops]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'workshops', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\workshops.mdf' , SIZE = 3136KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'workshops_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\workshops_log.ldf' , SIZE = 784KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [workshops] SET COMPATIBILITY_LEVEL = 110
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [workshops].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [workshops] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [workshops] SET ANSI_NULLS OFF
GO
ALTER DATABASE [workshops] SET ANSI_PADDING OFF
GO
ALTER DATABASE [workshops] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [workshops] SET ARITHABORT OFF
GO
ALTER DATABASE [workshops] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [workshops] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [workshops] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [workshops] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [workshops] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [workshops] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [workshops] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [workshops] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [workshops] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [workshops] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [workshops] SET ENABLE_BROKER
GO
ALTER DATABASE [workshops] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [workshops] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [workshops] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [workshops] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [workshops] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [workshops] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [workshops] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [workshops] SET RECOVERY FULL
GO
ALTER DATABASE [workshops] SET MULTI_USER
GO
ALTER DATABASE [workshops] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [workshops] SET DB_CHAINING OFF
GO
ALTER DATABASE [workshops] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
GO
ALTER DATABASE [workshops] SET TARGET_RECOVERY_TIME = 0 SECONDS
GO
USE [workshops]
GO
/****** Object: StoredProcedure [dbo].[sp_insert_instructor] Script Date: 6/2/2018 3:59:50 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create proc [dbo].[sp_insert_instructor]
(
@i_name nvarchar(20) ,
@i_designation nvarchar(20) ,
@i_image nvarchar(max)
)
as
begin
insert into tbl_instructor
values(@i_name ,
@i_designation ,
@i_image
)
end
GO
/****** Object: Table [dbo].[Employee] Script Date: 6/2/2018 3:59:50 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Employee](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](20) NULL,
[Salary] [float] NULL,
[Department] [varchar](20) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[tbl_batch] Script Date: 6/2/2018 3:59:50 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_batch](
[b_id] [int] IDENTITY(1,1) NOT NULL,
[b_name] [nvarchar](20) NOT NULL,
PRIMARY KEY CLUSTERED
(
[b_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
[b_name] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tbl_feedbackform] Script Date: 6/2/2018 3:59:50 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_feedbackform](
[f_id] [int] IDENTITY(1,1) NOT NULL,
[f_comment] [nvarchar](max) NOT NULL,
[f_marks] [int] NULL,
[f_wr_id_fk] [int] NULL,
[wr_id_fk_s] [int] NULL,
PRIMARY KEY CLUSTERED
(
[f_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[tbl_instructor] Script Date: 6/2/2018 3:59:50 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_instructor](
[i_id] [int] IDENTITY(1,1) NOT NULL,
[i_name] [nvarchar](20) NOT NULL,
[i_designation] [nvarchar](20) NOT NULL,
[i_image] [nvarchar](max) NOT NULL,
PRIMARY KEY CLUSTERED
(
[i_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[tbl_student] Script Date: 6/2/2018 3:59:50 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_student](
[s_id] [int] IDENTITY(1,1) NOT NULL,
[s_name] [nvarchar](20) NOT NULL,
[s_enrollment] [nvarchar](20) NOT NULL,
[s_image] [nvarchar](max) NOT NULL,
[s_batchcode] [int] NULL,
PRIMARY KEY CLUSTERED
(
[s_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
[s_enrollment] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[tbl_workshopname] Script Date: 6/2/2018 3:59:50 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_workshopname](
[w_id] [int] IDENTITY(1,1) NOT NULL,
[w_name] [nvarchar](20) NOT NULL,
PRIMARY KEY CLUSTERED
(
[w_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
[w_name] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tbl_workshoprecord] Script Date: 6/2/2018 3:59:50 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_workshoprecord](
[wr_id] [int] IDENTITY(1,1) NOT NULL,
[wr_date] [date] NULL,
[wr_id_fk_w] [int] NULL,
[wr_id_fk_i] [int] NULL,
PRIMARY KEY CLUSTERED
(
[wr_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tbl_workshoprecordforstudent] Script Date: 6/2/2018 3:59:50 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_workshoprecordforstudent](
[wr_id] [int] IDENTITY(1,1) NOT NULL,
[wr_date] [date] NULL,
[wr_id_fk_w] [int] NULL,
[wr_id_fk_s] [int] NULL,
PRIMARY KEY CLUSTERED
(
[wr_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tbl_feedbackform] ADD DEFAULT ((0)) FOR [f_marks]
GO
ALTER TABLE [dbo].[tbl_feedbackform] WITH CHECK ADD FOREIGN KEY([f_wr_id_fk])
REFERENCES [dbo].[tbl_workshoprecord] ([wr_id])
GO
ALTER TABLE [dbo].[tbl_feedbackform] WITH CHECK ADD FOREIGN KEY([wr_id_fk_s])
REFERENCES [dbo].[tbl_student] ([s_id])
GO
ALTER TABLE [dbo].[tbl_student] WITH CHECK ADD FOREIGN KEY([s_batchcode])
REFERENCES [dbo].[tbl_batch] ([b_id])
GO
ALTER TABLE [dbo].[tbl_workshoprecord] WITH CHECK ADD FOREIGN KEY([wr_id_fk_w])
REFERENCES [dbo].[tbl_workshopname] ([w_id])
GO
ALTER TABLE [dbo].[tbl_workshoprecord] WITH CHECK ADD FOREIGN KEY([wr_id_fk_i])
REFERENCES [dbo].[tbl_instructor] ([i_id])
GO
ALTER TABLE [dbo].[tbl_workshoprecordforstudent] WITH CHECK ADD FOREIGN KEY([wr_id_fk_w])
REFERENCES [dbo].[tbl_workshoprecord] ([wr_id])
GO
ALTER TABLE [dbo].[tbl_workshoprecordforstudent] WITH CHECK ADD FOREIGN KEY([wr_id_fk_s])
REFERENCES [dbo].[tbl_student] ([s_id])
GO
USE [master]
GO
ALTER DATABASE [workshops] SET READ_WRITE
GO
No comments:
Post a Comment