Pos-410 - Week 2 - Table Queries Sql Server Database - Kudler Fine Foods

Only available on StudyMode
  • Download(s) : 274
  • Published : May 28, 2012
Open Document
Text Preview
Table Queries SQL Server Database - Kudler Fine Foods
Week 2
POS/410\
April, 09 2012

Create Database
USE [master]
GO
/****** Object: Database [Jeff Thompson Sr - POS 410 - IA - KVO] Script Date: 03/27/2012 09:23:56 ******/ CREATE DATABASE [Jeff Thompson Sr - POS 410 - IA - KVO] ON PRIMARY ( NAME = N'Jeff Thompson Sr - POS 410 - IA - KVO', FILENAME = N'D:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\Jeff Thompson Sr - POS 410 - IA - KVO.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON

( NAME = N'Jeff Thompson Sr - POS 410 - IA - KVO_log', FILENAME = N'D:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\Jeff Thompson Sr - POS 410 - IA - KVO_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) GO

USE [master]
GO
/****** Object: Database [Jeff Thompson Sr - POS 410 - IA - KVO] Script Date: 03/27/2012 09:23:56 ******/ CREATE DATABASE [Jeff Thompson Sr - POS 410 - IA - KVO] ON PRIMARY ( NAME = N'Jeff Thompson Sr - POS 410 - IA - KVO', FILENAME = N'D:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\Jeff Thompson Sr - POS 410 - IA - KVO.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON

( NAME = N'Jeff Thompson Sr - POS 410 - IA - KVO_log', FILENAME = N'D:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\Jeff Thompson Sr - POS 410 - IA - KVO_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) GO

Create Employee Table/Columns
USE [Jeff Thompson Sr - POS 410 - IA - KVO]
GO
/****** Object: Table [dbo].[Employee] Script Date: 03/27/2012 10:39:55 ******/ SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Employee](
[EmployeeID] [int] NOT NULL,
[LastName] [nvarchar](50) NULL,
[FirstName] [nvarchar](50) NULL,
[Address] [nvarchar](30) NULL,
[City] [nvarchar](30) NULL,
[State] [nvarchar](20) NULL,
[AreaCode] [nvarchar](20) NULL,
[TelephoneNumber] [nvarchar](20) NULL,
[EmployerInformationReportClassification] [nvarchar](max) NULL,
[HireDate] [date] NULL,
[Salary] [money] NULL,
[Gender] [nvarchar](10) NULL,
[Age] [nvarchar](5) NULL,
)
GO
USE [Jeff Thompson Sr - POS 410 - IA - KVO]
GO
/****** Object: Table [dbo].[Employee] Script Date: 03/27/2012 10:39:55 ******/ SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Employee](
[EmployeeID] [int] NOT NULL,
[LastName] [nvarchar](50) NULL,
[FirstName] [nvarchar](50) NULL,
[Address] [nvarchar](30) NULL,
[City] [nvarchar](30) NULL,
[State] [nvarchar](20) NULL,
[AreaCode] [nvarchar](20) NULL,
[TelephoneNumber] [nvarchar](20) NULL,
[EmployerInformationReportClassification] [nvarchar](max) NULL,
[HireDate] [date] NULL,
[Salary] [money] NULL,
[Gender] [nvarchar](10) NULL,
[Age] [nvarchar](5) NULL,
)
GO

Create Job Title Table/Columns
USE [Jeff Thompson Sr - POS 410 - IA - KVO]
GO
/****** Object: Table [dbo].[JobTitle] Script Date: 03/27/2012 10:35:03 ******/ SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[JobTitle](
[JobTitleID] [int] NOT NULL,
[JobTitleName] [nvarchar](50) NULL,
[JobDescription] [nvarchar](max) NULL,
[Exempt_Non_ExemptStatus] [nvarchar](10) NULL,
[EEO_1Classification] [nvarchar](50) NULL,
)
GO
USE [Jeff Thompson Sr - POS 410 - IA - KVO]
GO
/****** Object: Table [dbo].[JobTitle] Script Date: 03/27/2012 10:35:03 ******/ SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[JobTitle](
[JobTitleID] [int] NOT NULL,
[JobTitleName] [nvarchar](50) NULL,
[JobDescription] [nvarchar](max) NULL,
[Exempt_Non_ExemptStatus] [nvarchar](10) NULL,
[EEO_1Classification] [nvarchar](50) NULL,
)
GO

Employee and Job Title Tables/Relationships
CREATE TABLE [dbo].[Employee](
[JobTitleID] [int] NULL,
CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED
(
[EmployeeID] 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
CREATE TABLE [dbo].[JobTitle](...
tracking img