sql关联另一个表,update表的值

sql示例:

update student_score ss set ss.name=s.name
from student s
where ss.code=s.code

最常见的学生成绩表 student_score通过学生student_code关联学生信息表student
学生信息表(student):

code	name	age	  gender
1001    张三		201002	李四		211003	王五		19

学生成绩表(student_score):

code	course_name	score
1001	数学			85
1001	英语			90
1002	数学			92
1002	英语			88
1003	数学			78
1003	英语			85

现在,想给学生成绩表中加个字段学生名字name,通过sql可以这样写

update student_score ss set ss.name=s.name 
from student s 
where ss.code=s.code

更新完:
学生成绩表(student_score):

code	name 	course_name		score
1001	张三		数学				85
1001	张三		英语				90
1002	李四		数学				92
1002	李四		英语				88
1003	王五		数学				78
1003	王五		英语				85

根据枚举更新或者查询匹配数据库字段
用decode枚举值将学生成绩表中的cource_name换成英文

SELECT student_code,  DECODE(course_name,  '数学', 'Mathematics',  '英语', 'English',  '物理', 'Physics',  '化学', 'Chemistry',  '生物', 'Biology',  '历史', 'History',  '地理', 'Geography',  '政治', 'Politics',  '体育', 'Physical Education',  '其他', 'Other') AS course_name_in_english,  score  
FROM student_score;

或者将表中的数据更新

UPDATE student_score  
SET course_name = DECODE(course_name,  '数学', 'Mathematics',  '英语', 'English',  '物理', 'Physics',  '化学', 'Chemistry',  '生物', 'Biology',  '历史', 'History',  '地理', 'Geography',  '政治', 'Politics',  '体育', 'Physical Education',  '其他', 'Other');