SlideShare a Scribd company logo
1 of 37
Page 1 of 27
Tony LoCoco
ITCO333 – Unit 2
August 29, 2013
REQUIREM ENT S
• This database must contain examples of one
• I will compare your Unit 1 ERD with the Unit 2 database
diagram. If there are differences, explain why.
• Present your SQL statements in the order in which they were
executed.
• Put your database diagram at the top of your document (see
my sample).
Each of your t
sample data (p
REL AT IONS HIP S
Relationship
Type
Entity #1 Entity #2
one-to-one (1:1) Advisors Employees
one-to-many (1:M) Employees Departments
one-to-many (1:M) Advisors Students
This database must contain examples of one-to-one, one-to-
many and many-to-many relationships.
I will compare your Unit 1 ERD with the Unit 2 database
diagram. If there are differences, explain why.
Present your SQL statements in the order in which they were
executed.
Put your database diagram at the top of your document (see my
sample).
tables must contain at least eight records of
per the assignment requirements).
Entity #2 Description / Justification
Employees An Advisor is an Employee with additional data
attributes. An Employee may or may not be an Advisor.
Departments A Department may have 0, 1 or many Employees
Employee is assigned to just one Department.
An Advisor may be assigned to 0, 1 or many Students and
a Student is assigned to just one Advisor.
many relationships.
I will compare your Unit 1 ERD with the Unit 2 database
diagram. If there are differences, explain why.
An Advisor is an Employee with additional data
attributes. An Employee may or may not be an Advisor.
many Employees and an
An Advisor may be assigned to 0, 1 or many Students and
Page 2 of 27
many-to-many
(M:N)
Students Courses A Student be take 0 , 1 or many Courses and a
Course can
contain 0, 1 or many Students.
Relational Databases can not support many-to-many
relationships. These M:N must be broken down into two
one-to-many relationships with a bridge entity
connecting the M:N entities. In this case, Student_Courses
is that bridge entity.
Page 3 of 27
D AT ABASE D IAGR AM
Page 4 of 27
UNIT 1 ERD
Emloyees
PK Employee_ID
Last_Name
First_Name
Birth_Date
Employment_Start_Date
Hourly_Pay
FK1 Department_ID
Manager_ID
Departments
PK Department_ID
Department_Name
Students
PK Student_ID
Last_Name
First_Name
Birth_Date
Enroll_Date
Status_Code
Total_Hours
FK1,FK2 Advisor_ID
Advisors
PK,FK1 Employee_ID
Certification_Level
Courses
PK Course_ID
Course_Code
Course_Name
Credit_Hours
Sessions
PK Session_ID
Session_Name
Session_Start_Date
Student_Courses
PK,FK1 Session_ID
PK,FK3 Course_ID
PK,FK2 Student_ID
Earned_Grade
Page 5 of 27
SQL D D L T O CREAT E D AT ABASE
USE [master]
GO
CREATE DATABASE ITCO333Database
GO
Page 6 of 27
CREAT E T ABL ES, F IEL D S , P RIM ARY K EY S &
FOREIGN K EY / CREAT E D M L
USE [ITCO333Database]
GO
CREATE TABLE [dbo].[Departments](
[Department_ID] [int] NOT NULL PRIMARY KEY,
[Department_Name] [nvarchar](50) NULL
)
GO
USE [ITCO333Database]
GO
INSERT [dbo].[Departments] ([Department_ID],
[Department_Name])
VALUES (1, N'Academics'),
(2, N'Finance'),
(3, N'Student Advisors'),
(4, N'Marketing'),
(5, N'Recruitment'),
(6, N'Office of Provost'),
(7, N'Information Technology')
Page 7 of 27
GO
Page 8 of 27
USE [ITCO333Database]
GO
CREATE TABLE [dbo].[Sessions]
(
[Session_ID] [int] NOT NULL PRIMARY KEY,
[Session_Name] [nvarchar](50) NULL,
[Session_Start_Date] [date] NULL
)
GO
USE [ITCO333Database]
GO
INSERT [dbo].[Sessions] ([Session_ID], [Session_Name],
[Session_Start_Date])
VALUES (10, N'1201-A', '2012-01-12'),
(11, N'1201-B', '2012-02-15'),
(12, N'1202-A', '2012-04-01'),
(13, N'1202-B', '2012-05-15'),
(14, N'1203-A', '2012-07-01'),
(15, N'1203-B', '2012-08-15'),
(16, N'1204-A', '2012-10-01'),
(17, N'1204-B', '2012-11-15')
GO
Page 9 of 27
Page 10 of 27
USE [ITCO333Database]
GO
CREATE TABLE [dbo].[Courses]
(
[Course_ID] [int] NOT NULL PRIMARY KEY,
[Course_Code] [nvarchar](50) NULL,
[Course_Name] [nvarchar](50) NULL,
[Credit_Hours] [int] NULL
)
GO
USE [ITCO333Database]
GO
INSERT [dbo].[Courses] ([Course_ID], [Course_Code],
[Course_Name], [Credit_Hours])
VALUES (1, N'ITD200', N'Database I', 4),
(2, N'ITD300', N'Database II', 4),
(3, N'ITD400', N'Advanced Databases', 4),
(4, N'ITN200', N'Networking I', 4),
(5, N'ITN300', N'Networking II', 4),
(6, N'ITN400', N'Advanced Networking', 4),
(7, N'ITP200', N'Intro to Programming', 4),
(8, N'ITP300', N'Programming II', 4),
(9, N'ITP400', N'Advanced Programming', 4)
GO
Page 11 of 27
Page 12 of 27
USE [ITCO333Database]
GO
CREATE TABLE [dbo].[Employees](
[Employee_ID] [int] NOT NULL PRIMARY KEY,
[Last_Name] [nvarchar](50) NULL,
[First_Name] [nvarchar](50) NULL,
[Birth_Date] [date] NULL,
[Employment_Start_Date] [date] NULL,
[Hourly_Pay] [decimal](18, 2) NULL,
[Department_ID] [int] NOT NULL REFERENCES Departments
(Department_ID),
[Manager_ID] [int] NOT NULL
)
GO
USE [ITCO333Database]
GO
INSERT [dbo].[Employees] ([Employee_ID], [Last_Name],
[First_Name], [Birth_Date],
[Employment_Start_Date], [Hourly_Pay], [Department_ID],
[Manager_ID])
VALUES
(1000, N'Smith', N'Chris', '1980-09-14', '2001-01-02', 30.50, 2,
1000),
(1121, N'Townsend', N'Robert', '1976-02-03', '2001-03-02',
24.30, 1, 1121),
(1223, N'Cogdon', N'Luis', '1974-04-05', '2001-04-21', 24.30 , 2,
1000),
(1344, N'Lancette', N'Joseph', '1980-03-05', '2002-04-10', 23.34,
3, 1344),
(1366, N'Lark', N'James', '1985-06-06', '2005-05-19', 23.55, 2,
1000),
(1565, N'Whitely', N'Jeremy', '1973-10-23', '2011-02-05', 23.45,
3, 1344),
(1808, N'Fix', N'Julie', '1968-02-04', '2003-12-01',30.04 , 1,
1121)
GO
Page 13 of 27
Page 14 of 27
USE [ITCO333Database]
GO
CREATE TABLE [dbo].[Advisors](
[Employee_ID] [int] NOT NULL PRIMARY KEY
REFERENCES Employees (Employee_ID),
[Certification_Level] [nvarchar](50) NULL
)
GO
USE [ITCO333Database]
GO
INSERT [Advisors] ([Employee_ID], [Certification_Level])
VALUES
(1344, N'100'),
(1565, N'80')
GO
Page 15 of 27
Page 16 of 27
USE [ITCO333Database]
GO
CREATE TABLE [dbo].[Students]
(
[Student_ID] [int] NOT NULL PRIMARY KEY,
[Last_Name] [nvarchar](50) NULL,
[First_Name] [nvarchar](50) NULL,
[Birth_Date] [date] NULL,
[Enroll_Date] [date] NULL,
[Status_Code] [int] NULL,
[Total_Hours] [int] NULL,
[Advisor_ID] [int] NULL REFERENCES Advisors
(Employee_ID)
)
GO
USE [ITCO333Database]
GO
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES
(11232, 'Bowser','Timothy','1980-02-03','2011-01-
02',1,20,1565),
(12100, 'Chavez','Kelly','1976-12-10','2011-04-01',2,22,1565),
(13310, 'Clark','Ethan','1982-10-13','2011-06-15',1,24,1344),
(14641, 'Colon','Alexander','1980-01-14','2011-08-
01',1,20,1565),
(16105, 'Cutts','Cardright','1970-05-16','2011-06-15',2,22,1565),
Page 17 of 27
(17715, 'Fair','Jermaine','1982-05-17','2011-04-01',2,24,1344),
(19487, 'Garrett','Michael','1975-04-19','2011-08-
01',2,20,1565),
(21435, 'Hintz','Valarie','1980-05-03','2011-01-02',1,22,1344),
(23579, 'Mcclain','Clint','1979-05-03','2011-04-01',1,24,1565),
(25937, 'McFarlane','Brenda','1976-07-25','2011-06-
15',1,16,1344),
(28576, 'Mohr','Bryan','1980-06-26','2011-08-01',1,28,1565),
(31384, 'Rettino','Steven','1969-11-15','2011-01-02',3,20,1344),
(34522, 'Sanchez','Thomas','1980-02-17','2011-04-
01',1,22,1344),
(37974, 'Sudbury','Dale','1967-09-04','2011-08-01',3,24,1565),
(41772, 'Tribbitt','Patrick','1981-04-17','2011-01-02',2,32,1344)
GO
Page 18 of 27
Page 19 of 27
CREATE TABLE [dbo].[Student_Courses](
[Session_ID] [int] NOT NULL REFERENCES Sessions
(Session_ID),
[Course_ID] [int] NOT NULL REFERENCES Courses
(Course_ID),
[Student_ID] [int] NOT NULL REFERENCES Students
(Student_ID),
[Earned_Grade] [nvarchar](50) NULL,
PRIMARY KEY ([Session_ID],[Course_ID],[Student_ID])
)
GO
USE [ITCO333Database]
GO
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES
(10, 1, 11232, N'F'),
(10, 1, 12100, N'A'),
(10, 1, 13310, N'B'),
(10, 1, 14641, N'B'),
(10, 1, 16105, N'C'),
(11, 1, 11232, N'A'),
(11, 2, 12100, N'B'),
(11, 2, 13310, N'B'),
(11, 2, 14641, N'A'),
(11, 2, 16105, N'C'),
(12, 2, 11232, N'A'),
(12, 6, 12100, N'B'),
(12, 6, 13310, N'B'),
(12, 6, 14641, N'B'),
(12, 6, 16105, N'A')
Page 20 of 27
GO
Page 21 of 27
FUL L SQL
Perform TASKS > GENERATE SCRIPTS. Copy and paste the
full database script here.
Refer to the “Generate Scripts for Entire Database.pdf” in the
Instructor Files area.
USE [master]
GO
/****** Object: Database [ITCO333Database] Script Date:
08/29/2013 19:08:35 ******/
CREATE DATABASE [ITCO333Database] ON PRIMARY
( NAME = N'ITCO333Database', FILENAME = N'c:Program
Files (x86)Microsoft SQL
ServerMSSQL10_50.SQLEXPRESSMSSQLDATAITCO333D
atabase.mdf' , SIZE = 2304KB , MAXSIZE =
UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'ITCO333Database_log', FILENAME =
N'c:Program Files (x86)Microsoft SQL
ServerMSSQL10_50.SQLEXPRESSMSSQLDATAITCO333D
atabase_log.LDF' , SIZE = 576KB , MAXSIZE
= 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [ITCO333Database] SET
COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [ITCO333Database].[dbo].[sp_fulltext_database]
@action = 'enable'
end
GO
ALTER DATABASE [ITCO333Database] SET
ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [ITCO333Database] SET ANSI_NULLS
OFF
GO
ALTER DATABASE [ITCO333Database] SET
ANSI_PADDING OFF
GO
ALTER DATABASE [ITCO333Database] SET
ANSI_WARNINGS OFF
GO
ALTER DATABASE [ITCO333Database] SET ARITHABORT
OFF
GO
ALTER DATABASE [ITCO333Database] SET AUTO_CLOSE
ON
GO
ALTER DATABASE [ITCO333Database] SET
AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [ITCO333Database] SET AUTO_SHRINK
OFF
GO
ALTER DATABASE [ITCO333Database] SET
AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [ITCO333Database] SET
CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [ITCO333Database] SET
CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [ITCO333Database] SET
CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [ITCO333Database] SET
NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [ITCO333Database] SET
QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [ITCO333Database] SET
RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [ITCO333Database] SET
ENABLE_BROKER
Page 22 of 27
GO
ALTER DATABASE [ITCO333Database] SET
AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [ITCO333Database] SET
DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [ITCO333Database] SET
TRUSTWORTHY OFF
GO
ALTER DATABASE [ITCO333Database] SET
ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [ITCO333Database] SET
PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [ITCO333Database] SET
READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [ITCO333Database] SET
HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [ITCO333Database] SET READ_WRITE
GO
ALTER DATABASE [ITCO333Database] SET RECOVERY
SIMPLE
GO
ALTER DATABASE [ITCO333Database] SET MULTI_USER
GO
ALTER DATABASE [ITCO333Database] SET PAGE_VERIFY
CHECKSUM
GO
ALTER DATABASE [ITCO333Database] SET DB_CHAINING
OFF
GO
USE [ITCO333Database]
GO
/****** Object: Table [dbo].[Departments] Script Date:
08/29/2013 19:08:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Departments](
[Department_ID] [int] NOT NULL,
[Department_Name] [nvarchar](50) NULL,
PRIMARY KEY CLUSTERED
(
[Department_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
INSERT [dbo].[Departments] ([Department_ID],
[Department_Name]) VALUES (1, N'Academics')
INSERT [dbo].[Departments] ([Department_ID],
[Department_Name]) VALUES (2, N'Finance')
INSERT [dbo].[Departments] ([Department_ID],
[Department_Name]) VALUES (3, N'Student
Advisors')
INSERT [dbo].[Departments] ([Department_ID],
[Department_Name]) VALUES (4, N'Marketing')
INSERT [dbo].[Departments] ([Department_ID],
[Department_Name]) VALUES (5,
N'Recruitment')
INSERT [dbo].[Departments] ([Department_ID],
[Department_Name]) VALUES (6, N'Office of
Provost')
INSERT [dbo].[Departments] ([Department_ID],
[Department_Name]) VALUES (7, N'Information
Technology')
/****** Object: Table [dbo].[Courses] Script Date:
08/29/2013 19:08:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Courses](
Page 23 of 27
[Course_ID] [int] NOT NULL,
[Course_Code] [nvarchar](50) NULL,
[Course_Name] [nvarchar](50) NULL,
[Credit_Hours] [int] NULL,
PRIMARY KEY CLUSTERED
(
[Course_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
INSERT [dbo].[Courses] ([Course_ID], [Course_Code],
[Course_Name], [Credit_Hours]) VALUES
(1, N'ITD200', N'Database I', 4)
INSERT [dbo].[Courses] ([Course_ID], [Course_Code],
[Course_Name], [Credit_Hours]) VALUES
(2, N'ITD300', N'Database II', 4)
INSERT [dbo].[Courses] ([Course_ID], [Course_Code],
[Course_Name], [Credit_Hours]) VALUES
(3, N'ITD400', N'Advanced Databases', 4)
INSERT [dbo].[Courses] ([Course_ID], [Course_Code],
[Course_Name], [Credit_Hours]) VALUES
(4, N'ITN200', N'Networking I', 4)
INSERT [dbo].[Courses] ([Course_ID], [Course_Code],
[Course_Name], [Credit_Hours]) VALUES
(5, N'ITN300', N'Networking II', 4)
INSERT [dbo].[Courses] ([Course_ID], [Course_Code],
[Course_Name], [Credit_Hours]) VALUES
(6, N'ITN400', N'Advanced Networking', 4)
INSERT [dbo].[Courses] ([Course_ID], [Course_Code],
[Course_Name], [Credit_Hours]) VALUES
(7, N'ITP200', N'Intro to Programming', 4)
INSERT [dbo].[Courses] ([Course_ID], [Course_Code],
[Course_Name], [Credit_Hours]) VALUES
(8, N'ITP300', N'Programming II', 4)
INSERT [dbo].[Courses] ([Course_ID], [Course_Code],
[Course_Name], [Credit_Hours]) VALUES
(9, N'ITP400', N'Advanced Programming', 4)
/****** Object: Table [dbo].[Sessions] Script Date:
08/29/2013 19:08:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Sessions](
[Session_ID] [int] NOT NULL,
[Session_Name] [nvarchar](50) NULL,
[Session_Start_Date] [date] NULL,
PRIMARY KEY CLUSTERED
(
[Session_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
INSERT [dbo].[Sessions] ([Session_ID], [Session_Name],
[Session_Start_Date]) VALUES (10,
N'1201-A', CAST(0x31350B00 AS Date))
INSERT [dbo].[Sessions] ([Session_ID], [Session_Name],
[Session_Start_Date]) VALUES (11,
N'1201-B', CAST(0x53350B00 AS Date))
INSERT [dbo].[Sessions] ([Session_ID], [Session_Name],
[Session_Start_Date]) VALUES (12,
N'1202-A', CAST(0x81350B00 AS Date))
INSERT [dbo].[Sessions] ([Session_ID], [Session_Name],
[Session_Start_Date]) VALUES (13,
N'1202-B', CAST(0xAD350B00 AS Date))
INSERT [dbo].[Sessions] ([Session_ID], [Session_Name],
[Session_Start_Date]) VALUES (14,
N'1203-A', CAST(0xDC350B00 AS Date))
INSERT [dbo].[Sessions] ([Session_ID], [Session_Name],
[Session_Start_Date]) VALUES (15,
N'1203-B', CAST(0x09360B00 AS Date))
INSERT [dbo].[Sessions] ([Session_ID], [Session_Name],
[Session_Start_Date]) VALUES (16,
N'1204-A', CAST(0x38360B00 AS Date))
Page 24 of 27
INSERT [dbo].[Sessions] ([Session_ID], [Session_Name],
[Session_Start_Date]) VALUES (17,
N'1204-B', CAST(0x65360B00 AS Date))
/****** Object: Table [dbo].[Employees] Script Date:
08/29/2013 19:08:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Employees](
[Employee_ID] [int] NOT NULL,
[Last_Name] [nvarchar](50) NULL,
[First_Name] [nvarchar](50) NULL,
[Birth_Date] [date] NULL,
[Employment_Start_Date] [date] NULL,
[Hourly_Pay] [decimal](18, 2) NULL,
[Department_ID] [int] NOT NULL,
[Manager_ID] [int] NOT NULL,
PRIMARY KEY CLUSTERED
(
[Employee_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
INSERT [dbo].[Employees] ([Employee_ID], [Last_Name],
[First_Name], [Birth_Date],
[Employment_Start_Date], [Hourly_Pay], [Department_ID],
[Manager_ID]) VALUES (1000,
N'Smith', N'Chris', CAST(0x7F080B00 AS Date),
CAST(0x76250B00 AS Date), CAST(30.50 AS
Decimal(18, 2)), 2, 1000)
INSERT [dbo].[Employees] ([Employee_ID], [Last_Name],
[First_Name], [Birth_Date],
[Employment_Start_Date], [Hourly_Pay], [Department_ID],
[Manager_ID]) VALUES (1121,
N'Townsend', N'Robert', CAST(0xEA010B00 AS Date),
CAST(0xB1250B00 AS Date), CAST(24.30 AS
Decimal(18, 2)), 1, 1121)
INSERT [dbo].[Employees] ([Employee_ID], [Last_Name],
[First_Name], [Birth_Date],
[Employment_Start_Date], [Hourly_Pay], [Department_ID],
[Manager_ID]) VALUES (1223,
N'Cogdon', N'Luis', CAST(0x4DFF0A00 AS Date),
CAST(0xE3250B00 AS Date), CAST(24.30 AS
Decimal(18, 2)), 2, 1000)
INSERT [dbo].[Employees] ([Employee_ID], [Last_Name],
[First_Name], [Birth_Date],
[Employment_Start_Date], [Hourly_Pay], [Department_ID],
[Manager_ID]) VALUES (1344,
N'Lancette', N'Joseph', CAST(0xBE070B00 AS Date),
CAST(0x45270B00 AS Date), CAST(23.34 AS
Decimal(18, 2)), 3, 1344)
INSERT [dbo].[Employees] ([Employee_ID], [Last_Name],
[First_Name], [Birth_Date],
[Employment_Start_Date], [Hourly_Pay], [Department_ID],
[Manager_ID]) VALUES (1366,
N'Lark', N'James', CAST(0x3D0F0B00 AS Date),
CAST(0xB42B0B00 AS Date), CAST(23.55 AS
Decimal(18, 2)), 2, 1000)
INSERT [dbo].[Employees] ([Employee_ID], [Last_Name],
[First_Name], [Birth_Date],
[Employment_Start_Date], [Hourly_Pay], [Department_ID],
[Manager_ID]) VALUES (1565,
N'Whitely', N'Jeremy', CAST(0xA9FE0A00 AS Date),
CAST(0xDC330B00 AS Date), CAST(23.45 AS
Decimal(18, 2)), 3, 1344)
INSERT [dbo].[Employees] ([Employee_ID], [Last_Name],
[First_Name], [Birth_Date],
[Employment_Start_Date], [Hourly_Pay], [Department_ID],
[Manager_ID]) VALUES (1808,
N'Fix', N'Julie', CAST(0x81F60A00 AS Date),
CAST(0x9D290B00 AS Date), CAST(30.04 AS
Decimal(18, 2)), 1, 1121)
/****** Object: Table [dbo].[Advisors] Script Date:
08/29/2013 19:08:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Advisors](
[Employee_ID] [int] NOT NULL,
[Certification_Level] [nvarchar](50) NULL,
Page 25 of 27
PRIMARY KEY CLUSTERED
(
[Employee_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
INSERT [dbo].[Advisors] ([Employee_ID],
[Certification_Level]) VALUES (1344, N'100')
INSERT [dbo].[Advisors] ([Employee_ID],
[Certification_Level]) VALUES (1565, N'80')
/****** Object: Table [dbo].[Students] Script Date:
08/29/2013 19:08:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Students](
[Student_ID] [int] NOT NULL,
[Last_Name] [nvarchar](50) NULL,
[First_Name] [nvarchar](50) NULL,
[Birth_Date] [date] NULL,
[Enroll_Date] [date] NULL,
[Status_Code] [int] NULL,
[Total_Hours] [int] NULL,
[Advisor_ID] [int] NULL,
PRIMARY KEY CLUSTERED
(
[Student_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
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (11232, N'Bowser',
N'Timothy', CAST(0x9F070B00 AS Date), CAST(0xBA330B00
AS Date), 1, 20, 1565)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (12100, N'Chavez',
N'Kelly', CAST(0x21030B00 AS Date), CAST(0x13340B00 AS
Date), 2, 22, 1565)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (13310, N'Clark',
N'Ethan', CAST(0x760B0B00 AS Date), CAST(0x5E340B00 AS
Date), 1, 24, 1344)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (14641, N'Colon',
N'Alexander', CAST(0x8B070B00 AS Date),
CAST(0x8D340B00 AS Date), 1, 20, 1565)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (16105, N'Cutts',
N'Cardright', CAST(0xC1F90A00 AS Date), CAST(0x5E340B00
AS Date), 2, 22, 1565)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (17715, N'Fair',
N'Jermaine', CAST(0xE10A0B00 AS Date), CAST(0x13340B00
AS Date), 2, 24, 1344)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (19487, N'Garrett',
N'Michael', CAST(0xC8000B00 AS Date), CAST(0x8D340B00
AS Date), 2, 20, 1565)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (21435, N'Hintz',
N'Valarie', CAST(0xF9070B00 AS Date), CAST(0xBA330B00
AS Date), 1, 22, 1344)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (23579, N'Mcclain',
N'Clint', CAST(0x8B060B00 AS Date), CAST(0x13340B00 AS
Date), 1, 24, 1565)
Page 26 of 27
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (25937, N'McFarlane',
N'Brenda', CAST(0x97020B00 AS Date), CAST(0x5E340B00
AS Date), 1, 16, 1344)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (28576, N'Mohr',
N'Bryan', CAST(0x2F080B00 AS Date), CAST(0x8D340B00 AS
Date), 1, 28, 1565)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (31384, N'Rettino',
N'Steven', CAST(0x0BF90A00 AS Date), CAST(0xBA330B00
AS Date), 3, 20, 1344)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (34522, N'Sanchez',
N'Thomas', CAST(0xAD070B00 AS Date), CAST(0x13340B00
AS Date), 1, 22, 1344)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (37974, N'Sudbury',
N'Dale', CAST(0xE8F50A00 AS Date), CAST(0x8D340B00 AS
Date), 3, 24, 1565)
INSERT [dbo].[Students] ([Student_ID], [Last_Name],
[First_Name], [Birth_Date],
[Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
VALUES (41772, N'Tribbitt',
N'Patrick', CAST(0x56090B00 AS Date), CAST(0xBA330B00
AS Date), 2, 32, 1344)
/****** Object: Table [dbo].[Student_Courses] Script Date:
08/29/2013 19:08:36
******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Student_Courses](
[Session_ID] [int] NOT NULL,
[Course_ID] [int] NOT NULL,
[Student_ID] [int] NOT NULL,
[Earned_Grade] [nvarchar](50) NULL,
PRIMARY KEY CLUSTERED
(
[Session_ID] ASC,
[Course_ID] ASC,
[Student_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
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (10, 1, 11232, N'F')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (10, 1, 12100, N'A')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (10, 1, 13310, N'B')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (10, 1, 14641, N'B')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (10, 1, 16105, N'C')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (11, 1, 11232, N'A')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (11, 2, 12100, N'B')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (11, 2, 13310, N'B')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (11, 2, 14641, N'A')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (11, 2, 16105, N'C')
Page 27 of 27
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (12, 2, 11232, N'A')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (12, 6, 12100, N'B')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (12, 6, 13310, N'B')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (12, 6, 14641, N'B')
INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
[Student_ID], [Earned_Grade])
VALUES (12, 6, 16105, N'A')
/****** Object: ForeignKey
[FK__Employees__Depar__0CBAE877] Script Date:
08/29/2013
19:08:36 ******/
ALTER TABLE [dbo].[Employees] WITH CHECK ADD
FOREIGN KEY([Department_ID])
REFERENCES [dbo].[Departments] ([Department_ID])
GO
/****** Object: ForeignKey
[FK__Advisors__Employ__117F9D94] Script Date:
08/29/2013
19:08:36 ******/
ALTER TABLE [dbo].[Advisors] WITH CHECK ADD
FOREIGN KEY([Employee_ID])
REFERENCES [dbo].[Employees] ([Employee_ID])
GO
/****** Object: ForeignKey
[FK__Students__Adviso__164452B1] Script Date: 08/29/2013
19:08:36 ******/
ALTER TABLE [dbo].[Students] WITH CHECK ADD
FOREIGN KEY([Advisor_ID])
REFERENCES [dbo].[Advisors] ([Employee_ID])
GO
/****** Object: ForeignKey
[FK__Student_C__Cours__1BFD2C07] Script Date:
08/29/2013
19:08:36 ******/
ALTER TABLE [dbo].[Student_Courses] WITH CHECK ADD
FOREIGN KEY([Course_ID])
REFERENCES [dbo].[Courses] ([Course_ID])
GO
/****** Object: ForeignKey
[FK__Student_C__Sessi__1B0907CE] Script Date:
08/29/2013
19:08:36 ******/
ALTER TABLE [dbo].[Student_Courses] WITH CHECK ADD
FOREIGN KEY([Session_ID])
REFERENCES [dbo].[Sessions] ([Session_ID])
GO
/****** Object: ForeignKey
[FK__Student_C__Stude__1CF15040] Script Date:
08/29/2013
19:08:36 ******/
ALTER TABLE [dbo].[Student_Courses] WITH CHECK ADD
FOREIGN KEY([Student_ID])
REFERENCES [dbo].[Students] ([Student_ID])
GO
{Your Name}
ITCO333 – Unit 2
{date}
Hint: Refer to the Unit 2 - LoCoco – Sample.pdf in the
Instructor Files area for an example.
Requirements
· This database must contain examples of one-to-one, one-to-
many and many-to-many relationships.
· I will compare your Unit 1 ERD with the Unit 2 database
diagram. If there are differences, explain why.
· Present your SQL statements in the order in which they were
executed.
· Put your database diagram at the top of your document (see
my sample).
· You must provide proof (via a screen shot) that your SQL
statement executed.
Relationships (from Unit 1)
Include corrections based on the feedback you received.
Relationship Type
Entity #1
Entity #2
Description / Justification
one-to-one (1:1)
one-to-many (1:M)
one-to-many (1:M)
many-to-many (M:N)
Your Unit 1 ERD
Include corrections based on the feedback you received.
Database Diagram
Refer to: http://www.youtube.com/watch?v=wMbPRHeYvMU
SQL DDL to create database
Create tables, Fields, Primary Keys & Foreign Key
DML to populate the database
Full SQL
Perform TASKS > GENERATE SCRIPTS. Copy and paste the
full database script here.
Refer to the “Generate Scripts for Entire Database.pdf” in the
Instructor Files area.
Page 5 of 5

More Related Content

Similar to Page 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 2.docx

Running Head STUDENT RECORD KEEPING SYSTEM DATABASE PROJECT 1.docx
Running Head STUDENT RECORD KEEPING SYSTEM DATABASE PROJECT  1.docxRunning Head STUDENT RECORD KEEPING SYSTEM DATABASE PROJECT  1.docx
Running Head STUDENT RECORD KEEPING SYSTEM DATABASE PROJECT 1.docxjeanettehully
 
Data centric Metaprogramming by Vlad Ulreche
Data centric Metaprogramming by Vlad UlrecheData centric Metaprogramming by Vlad Ulreche
Data centric Metaprogramming by Vlad UlrecheSpark Summit
 
Data Centric Metaprocessing by Vlad Ulreche
Data Centric Metaprocessing by Vlad UlrecheData Centric Metaprocessing by Vlad Ulreche
Data Centric Metaprocessing by Vlad UlrecheSpark Summit
 
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docx
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docxCharles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docx
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docxchristinemaritza
 
Preparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001dPreparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001dGihan Wikramanayake
 
ADBMS ASSIGNMENT
ADBMS ASSIGNMENTADBMS ASSIGNMENT
ADBMS ASSIGNMENTLori Moore
 
Recommender System with Distributed Representation
Recommender System with Distributed RepresentationRecommender System with Distributed Representation
Recommender System with Distributed RepresentationRakuten Group, Inc.
 
Micro project project co 3i
Micro project project co 3iMicro project project co 3i
Micro project project co 3iARVIND SARDAR
 
Database Assignment
Database AssignmentDatabase Assignment
Database AssignmentJayed Imran
 
Week 4 Written Assignment Stored Procedures as a Security Measure.docx
Week 4 Written Assignment Stored Procedures as a Security Measure.docxWeek 4 Written Assignment Stored Procedures as a Security Measure.docx
Week 4 Written Assignment Stored Procedures as a Security Measure.docxcockekeshia
 
A2 databases
A2 databasesA2 databases
A2 databasesc.west
 
M.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMS
M.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMSM.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMS
M.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMSSupriya Radhakrishna
 
Mca ii-dbms- u-iii-sql concepts
Mca ii-dbms- u-iii-sql conceptsMca ii-dbms- u-iii-sql concepts
Mca ii-dbms- u-iii-sql conceptsRai University
 
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweqdbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweqwrushabhsirsat
 
Explanations in Data Systems
Explanations in Data SystemsExplanations in Data Systems
Explanations in Data SystemsFotis Savva
 

Similar to Page 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 2.docx (20)

Running Head STUDENT RECORD KEEPING SYSTEM DATABASE PROJECT 1.docx
Running Head STUDENT RECORD KEEPING SYSTEM DATABASE PROJECT  1.docxRunning Head STUDENT RECORD KEEPING SYSTEM DATABASE PROJECT  1.docx
Running Head STUDENT RECORD KEEPING SYSTEM DATABASE PROJECT 1.docx
 
Data centric Metaprogramming by Vlad Ulreche
Data centric Metaprogramming by Vlad UlrecheData centric Metaprogramming by Vlad Ulreche
Data centric Metaprogramming by Vlad Ulreche
 
Data Centric Metaprocessing by Vlad Ulreche
Data Centric Metaprocessing by Vlad UlrecheData Centric Metaprocessing by Vlad Ulreche
Data Centric Metaprocessing by Vlad Ulreche
 
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docx
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docxCharles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docx
Charles WilliamsCS362Unit 3 Discussion BoardStructured Query Langu.docx
 
Preparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001dPreparing for BIT – IT2301 Database Management Systems 2001d
Preparing for BIT – IT2301 Database Management Systems 2001d
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
ADBMS ASSIGNMENT
ADBMS ASSIGNMENTADBMS ASSIGNMENT
ADBMS ASSIGNMENT
 
Recommender System with Distributed Representation
Recommender System with Distributed RepresentationRecommender System with Distributed Representation
Recommender System with Distributed Representation
 
Micro project project co 3i
Micro project project co 3iMicro project project co 3i
Micro project project co 3i
 
Database Assignment
Database AssignmentDatabase Assignment
Database Assignment
 
Unit03 dbms
Unit03 dbmsUnit03 dbms
Unit03 dbms
 
Week 4 Written Assignment Stored Procedures as a Security Measure.docx
Week 4 Written Assignment Stored Procedures as a Security Measure.docxWeek 4 Written Assignment Stored Procedures as a Security Measure.docx
Week 4 Written Assignment Stored Procedures as a Security Measure.docx
 
A2 databases
A2 databasesA2 databases
A2 databases
 
M.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMS
M.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMSM.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMS
M.TECH 1ST SEM COMPUTER SCIENCE ADBMS LAB PROGRAMS
 
Teknik-Tekniknya
Teknik-TekniknyaTeknik-Tekniknya
Teknik-Tekniknya
 
SQL
SQLSQL
SQL
 
SQL
SQL SQL
SQL
 
Mca ii-dbms- u-iii-sql concepts
Mca ii-dbms- u-iii-sql conceptsMca ii-dbms- u-iii-sql concepts
Mca ii-dbms- u-iii-sql concepts
 
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweqdbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
dbms-unit-_part-1.pptxeqweqweqweqweqweqweqweq
 
Explanations in Data Systems
Explanations in Data SystemsExplanations in Data Systems
Explanations in Data Systems
 

More from alfred4lewis58146

For this assignment, students will need to observe the activities th.docx
For this assignment, students will need to observe the activities th.docxFor this assignment, students will need to observe the activities th.docx
For this assignment, students will need to observe the activities th.docxalfred4lewis58146
 
For this assignment, select a human service organization from .docx
For this assignment, select a human service organization from .docxFor this assignment, select a human service organization from .docx
For this assignment, select a human service organization from .docxalfred4lewis58146
 
For this Assignment, read the case study for Claudia and find tw.docx
For this Assignment, read the case study for Claudia and find tw.docxFor this Assignment, read the case study for Claudia and find tw.docx
For this Assignment, read the case study for Claudia and find tw.docxalfred4lewis58146
 
For this assignment, download the A6 code pack. This zip fil.docx
For this assignment, download the A6 code pack. This zip fil.docxFor this assignment, download the A6 code pack. This zip fil.docx
For this assignment, download the A6 code pack. This zip fil.docxalfred4lewis58146
 
For this assignment, create infographic using the Canva website..docx
For this assignment, create infographic using the Canva website..docxFor this assignment, create infographic using the Canva website..docx
For this assignment, create infographic using the Canva website..docxalfred4lewis58146
 
For this assignment, compare  California during the Great Depression.docx
For this assignment, compare  California during the Great Depression.docxFor this assignment, compare  California during the Great Depression.docx
For this assignment, compare  California during the Great Depression.docxalfred4lewis58146
 
For this assignment, create a 10- to 12-slide presentation in Mi.docx
For this assignment, create a 10- to 12-slide presentation in Mi.docxFor this assignment, create a 10- to 12-slide presentation in Mi.docx
For this assignment, create a 10- to 12-slide presentation in Mi.docxalfred4lewis58146
 
For this assignment, begin by reading chapters 12-15 in Dr. Bells t.docx
For this assignment, begin by reading chapters 12-15 in Dr. Bells t.docxFor this assignment, begin by reading chapters 12-15 in Dr. Bells t.docx
For this assignment, begin by reading chapters 12-15 in Dr. Bells t.docxalfred4lewis58146
 
For this assignment, assume you are the new Secretary of Homelan.docx
For this assignment, assume you are the new Secretary of Homelan.docxFor this assignment, assume you are the new Secretary of Homelan.docx
For this assignment, assume you are the new Secretary of Homelan.docxalfred4lewis58146
 
For this assignment, address the following promptsIntroductor.docx
For this assignment, address the following promptsIntroductor.docxFor this assignment, address the following promptsIntroductor.docx
For this assignment, address the following promptsIntroductor.docxalfred4lewis58146
 
For this assignment, analyze the play by focusing on one of the .docx
For this assignment, analyze the play by focusing on one of the .docxFor this assignment, analyze the play by focusing on one of the .docx
For this assignment, analyze the play by focusing on one of the .docxalfred4lewis58146
 
For this assignment I would like you to answer these questions.docx
For this assignment I would like you to answer these questions.docxFor this assignment I would like you to answer these questions.docx
For this assignment I would like you to answer these questions.docxalfred4lewis58146
 
For the Weekly Reports I need 2 reports. For the First two weeks the.docx
For the Weekly Reports I need 2 reports. For the First two weeks the.docxFor the Weekly Reports I need 2 reports. For the First two weeks the.docx
For the Weekly Reports I need 2 reports. For the First two weeks the.docxalfred4lewis58146
 
For the shortanswer questions,you will need to respo.docx
For the shortanswer questions,you will need to respo.docxFor the shortanswer questions,you will need to respo.docx
For the shortanswer questions,you will need to respo.docxalfred4lewis58146
 
For the sake of argument (this essay in particular), lets prete.docx
For the sake of argument (this essay in particular), lets prete.docxFor the sake of argument (this essay in particular), lets prete.docx
For the sake of argument (this essay in particular), lets prete.docxalfred4lewis58146
 
For the proposal, each student must describe an interface they a.docx
For the proposal, each student must describe an interface they a.docxFor the proposal, each student must describe an interface they a.docx
For the proposal, each student must describe an interface they a.docxalfred4lewis58146
 
For the project, you will be expected to apply the key concepts of p.docx
For the project, you will be expected to apply the key concepts of p.docxFor the project, you will be expected to apply the key concepts of p.docx
For the project, you will be expected to apply the key concepts of p.docxalfred4lewis58146
 
For the past several weeks you have addressed several different area.docx
For the past several weeks you have addressed several different area.docxFor the past several weeks you have addressed several different area.docx
For the past several weeks you have addressed several different area.docxalfred4lewis58146
 
For the Mash it Up assignment, we experimented with different ways t.docx
For the Mash it Up assignment, we experimented with different ways t.docxFor the Mash it Up assignment, we experimented with different ways t.docx
For the Mash it Up assignment, we experimented with different ways t.docxalfred4lewis58146
 
For the first time in modern history, the world is experiencing a he.docx
For the first time in modern history, the world is experiencing a he.docxFor the first time in modern history, the world is experiencing a he.docx
For the first time in modern history, the world is experiencing a he.docxalfred4lewis58146
 

More from alfred4lewis58146 (20)

For this assignment, students will need to observe the activities th.docx
For this assignment, students will need to observe the activities th.docxFor this assignment, students will need to observe the activities th.docx
For this assignment, students will need to observe the activities th.docx
 
For this assignment, select a human service organization from .docx
For this assignment, select a human service organization from .docxFor this assignment, select a human service organization from .docx
For this assignment, select a human service organization from .docx
 
For this Assignment, read the case study for Claudia and find tw.docx
For this Assignment, read the case study for Claudia and find tw.docxFor this Assignment, read the case study for Claudia and find tw.docx
For this Assignment, read the case study for Claudia and find tw.docx
 
For this assignment, download the A6 code pack. This zip fil.docx
For this assignment, download the A6 code pack. This zip fil.docxFor this assignment, download the A6 code pack. This zip fil.docx
For this assignment, download the A6 code pack. This zip fil.docx
 
For this assignment, create infographic using the Canva website..docx
For this assignment, create infographic using the Canva website..docxFor this assignment, create infographic using the Canva website..docx
For this assignment, create infographic using the Canva website..docx
 
For this assignment, compare  California during the Great Depression.docx
For this assignment, compare  California during the Great Depression.docxFor this assignment, compare  California during the Great Depression.docx
For this assignment, compare  California during the Great Depression.docx
 
For this assignment, create a 10- to 12-slide presentation in Mi.docx
For this assignment, create a 10- to 12-slide presentation in Mi.docxFor this assignment, create a 10- to 12-slide presentation in Mi.docx
For this assignment, create a 10- to 12-slide presentation in Mi.docx
 
For this assignment, begin by reading chapters 12-15 in Dr. Bells t.docx
For this assignment, begin by reading chapters 12-15 in Dr. Bells t.docxFor this assignment, begin by reading chapters 12-15 in Dr. Bells t.docx
For this assignment, begin by reading chapters 12-15 in Dr. Bells t.docx
 
For this assignment, assume you are the new Secretary of Homelan.docx
For this assignment, assume you are the new Secretary of Homelan.docxFor this assignment, assume you are the new Secretary of Homelan.docx
For this assignment, assume you are the new Secretary of Homelan.docx
 
For this assignment, address the following promptsIntroductor.docx
For this assignment, address the following promptsIntroductor.docxFor this assignment, address the following promptsIntroductor.docx
For this assignment, address the following promptsIntroductor.docx
 
For this assignment, analyze the play by focusing on one of the .docx
For this assignment, analyze the play by focusing on one of the .docxFor this assignment, analyze the play by focusing on one of the .docx
For this assignment, analyze the play by focusing on one of the .docx
 
For this assignment I would like you to answer these questions.docx
For this assignment I would like you to answer these questions.docxFor this assignment I would like you to answer these questions.docx
For this assignment I would like you to answer these questions.docx
 
For the Weekly Reports I need 2 reports. For the First two weeks the.docx
For the Weekly Reports I need 2 reports. For the First two weeks the.docxFor the Weekly Reports I need 2 reports. For the First two weeks the.docx
For the Weekly Reports I need 2 reports. For the First two weeks the.docx
 
For the shortanswer questions,you will need to respo.docx
For the shortanswer questions,you will need to respo.docxFor the shortanswer questions,you will need to respo.docx
For the shortanswer questions,you will need to respo.docx
 
For the sake of argument (this essay in particular), lets prete.docx
For the sake of argument (this essay in particular), lets prete.docxFor the sake of argument (this essay in particular), lets prete.docx
For the sake of argument (this essay in particular), lets prete.docx
 
For the proposal, each student must describe an interface they a.docx
For the proposal, each student must describe an interface they a.docxFor the proposal, each student must describe an interface they a.docx
For the proposal, each student must describe an interface they a.docx
 
For the project, you will be expected to apply the key concepts of p.docx
For the project, you will be expected to apply the key concepts of p.docxFor the project, you will be expected to apply the key concepts of p.docx
For the project, you will be expected to apply the key concepts of p.docx
 
For the past several weeks you have addressed several different area.docx
For the past several weeks you have addressed several different area.docxFor the past several weeks you have addressed several different area.docx
For the past several weeks you have addressed several different area.docx
 
For the Mash it Up assignment, we experimented with different ways t.docx
For the Mash it Up assignment, we experimented with different ways t.docxFor the Mash it Up assignment, we experimented with different ways t.docx
For the Mash it Up assignment, we experimented with different ways t.docx
 
For the first time in modern history, the world is experiencing a he.docx
For the first time in modern history, the world is experiencing a he.docxFor the first time in modern history, the world is experiencing a he.docx
For the first time in modern history, the world is experiencing a he.docx
 

Recently uploaded

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

Page 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 2.docx

  • 1. Page 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 29, 2013 REQUIREM ENT S • This database must contain examples of one • I will compare your Unit 1 ERD with the Unit 2 database diagram. If there are differences, explain why. • Present your SQL statements in the order in which they were executed. • Put your database diagram at the top of your document (see my sample). Each of your t sample data (p REL AT IONS HIP S
  • 2. Relationship Type Entity #1 Entity #2 one-to-one (1:1) Advisors Employees one-to-many (1:M) Employees Departments one-to-many (1:M) Advisors Students This database must contain examples of one-to-one, one-to- many and many-to-many relationships. I will compare your Unit 1 ERD with the Unit 2 database diagram. If there are differences, explain why. Present your SQL statements in the order in which they were executed. Put your database diagram at the top of your document (see my sample). tables must contain at least eight records of per the assignment requirements). Entity #2 Description / Justification Employees An Advisor is an Employee with additional data attributes. An Employee may or may not be an Advisor. Departments A Department may have 0, 1 or many Employees
  • 3. Employee is assigned to just one Department. An Advisor may be assigned to 0, 1 or many Students and a Student is assigned to just one Advisor. many relationships. I will compare your Unit 1 ERD with the Unit 2 database diagram. If there are differences, explain why. An Advisor is an Employee with additional data attributes. An Employee may or may not be an Advisor. many Employees and an An Advisor may be assigned to 0, 1 or many Students and Page 2 of 27 many-to-many (M:N) Students Courses A Student be take 0 , 1 or many Courses and a Course can contain 0, 1 or many Students.
  • 4. Relational Databases can not support many-to-many relationships. These M:N must be broken down into two one-to-many relationships with a bridge entity connecting the M:N entities. In this case, Student_Courses is that bridge entity. Page 3 of 27 D AT ABASE D IAGR AM Page 4 of 27 UNIT 1 ERD
  • 5. Emloyees PK Employee_ID Last_Name First_Name Birth_Date Employment_Start_Date Hourly_Pay FK1 Department_ID Manager_ID Departments PK Department_ID Department_Name Students PK Student_ID Last_Name First_Name Birth_Date Enroll_Date
  • 6. Status_Code Total_Hours FK1,FK2 Advisor_ID Advisors PK,FK1 Employee_ID Certification_Level Courses PK Course_ID Course_Code Course_Name Credit_Hours Sessions PK Session_ID Session_Name Session_Start_Date Student_Courses PK,FK1 Session_ID PK,FK3 Course_ID
  • 7. PK,FK2 Student_ID Earned_Grade Page 5 of 27 SQL D D L T O CREAT E D AT ABASE USE [master] GO CREATE DATABASE ITCO333Database GO Page 6 of 27 CREAT E T ABL ES, F IEL D S , P RIM ARY K EY S & FOREIGN K EY / CREAT E D M L
  • 8. USE [ITCO333Database] GO CREATE TABLE [dbo].[Departments]( [Department_ID] [int] NOT NULL PRIMARY KEY, [Department_Name] [nvarchar](50) NULL ) GO USE [ITCO333Database] GO INSERT [dbo].[Departments] ([Department_ID], [Department_Name]) VALUES (1, N'Academics'), (2, N'Finance'), (3, N'Student Advisors'), (4, N'Marketing'), (5, N'Recruitment'), (6, N'Office of Provost'), (7, N'Information Technology') Page 7 of 27 GO
  • 9. Page 8 of 27 USE [ITCO333Database] GO CREATE TABLE [dbo].[Sessions] ( [Session_ID] [int] NOT NULL PRIMARY KEY, [Session_Name] [nvarchar](50) NULL, [Session_Start_Date] [date] NULL ) GO USE [ITCO333Database] GO INSERT [dbo].[Sessions] ([Session_ID], [Session_Name], [Session_Start_Date]) VALUES (10, N'1201-A', '2012-01-12'), (11, N'1201-B', '2012-02-15'), (12, N'1202-A', '2012-04-01'), (13, N'1202-B', '2012-05-15'), (14, N'1203-A', '2012-07-01'),
  • 10. (15, N'1203-B', '2012-08-15'), (16, N'1204-A', '2012-10-01'), (17, N'1204-B', '2012-11-15') GO Page 9 of 27 Page 10 of 27 USE [ITCO333Database] GO CREATE TABLE [dbo].[Courses] ( [Course_ID] [int] NOT NULL PRIMARY KEY, [Course_Code] [nvarchar](50) NULL, [Course_Name] [nvarchar](50) NULL, [Credit_Hours] [int] NULL ) GO
  • 11. USE [ITCO333Database] GO INSERT [dbo].[Courses] ([Course_ID], [Course_Code], [Course_Name], [Credit_Hours]) VALUES (1, N'ITD200', N'Database I', 4), (2, N'ITD300', N'Database II', 4), (3, N'ITD400', N'Advanced Databases', 4), (4, N'ITN200', N'Networking I', 4), (5, N'ITN300', N'Networking II', 4), (6, N'ITN400', N'Advanced Networking', 4), (7, N'ITP200', N'Intro to Programming', 4), (8, N'ITP300', N'Programming II', 4), (9, N'ITP400', N'Advanced Programming', 4) GO Page 11 of 27 Page 12 of 27 USE [ITCO333Database]
  • 12. GO CREATE TABLE [dbo].[Employees]( [Employee_ID] [int] NOT NULL PRIMARY KEY, [Last_Name] [nvarchar](50) NULL, [First_Name] [nvarchar](50) NULL, [Birth_Date] [date] NULL, [Employment_Start_Date] [date] NULL, [Hourly_Pay] [decimal](18, 2) NULL, [Department_ID] [int] NOT NULL REFERENCES Departments (Department_ID), [Manager_ID] [int] NOT NULL ) GO USE [ITCO333Database] GO INSERT [dbo].[Employees] ([Employee_ID], [Last_Name], [First_Name], [Birth_Date], [Employment_Start_Date], [Hourly_Pay], [Department_ID], [Manager_ID]) VALUES (1000, N'Smith', N'Chris', '1980-09-14', '2001-01-02', 30.50, 2, 1000), (1121, N'Townsend', N'Robert', '1976-02-03', '2001-03-02', 24.30, 1, 1121), (1223, N'Cogdon', N'Luis', '1974-04-05', '2001-04-21', 24.30 , 2, 1000), (1344, N'Lancette', N'Joseph', '1980-03-05', '2002-04-10', 23.34, 3, 1344), (1366, N'Lark', N'James', '1985-06-06', '2005-05-19', 23.55, 2, 1000), (1565, N'Whitely', N'Jeremy', '1973-10-23', '2011-02-05', 23.45,
  • 13. 3, 1344), (1808, N'Fix', N'Julie', '1968-02-04', '2003-12-01',30.04 , 1, 1121) GO Page 13 of 27 Page 14 of 27 USE [ITCO333Database] GO CREATE TABLE [dbo].[Advisors]( [Employee_ID] [int] NOT NULL PRIMARY KEY REFERENCES Employees (Employee_ID), [Certification_Level] [nvarchar](50) NULL ) GO
  • 14. USE [ITCO333Database] GO INSERT [Advisors] ([Employee_ID], [Certification_Level]) VALUES (1344, N'100'), (1565, N'80') GO Page 15 of 27 Page 16 of 27 USE [ITCO333Database] GO CREATE TABLE [dbo].[Students] ( [Student_ID] [int] NOT NULL PRIMARY KEY, [Last_Name] [nvarchar](50) NULL, [First_Name] [nvarchar](50) NULL, [Birth_Date] [date] NULL, [Enroll_Date] [date] NULL, [Status_Code] [int] NULL,
  • 15. [Total_Hours] [int] NULL, [Advisor_ID] [int] NULL REFERENCES Advisors (Employee_ID) ) GO USE [ITCO333Database] GO INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (11232, 'Bowser','Timothy','1980-02-03','2011-01- 02',1,20,1565), (12100, 'Chavez','Kelly','1976-12-10','2011-04-01',2,22,1565), (13310, 'Clark','Ethan','1982-10-13','2011-06-15',1,24,1344), (14641, 'Colon','Alexander','1980-01-14','2011-08- 01',1,20,1565), (16105, 'Cutts','Cardright','1970-05-16','2011-06-15',2,22,1565), Page 17 of 27 (17715, 'Fair','Jermaine','1982-05-17','2011-04-01',2,24,1344), (19487, 'Garrett','Michael','1975-04-19','2011-08- 01',2,20,1565), (21435, 'Hintz','Valarie','1980-05-03','2011-01-02',1,22,1344), (23579, 'Mcclain','Clint','1979-05-03','2011-04-01',1,24,1565), (25937, 'McFarlane','Brenda','1976-07-25','2011-06- 15',1,16,1344),
  • 16. (28576, 'Mohr','Bryan','1980-06-26','2011-08-01',1,28,1565), (31384, 'Rettino','Steven','1969-11-15','2011-01-02',3,20,1344), (34522, 'Sanchez','Thomas','1980-02-17','2011-04- 01',1,22,1344), (37974, 'Sudbury','Dale','1967-09-04','2011-08-01',3,24,1565), (41772, 'Tribbitt','Patrick','1981-04-17','2011-01-02',2,32,1344) GO Page 18 of 27 Page 19 of 27 CREATE TABLE [dbo].[Student_Courses]( [Session_ID] [int] NOT NULL REFERENCES Sessions (Session_ID), [Course_ID] [int] NOT NULL REFERENCES Courses (Course_ID), [Student_ID] [int] NOT NULL REFERENCES Students (Student_ID), [Earned_Grade] [nvarchar](50) NULL,
  • 17. PRIMARY KEY ([Session_ID],[Course_ID],[Student_ID]) ) GO USE [ITCO333Database] GO INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (10, 1, 11232, N'F'), (10, 1, 12100, N'A'), (10, 1, 13310, N'B'), (10, 1, 14641, N'B'), (10, 1, 16105, N'C'), (11, 1, 11232, N'A'), (11, 2, 12100, N'B'), (11, 2, 13310, N'B'), (11, 2, 14641, N'A'), (11, 2, 16105, N'C'), (12, 2, 11232, N'A'), (12, 6, 12100, N'B'), (12, 6, 13310, N'B'), (12, 6, 14641, N'B'), (12, 6, 16105, N'A') Page 20 of 27 GO
  • 18. Page 21 of 27 FUL L SQL Perform TASKS > GENERATE SCRIPTS. Copy and paste the full database script here. Refer to the “Generate Scripts for Entire Database.pdf” in the Instructor Files area. USE [master] GO /****** Object: Database [ITCO333Database] Script Date: 08/29/2013 19:08:35 ******/ CREATE DATABASE [ITCO333Database] ON PRIMARY ( NAME = N'ITCO333Database', FILENAME = N'c:Program Files (x86)Microsoft SQL ServerMSSQL10_50.SQLEXPRESSMSSQLDATAITCO333D atabase.mdf' , SIZE = 2304KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON ( NAME = N'ITCO333Database_log', FILENAME = N'c:Program Files (x86)Microsoft SQL ServerMSSQL10_50.SQLEXPRESSMSSQLDATAITCO333D atabase_log.LDF' , SIZE = 576KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
  • 19. GO ALTER DATABASE [ITCO333Database] SET COMPATIBILITY_LEVEL = 100 GO IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')) begin EXEC [ITCO333Database].[dbo].[sp_fulltext_database] @action = 'enable' end GO ALTER DATABASE [ITCO333Database] SET ANSI_NULL_DEFAULT OFF GO ALTER DATABASE [ITCO333Database] SET ANSI_NULLS OFF GO ALTER DATABASE [ITCO333Database] SET ANSI_PADDING OFF GO ALTER DATABASE [ITCO333Database] SET ANSI_WARNINGS OFF GO ALTER DATABASE [ITCO333Database] SET ARITHABORT OFF GO ALTER DATABASE [ITCO333Database] SET AUTO_CLOSE ON GO ALTER DATABASE [ITCO333Database] SET AUTO_CREATE_STATISTICS ON GO ALTER DATABASE [ITCO333Database] SET AUTO_SHRINK OFF GO ALTER DATABASE [ITCO333Database] SET AUTO_UPDATE_STATISTICS ON
  • 20. GO ALTER DATABASE [ITCO333Database] SET CURSOR_CLOSE_ON_COMMIT OFF GO ALTER DATABASE [ITCO333Database] SET CURSOR_DEFAULT GLOBAL GO ALTER DATABASE [ITCO333Database] SET CONCAT_NULL_YIELDS_NULL OFF GO ALTER DATABASE [ITCO333Database] SET NUMERIC_ROUNDABORT OFF GO ALTER DATABASE [ITCO333Database] SET QUOTED_IDENTIFIER OFF GO ALTER DATABASE [ITCO333Database] SET RECURSIVE_TRIGGERS OFF GO ALTER DATABASE [ITCO333Database] SET ENABLE_BROKER Page 22 of 27 GO ALTER DATABASE [ITCO333Database] SET AUTO_UPDATE_STATISTICS_ASYNC OFF GO ALTER DATABASE [ITCO333Database] SET DATE_CORRELATION_OPTIMIZATION OFF GO ALTER DATABASE [ITCO333Database] SET TRUSTWORTHY OFF
  • 21. GO ALTER DATABASE [ITCO333Database] SET ALLOW_SNAPSHOT_ISOLATION OFF GO ALTER DATABASE [ITCO333Database] SET PARAMETERIZATION SIMPLE GO ALTER DATABASE [ITCO333Database] SET READ_COMMITTED_SNAPSHOT OFF GO ALTER DATABASE [ITCO333Database] SET HONOR_BROKER_PRIORITY OFF GO ALTER DATABASE [ITCO333Database] SET READ_WRITE GO ALTER DATABASE [ITCO333Database] SET RECOVERY SIMPLE GO ALTER DATABASE [ITCO333Database] SET MULTI_USER GO ALTER DATABASE [ITCO333Database] SET PAGE_VERIFY CHECKSUM GO ALTER DATABASE [ITCO333Database] SET DB_CHAINING OFF GO USE [ITCO333Database] GO /****** Object: Table [dbo].[Departments] Script Date: 08/29/2013 19:08:36 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Departments]( [Department_ID] [int] NOT NULL,
  • 22. [Department_Name] [nvarchar](50) NULL, PRIMARY KEY CLUSTERED ( [Department_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 INSERT [dbo].[Departments] ([Department_ID], [Department_Name]) VALUES (1, N'Academics') INSERT [dbo].[Departments] ([Department_ID], [Department_Name]) VALUES (2, N'Finance') INSERT [dbo].[Departments] ([Department_ID], [Department_Name]) VALUES (3, N'Student Advisors') INSERT [dbo].[Departments] ([Department_ID], [Department_Name]) VALUES (4, N'Marketing') INSERT [dbo].[Departments] ([Department_ID], [Department_Name]) VALUES (5, N'Recruitment') INSERT [dbo].[Departments] ([Department_ID], [Department_Name]) VALUES (6, N'Office of Provost') INSERT [dbo].[Departments] ([Department_ID], [Department_Name]) VALUES (7, N'Information Technology') /****** Object: Table [dbo].[Courses] Script Date: 08/29/2013 19:08:36 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Courses](
  • 23. Page 23 of 27 [Course_ID] [int] NOT NULL, [Course_Code] [nvarchar](50) NULL, [Course_Name] [nvarchar](50) NULL, [Credit_Hours] [int] NULL, PRIMARY KEY CLUSTERED ( [Course_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 INSERT [dbo].[Courses] ([Course_ID], [Course_Code], [Course_Name], [Credit_Hours]) VALUES (1, N'ITD200', N'Database I', 4) INSERT [dbo].[Courses] ([Course_ID], [Course_Code], [Course_Name], [Credit_Hours]) VALUES (2, N'ITD300', N'Database II', 4) INSERT [dbo].[Courses] ([Course_ID], [Course_Code], [Course_Name], [Credit_Hours]) VALUES (3, N'ITD400', N'Advanced Databases', 4) INSERT [dbo].[Courses] ([Course_ID], [Course_Code], [Course_Name], [Credit_Hours]) VALUES (4, N'ITN200', N'Networking I', 4) INSERT [dbo].[Courses] ([Course_ID], [Course_Code], [Course_Name], [Credit_Hours]) VALUES (5, N'ITN300', N'Networking II', 4) INSERT [dbo].[Courses] ([Course_ID], [Course_Code], [Course_Name], [Credit_Hours]) VALUES (6, N'ITN400', N'Advanced Networking', 4)
  • 24. INSERT [dbo].[Courses] ([Course_ID], [Course_Code], [Course_Name], [Credit_Hours]) VALUES (7, N'ITP200', N'Intro to Programming', 4) INSERT [dbo].[Courses] ([Course_ID], [Course_Code], [Course_Name], [Credit_Hours]) VALUES (8, N'ITP300', N'Programming II', 4) INSERT [dbo].[Courses] ([Course_ID], [Course_Code], [Course_Name], [Credit_Hours]) VALUES (9, N'ITP400', N'Advanced Programming', 4) /****** Object: Table [dbo].[Sessions] Script Date: 08/29/2013 19:08:36 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Sessions]( [Session_ID] [int] NOT NULL, [Session_Name] [nvarchar](50) NULL, [Session_Start_Date] [date] NULL, PRIMARY KEY CLUSTERED ( [Session_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 INSERT [dbo].[Sessions] ([Session_ID], [Session_Name], [Session_Start_Date]) VALUES (10, N'1201-A', CAST(0x31350B00 AS Date)) INSERT [dbo].[Sessions] ([Session_ID], [Session_Name], [Session_Start_Date]) VALUES (11, N'1201-B', CAST(0x53350B00 AS Date)) INSERT [dbo].[Sessions] ([Session_ID], [Session_Name], [Session_Start_Date]) VALUES (12,
  • 25. N'1202-A', CAST(0x81350B00 AS Date)) INSERT [dbo].[Sessions] ([Session_ID], [Session_Name], [Session_Start_Date]) VALUES (13, N'1202-B', CAST(0xAD350B00 AS Date)) INSERT [dbo].[Sessions] ([Session_ID], [Session_Name], [Session_Start_Date]) VALUES (14, N'1203-A', CAST(0xDC350B00 AS Date)) INSERT [dbo].[Sessions] ([Session_ID], [Session_Name], [Session_Start_Date]) VALUES (15, N'1203-B', CAST(0x09360B00 AS Date)) INSERT [dbo].[Sessions] ([Session_ID], [Session_Name], [Session_Start_Date]) VALUES (16, N'1204-A', CAST(0x38360B00 AS Date)) Page 24 of 27 INSERT [dbo].[Sessions] ([Session_ID], [Session_Name], [Session_Start_Date]) VALUES (17, N'1204-B', CAST(0x65360B00 AS Date)) /****** Object: Table [dbo].[Employees] Script Date: 08/29/2013 19:08:36 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Employees]( [Employee_ID] [int] NOT NULL, [Last_Name] [nvarchar](50) NULL, [First_Name] [nvarchar](50) NULL, [Birth_Date] [date] NULL, [Employment_Start_Date] [date] NULL, [Hourly_Pay] [decimal](18, 2) NULL, [Department_ID] [int] NOT NULL,
  • 26. [Manager_ID] [int] NOT NULL, PRIMARY KEY CLUSTERED ( [Employee_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 INSERT [dbo].[Employees] ([Employee_ID], [Last_Name], [First_Name], [Birth_Date], [Employment_Start_Date], [Hourly_Pay], [Department_ID], [Manager_ID]) VALUES (1000, N'Smith', N'Chris', CAST(0x7F080B00 AS Date), CAST(0x76250B00 AS Date), CAST(30.50 AS Decimal(18, 2)), 2, 1000) INSERT [dbo].[Employees] ([Employee_ID], [Last_Name], [First_Name], [Birth_Date], [Employment_Start_Date], [Hourly_Pay], [Department_ID], [Manager_ID]) VALUES (1121, N'Townsend', N'Robert', CAST(0xEA010B00 AS Date), CAST(0xB1250B00 AS Date), CAST(24.30 AS Decimal(18, 2)), 1, 1121) INSERT [dbo].[Employees] ([Employee_ID], [Last_Name], [First_Name], [Birth_Date], [Employment_Start_Date], [Hourly_Pay], [Department_ID], [Manager_ID]) VALUES (1223, N'Cogdon', N'Luis', CAST(0x4DFF0A00 AS Date), CAST(0xE3250B00 AS Date), CAST(24.30 AS Decimal(18, 2)), 2, 1000) INSERT [dbo].[Employees] ([Employee_ID], [Last_Name], [First_Name], [Birth_Date], [Employment_Start_Date], [Hourly_Pay], [Department_ID], [Manager_ID]) VALUES (1344, N'Lancette', N'Joseph', CAST(0xBE070B00 AS Date),
  • 27. CAST(0x45270B00 AS Date), CAST(23.34 AS Decimal(18, 2)), 3, 1344) INSERT [dbo].[Employees] ([Employee_ID], [Last_Name], [First_Name], [Birth_Date], [Employment_Start_Date], [Hourly_Pay], [Department_ID], [Manager_ID]) VALUES (1366, N'Lark', N'James', CAST(0x3D0F0B00 AS Date), CAST(0xB42B0B00 AS Date), CAST(23.55 AS Decimal(18, 2)), 2, 1000) INSERT [dbo].[Employees] ([Employee_ID], [Last_Name], [First_Name], [Birth_Date], [Employment_Start_Date], [Hourly_Pay], [Department_ID], [Manager_ID]) VALUES (1565, N'Whitely', N'Jeremy', CAST(0xA9FE0A00 AS Date), CAST(0xDC330B00 AS Date), CAST(23.45 AS Decimal(18, 2)), 3, 1344) INSERT [dbo].[Employees] ([Employee_ID], [Last_Name], [First_Name], [Birth_Date], [Employment_Start_Date], [Hourly_Pay], [Department_ID], [Manager_ID]) VALUES (1808, N'Fix', N'Julie', CAST(0x81F60A00 AS Date), CAST(0x9D290B00 AS Date), CAST(30.04 AS Decimal(18, 2)), 1, 1121) /****** Object: Table [dbo].[Advisors] Script Date: 08/29/2013 19:08:36 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Advisors]( [Employee_ID] [int] NOT NULL, [Certification_Level] [nvarchar](50) NULL, Page 25 of 27
  • 28. PRIMARY KEY CLUSTERED ( [Employee_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 INSERT [dbo].[Advisors] ([Employee_ID], [Certification_Level]) VALUES (1344, N'100') INSERT [dbo].[Advisors] ([Employee_ID], [Certification_Level]) VALUES (1565, N'80') /****** Object: Table [dbo].[Students] Script Date: 08/29/2013 19:08:36 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Students]( [Student_ID] [int] NOT NULL, [Last_Name] [nvarchar](50) NULL, [First_Name] [nvarchar](50) NULL, [Birth_Date] [date] NULL, [Enroll_Date] [date] NULL, [Status_Code] [int] NULL, [Total_Hours] [int] NULL, [Advisor_ID] [int] NULL, PRIMARY KEY CLUSTERED ( [Student_ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS =
  • 29. ON) ON [PRIMARY] ) ON [PRIMARY] GO INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (11232, N'Bowser', N'Timothy', CAST(0x9F070B00 AS Date), CAST(0xBA330B00 AS Date), 1, 20, 1565) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (12100, N'Chavez', N'Kelly', CAST(0x21030B00 AS Date), CAST(0x13340B00 AS Date), 2, 22, 1565) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (13310, N'Clark', N'Ethan', CAST(0x760B0B00 AS Date), CAST(0x5E340B00 AS Date), 1, 24, 1344) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (14641, N'Colon', N'Alexander', CAST(0x8B070B00 AS Date), CAST(0x8D340B00 AS Date), 1, 20, 1565) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (16105, N'Cutts', N'Cardright', CAST(0xC1F90A00 AS Date), CAST(0x5E340B00 AS Date), 2, 22, 1565) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
  • 30. VALUES (17715, N'Fair', N'Jermaine', CAST(0xE10A0B00 AS Date), CAST(0x13340B00 AS Date), 2, 24, 1344) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (19487, N'Garrett', N'Michael', CAST(0xC8000B00 AS Date), CAST(0x8D340B00 AS Date), 2, 20, 1565) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (21435, N'Hintz', N'Valarie', CAST(0xF9070B00 AS Date), CAST(0xBA330B00 AS Date), 1, 22, 1344) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (23579, N'Mcclain', N'Clint', CAST(0x8B060B00 AS Date), CAST(0x13340B00 AS Date), 1, 24, 1565) Page 26 of 27 INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (25937, N'McFarlane', N'Brenda', CAST(0x97020B00 AS Date), CAST(0x5E340B00 AS Date), 1, 16, 1344) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID])
  • 31. VALUES (28576, N'Mohr', N'Bryan', CAST(0x2F080B00 AS Date), CAST(0x8D340B00 AS Date), 1, 28, 1565) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (31384, N'Rettino', N'Steven', CAST(0x0BF90A00 AS Date), CAST(0xBA330B00 AS Date), 3, 20, 1344) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (34522, N'Sanchez', N'Thomas', CAST(0xAD070B00 AS Date), CAST(0x13340B00 AS Date), 1, 22, 1344) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (37974, N'Sudbury', N'Dale', CAST(0xE8F50A00 AS Date), CAST(0x8D340B00 AS Date), 3, 24, 1565) INSERT [dbo].[Students] ([Student_ID], [Last_Name], [First_Name], [Birth_Date], [Enroll_Date], [Status_Code], [Total_Hours], [Advisor_ID]) VALUES (41772, N'Tribbitt', N'Patrick', CAST(0x56090B00 AS Date), CAST(0xBA330B00 AS Date), 2, 32, 1344) /****** Object: Table [dbo].[Student_Courses] Script Date: 08/29/2013 19:08:36 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Student_Courses]( [Session_ID] [int] NOT NULL,
  • 32. [Course_ID] [int] NOT NULL, [Student_ID] [int] NOT NULL, [Earned_Grade] [nvarchar](50) NULL, PRIMARY KEY CLUSTERED ( [Session_ID] ASC, [Course_ID] ASC, [Student_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 INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (10, 1, 11232, N'F') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (10, 1, 12100, N'A') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (10, 1, 13310, N'B') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (10, 1, 14641, N'B') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (10, 1, 16105, N'C') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (11, 1, 11232, N'A') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (11, 2, 12100, N'B') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID],
  • 33. [Student_ID], [Earned_Grade]) VALUES (11, 2, 13310, N'B') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (11, 2, 14641, N'A') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (11, 2, 16105, N'C') Page 27 of 27 INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (12, 2, 11232, N'A') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (12, 6, 12100, N'B') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (12, 6, 13310, N'B') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (12, 6, 14641, N'B') INSERT [dbo].[Student_Courses] ([Session_ID], [Course_ID], [Student_ID], [Earned_Grade]) VALUES (12, 6, 16105, N'A') /****** Object: ForeignKey [FK__Employees__Depar__0CBAE877] Script Date: 08/29/2013 19:08:36 ******/ ALTER TABLE [dbo].[Employees] WITH CHECK ADD FOREIGN KEY([Department_ID]) REFERENCES [dbo].[Departments] ([Department_ID])
  • 34. GO /****** Object: ForeignKey [FK__Advisors__Employ__117F9D94] Script Date: 08/29/2013 19:08:36 ******/ ALTER TABLE [dbo].[Advisors] WITH CHECK ADD FOREIGN KEY([Employee_ID]) REFERENCES [dbo].[Employees] ([Employee_ID]) GO /****** Object: ForeignKey [FK__Students__Adviso__164452B1] Script Date: 08/29/2013 19:08:36 ******/ ALTER TABLE [dbo].[Students] WITH CHECK ADD FOREIGN KEY([Advisor_ID]) REFERENCES [dbo].[Advisors] ([Employee_ID]) GO /****** Object: ForeignKey [FK__Student_C__Cours__1BFD2C07] Script Date: 08/29/2013 19:08:36 ******/ ALTER TABLE [dbo].[Student_Courses] WITH CHECK ADD FOREIGN KEY([Course_ID]) REFERENCES [dbo].[Courses] ([Course_ID]) GO /****** Object: ForeignKey [FK__Student_C__Sessi__1B0907CE] Script Date: 08/29/2013 19:08:36 ******/ ALTER TABLE [dbo].[Student_Courses] WITH CHECK ADD FOREIGN KEY([Session_ID]) REFERENCES [dbo].[Sessions] ([Session_ID]) GO /****** Object: ForeignKey [FK__Student_C__Stude__1CF15040] Script Date: 08/29/2013 19:08:36 ******/
  • 35. ALTER TABLE [dbo].[Student_Courses] WITH CHECK ADD FOREIGN KEY([Student_ID]) REFERENCES [dbo].[Students] ([Student_ID]) GO {Your Name} ITCO333 – Unit 2 {date} Hint: Refer to the Unit 2 - LoCoco – Sample.pdf in the Instructor Files area for an example. Requirements · This database must contain examples of one-to-one, one-to- many and many-to-many relationships. · I will compare your Unit 1 ERD with the Unit 2 database diagram. If there are differences, explain why. · Present your SQL statements in the order in which they were executed. · Put your database diagram at the top of your document (see my sample). · You must provide proof (via a screen shot) that your SQL statement executed. Relationships (from Unit 1) Include corrections based on the feedback you received. Relationship Type Entity #1 Entity #2 Description / Justification
  • 36. one-to-one (1:1) one-to-many (1:M) one-to-many (1:M) many-to-many (M:N) Your Unit 1 ERD Include corrections based on the feedback you received. Database Diagram Refer to: http://www.youtube.com/watch?v=wMbPRHeYvMU SQL DDL to create database
  • 37. Create tables, Fields, Primary Keys & Foreign Key DML to populate the database Full SQL Perform TASKS > GENERATE SCRIPTS. Copy and paste the full database script here. Refer to the “Generate Scripts for Entire Database.pdf” in the Instructor Files area. Page 5 of 5