简体   繁体   中英

Creating database tables regarding Primary and Foreign Keys

I'm doing an activity online where I need to create an example database for an Airline. It details the general information needed to be put into each table but I need help linking certain tables.

I've drawn up tables in Word to help me grasp the connections between tables but I'm unsure if I'm doing it correctly.

I have a table called 'Staff' that looks like this: 在此处输入图片说明

I was asked to create another table that provides each staff members previous work experience such as the company they worked for and join and end dates, etc. The 'Work Experience' table: 在此处输入图片说明

My question is, what would be the primary key for the Work Experience table? Seeing as Staff_ID references back to the Staff table could it be both a Primary Key and a Foreign Key?

只需创建一个通用的work_experience_id或we_id(无论您希望使用哪种方式),以便每次您想要给员工打电话之前的工作经验时,只需选择通用ID主键即可。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM