我有三个表,我想在第一个表中查看来自其他表的值。让我更好地解释一下:
餐桌课
+------------------+----------------+----------------+------------+-----------+
| LessonCode | SubjectCode | ClassCode | hour | day |
+------------------+----------------+----------------+------------+-----------+
| 1 | 10 | 1 | 15 | m |
| 2 | 11 | 2 | 20 | t |
| 3 | 12 | 3 | 30 | w |
+------------------+----------------+----------------+------------+-----------+
表类
+------------------+----------------+
| ClassCode | ClassName |
+------------------+----------------+
| 1 | Class1 |
| 2 | class2 |
| 3 | class3 |
+------------------+----------------+
表主题
+------------------+----------------+
| subjectCode | SubjectName |
+------------------+----------------+
| 10 | Maths |
| 11 | English |
| 12 | Greek |
+------------------+----------------+
我想在lesson
表格中插入列SubjectName
并ClassName
代替SubjectCode
and ClassCode
,并具有以下表格:
+------------------+----------------+----------------+------------+-----------+
| LessonCode | SubjectName | ClassName | hour | day |
+------------------+----------------+----------------+------------+-----------+
| 1 | Maths | Class1 | 15 | m |
| 2 | English | Class2 | 20 | t |
| 3 | Greek | Class3 | 30 | w |
+------------------+----------------+----------------+------------+-----------+
我能怎么做?