⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rel-ops.txt

📁 icarnegie上数据库课程中的exercise1的答案
💻 TXT
字号:
(
	select Book.title, Book.price
	from   Book, Publisher
	where  Book.PublisherID = Publisher.PublisherID and Publisher.PublisherName = "武汉大学出版社";
)
union                                      
(
	select Book.title, BOOK.price
	from   Book, Publisher
	where  Book.PublisherID = Publisher.PublisherID and Publisher.PublisherName = "清华大学出版社";
);


说明:
这里使用了select和join的关系运算
要求查询武汉大学出版社和清华大学出版社出版的书的书名和价格
两张表以PublisherID为外码做笛卡尔积并从中选出PublisherName为武汉大学出版社和清华大学出版社的元组,
投影到属性title和price上。
再由union操作将投影的结果合并起来得到最终结果。

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -