I have two tables in SQL Server (Personal_Info and Paper_Detail). The Personal_Info table contains the student personal information data and its Primary key is RollNo. The Paper_Detail contains the detail paper result information and it has RollNo as Foreign Key and RollNo, Paper_ID and Term_Number as a Primary Key.
Please see attached screenshot for sample structure of the database.
I need the SQL query which will generate the record in required output as shown in attached screenshot
Term_Number = 1 means Theory-I
Term_Number_ = 2 means Theory-II
Term_Number = 3 means Practical
Paper_ID means Subject Name