// create table [Stud_Marks] (id int identity ,[Student_Name] varchar (30),[group] varchar (30),[Marks1] numeric (18,2) ,[Marks2] numeric (18,2),[Marks3] numeric (18,2)) Go insert into [Stud_Marks] Select 'Stud1' , 'group1' ,50,20,30 union all Select 'Stud2' , 'group2' ,40,40,30 union all Select 'Stud3' , 'group3' ,10,10,40 union all Select 'Stud4' , 'group4' ,60,10,50 union all Select 'Stud5' , 'group5' ,20,10,30 GO