这些是我数据库中的表,我需要创建几个超类/子类结构。
首先是在哪里...
超类-Crew_Member
子类 - 导演、制片人、Other_Directing、Other_Production、艺术、相机、声音、抓地力、电气、后期。
第二个是...
超类生产者
子类-薪水,预算
+---------------------+
| Tables_in_film_crew |
+---------------------+
| art |
| budget |
| camera |
| crew_member |
| director |
| electrical |
| equipment |
| grip |
| location |
| manufacturer |
| other_directing |
| other_production |
| post_production |
| producer |
| salaries |
| sound |
+---------------------+
那么我将如何创建这些关系呢?
编辑:
也许我也应该澄清一些其他的事情。
以下是crew_member(超类)中包含的内容:
+-------------+-------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+-------------------+----------------+
| Member_ID | int(5) | NO | PRI | NULL | auto_increment |
| Member_Name | varchar(25) | YES | | [INSERT EXAMPLE] | |
| DOB | date | YES | | [INSERT EXAMPLE] | |
| Address1 | varchar(25) | YES | | [INSERT EXAMPLE] | |
| Address2 | varchar(25) | YES | | [INSERT EXAMPLE] | |
+-------------+-------------+------+-----+-------------------+----------------+
同时,这是 Other_Directing(示例子类)中包含的内容:
+---------------+--------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------+------+-----+---------+----------------+
| O_Director_ID | int(4) | NO | PRI | NULL | auto_increment |
| FAD_ID | int(5) | NO | MUL | NULL | |
| SAD_ID | int(5) | NO | MUL | NULL | |
| SUD_ID | int(5) | NO | MUL | NULL | |
+---------------+--------+------+-----+---------+----------------+
现在所有的外键都指向来自 Crew_Member 的 Member_ID。所有其他表(Director 和 Producer 除外)都以类似的方式创建。