Hello all,
My school data look like:
Student Class Score
-----------------------------
A English 100
A Math 85
A Reading 90
B English
B Math
There are three classes that requiring for each student (for example, student A has English, Math and Reading. I am not sure how to check whether the rows are existed in database and do update for score? If not existed row, perform to insert rows before update the score data.
To simplify above data, I suppose to have 3 students: A, B, C. If my current data like above missing? I like to write T-SQL for insert and update to having the final results as following:
Student Class Score
-------------------------------
A English 100
A Math 85
A Reading 90
B English 45
B Math 20
B Reading 17
C English 100
C Math 90
C Reading 100
Any expertise T-SQL, please help with score parameter in stored procedure? Thanks in advance.
My school data look like:
Student Class Score
-----------------------------
A English 100
A Math 85
A Reading 90
B English
B Math
There are three classes that requiring for each student (for example, student A has English, Math and Reading. I am not sure how to check whether the rows are existed in database and do update for score? If not existed row, perform to insert rows before update the score data.
To simplify above data, I suppose to have 3 students: A, B, C. If my current data like above missing? I like to write T-SQL for insert and update to having the final results as following:
Student Class Score
-------------------------------
A English 100
A Math 85
A Reading 90
B English 45
B Math 20
B Reading 17
C English 100
C Math 90
C Reading 100
Any expertise T-SQL, please help with score parameter in stored procedure? Thanks in advance.