访问关系 table 是什么意思?

What does it mean by accessing a relational table?

所以我有一个关系 table:

BOOK(bNum, bName, bPubDate, bSubject, bCost)

和索引

ID(bPubDate, bSubject, bCost)

我的任务是执行 SQL 语句,该语句将按以下方式使用索引:

Execution of SELECT statement must traverse the index vertically and it must not access a relational table BOOK.

令我困惑的是声明“不得访问关系table BOOK”。

这是否意味着如果我要 select 某些不在索引中的内容,它将访问关系 table?

例如

SELECT bName FROM BOOK;

这是否也意味着如果我要 select 索引的一部分,它将不会访问关系 table?

例如

SELECT bPubDate, bSubject, bCost FROM BOOK;

希望有人能为我澄清这一点。谢谢。

Does that mean that if i were to select something that is not in the index, it will be accessing the relational table?

是的,没错。

Does it also mean that if i were to select something that is part of the index, it will not be accessing the relational table?

e.g.

SELECT bPubDate, bSubject, bCost FROM BOOK;

是的,您提供的示例查询应该可以满足问题。如果你想确保你也“垂直遍历索引”,你可能想要 ORDER BY 索引中的列:

SELECT bPubDate, bSubject, bCost FROM BOOK ORDER BY bPubDate, bSubject, bCost

虽然我怀疑 ORDER BY 是不必要的,结果无论如何都会按那个顺序结束。