查询:具有索引/ foregeing键/相关数据的表

时间:2012-11-07 00:37:48

标签: mysql database

我目前正在使用MySQL数据库表结构。我在网上找到了一个很棒的桌面结构,但我不知道如何复制这样的东西。我是新手,我正在请求帮助创建一个查询,该查询将创建所有表(具有相关数据(索引),外键,多对多关系等)。

随机我能够进行查询以选择所有字段:

SELECT *

FROM schedule 

INNER JOIN semester 

ON schedule.semester_id = semester.id

INNER JOIN office_hours

ON office_hours.schedule_id = schedule.semester_id

INNER JOIN faculty

ON faculty.id = office_hours.faculty_id

INNER JOIN faculty_titles

ON faculty_titles.faculty_id = faculty.id

INNER JOIN faculty_education

ON faculty_education.faculty_id = faculty.id 

INNER JOIN section

ON section.faculty_id = faculty.id 

INNER JOIN class

ON class.id = section.class_id

INNER JOIN major_class_br

0 个答案:

没有答案