|
Table 1: Student Situation Information Form XS
Student ID Name Professional Name Gender Birth Time Total Credits Remarks
Primary key
Table 2: Course schedule KC
Course number Course name Start semester Hours Credits
Primary key
Table III: Students and curriculum XS_KC
Student No. Course No. Grade Credits
Primary key primary key
Query operation
1. Query the course names of all students. No duplicate records are required.
2. Display the course names and highest scores that are grouped by course name.
3. Show the student number and name of the student who was born the same year as "Li Fangfang".
4. Show the course name and average grade of the course chosen by the boy.
5. Display the average scores of all students in the XS_KC table for all courses.
Create cursor
1. 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.) For records between 30 and 40, add 20 points. Close the cursor and delete. Note: CURRENT OF keyword does not appear in the cursor definition when READ-ONLY or FAST FORWARD.
Must be implemented using SQL statements, thank you |
|