Temporal Database

Temporal Database

Create a Temporal Database based on a human resources database. It must have 3 dimension tables and 1 fact table.  Use this database code as foundation.

Create Database HumanResoruces1

GO

 

use HumanResoruces1

GO
 

CREATE TABLE [Department]

(

            [Department_ID] [int] NOT NULL,

            [Department_Name] [nchar](50) NULL,

            [Department_PhoneNumber] [nchar](25) NULL,

PRIMARY KEY  (Department_ID)

 );

 

CREATE TABLE [Employee]

(

            [Employee_ID] [int] NOT NULL,

            [Employee_FirstName] [nchar](50) NULL,

            [Employee_LastName] [nchar](50) NULL,

            [Employee_PositionID] [int] NOT NULL,

            [Employee_Phone_Number] [nchar](10) NULL,

            [Employee_SSN] [nchar] (9) NULL,

            [Department_ID] [int] NOT NULL

 PRIMARY KEY  (Employee_ID)

 FOREIGN KEY (Department_ID) REFERENCES Department(Department_ID), 

 );

 

CREATE TABLE [Employee_Job_Positions]

(

            [Employee_PositionID] [int] NOT NULL,

            [Job_Title] [nchar](50) NULL,

            [Department_ID] [int] NOT NULL

PRIMARY KEY (Employee_PositionID)

FOREIGN KEY (Department_ID) REFERENCES Department(Department_ID) 

);
Powered by