我在新数据库中创建联结表时遇到困难。我使用这些查询来创建表:
CREATE TABLE dbo.EmployeeUnavailability
(
ID INT IDENTITY(1,1) PRIMARY KEY,
EmployeeName varchar(50),
Monday varchar(10),
Tuesday varchar(10),
Wednesday varchar(10),
Thursday varchar(10),
Friday varchar(10),
Saturday varchar(10),
Sunday varchar(10),
SupervisorName varchar(50),
)
GO
CREATE TABLE dbo.EmployeeAttendance
(
ID INT IDENTITY(1,1) PRIMARY KEY,
EmployeeName varchar(50),
Monday varchar(20),
Tuesday varchar(20),
Wednesday varchar(20),
Thursday varchar(20),
Friday varchar(20),
Saturday varchar(20),
Sunday varchar(20),
SupervisorName varchar(50),
)
GO
CREATE TABLE dbo.EmployeePerformance
(
ID INT IDENTITY(1,1) PRIMARY KEY,
EmployeeName varchar(50),
Attitude varchar(250),
AttitudeDD tinyint,
WorkQuality varchar(250),
WorkQualityDD tinyint,
Communication varchar(250),
CommunicationDD tinyint,
Leadership varchar(250),
LeadershipDD tinyint,
ImprovementAchievement varchar(250),
ImprovementAchievementDD tinyint,
SupervisorName varchar(50),
)
GO
从那里开始,我很难创建一个引用所有三个表的连接表。三个表中的员工姓名和主管姓名将相同。