我目前正在使用 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