|
Table 1: Student Situation Information Form XS
Student ID Name Professional Name Gender Birth Time Total Credits Remarks
Primary key
Table III: Students and curriculum XS_KC
Table 2: Course schedule KC
Course number Course name Start semester Hours Credits
Primary key
Student No. Course No. Grade Credits
Primary key primary key
Create cursor
Create a cursor MYCURSOR, the query result set is the total credits of all students, and define the variable @score to read the current result into the @score variable, and use the WHILE statement to loop, if you find:. Divide one by one: delete the record (in the WHERE clause, use the CURRENT OF cursor name to indicate the record pointed to by the current cursor pointer.) If the record is between 30 and 40, add 20 points. After the operation is completed, Close the cursor and delete.
Note: CURRENT OF keyword does not appear in the cursor definition when READ-ONLY or FAST FORWARD. |
|