高效查询,表桥/索引和结构 [英] Efficient Query, Table Bridge/Indexing and strucuture

查看:103
本文介绍了高效查询,表桥/索引和结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的PhpMyAdmin数据库中,我有9个表。目前,这些表格中有8个与我相关。我希望查询能够足够快地执行,但是我不确定表的设计/结构是否最有效。有没有建议将一个表与另一个表合并或创建另一个桥表?另外,我正在努力构建一个查询,该查询将显示下表中的桥接结果:学期计划 code> office_hours 教职员工部门 major_minor major_class_br class

In my PhpMyAdmin database I have 9 tables. 8 of those tables are relevant to me at this moment. I would like my queries to be executed quickly enough but I am not sure the design/structure of the tables are the most effecient. Any suggestion of merging a table with another or creating another bridge table? Also, I am struggling in building a query that will display bridge results from the following tables: semester, schedule, office_hours, faculty, section, major_minor, major_class_br, class?

表结构

基本查询-显示班级详细信息

Basic Query- that shows class details

SELECT  class_name, class_caption, class_credit_hours, class_description
FROM class  


推荐答案

这是一个开始:

select *
from 
schedule 
inner join semester 
on schedule.semester_id = semester.id
inner join office_hours
on office_hours.id = schedule.???

尚不清楚office_hours与日程如何相关?

It's not clear how office_hours correlates with schedule?

这篇关于高效查询,表桥/索引和结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆