Hi all,
i have two tables Student and Daily Attendance with following structure ,as i want to extract students of a class order by roll number which are not in Daily Attendance table , i know it will be solved by subquery but I don't know how to solve it,Please help me to sort this problem.I am stuck.
Student:-
CREATE TABLE [dbo].[Student](
[Student_Id] [bigint] IDENTITY(1,1) NOT NULL,
[Course_Id] [smallint] NULL, //Foreign key
[Class_Id] [int] NULL, //Foreign key
[Batch_Year] [varchar](20) NULL,
[Student_Initials] [varchar](20) NULL,
[Student_firstname] [varchar](20) NULL,
[Student_middlename] [varchar](20) NULL,
[Student_lastname] [varchar](20) NULL,
[Gender] [varchar](20) NULL,
[Roll_number] [varchar](30) NULL,)
Daily Attendance table:-
CREATE TABLE [dbo].[Daily_Attendance]([Daily_Attendance_Id] [bigint] NOT NULL,
[Class_Id] [int] NULL,
[Date_Of_Attendance] [datetime] NULL,
[Week_Day_Id] [smallint] NULL,
[Period_No] [smallint] NULL,
[Subject_Id] [int] NULL,
[Faculty_Id] [bigint] NULL,
[Student_Id] [bigint] NULL,
[Attendance] [nchar](10) NULL,
CONSTRAINT [PK_Daily_Attendance] PRIMARY KEY CLUSTERED
(
[Daily_Attendance_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