本文介绍了查询的关系代数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请考虑以下关系数据库方案:

Consider the following relational database schemes:

COURSES (Cno,name)
PRE-REQ(Cno, pre-Cno)
COMPLETED (student_no, Cno)

课程提供数字和名称所有可用的课程。

COURSES gives the number and name of all the available courses.

PRE-REQ提供有关哪些课程是给定课程的前提条件的信息。

PRE-REQ gives the information about which courses are pre-requisites for a given course.

COMPLETED表示学生完成了哪些课程

COMPLETED indicates what courses have been completed by students

使用关系代数表达以下内容:

Express the following using relational algebra:

列表学生_no = 2310的学生已完成所有课程的所有先决条件。

List all the courses for which a student with student_no = 2310 has completed all the pre-requisites.

该问题可以通过SQL查询解决,但无法导出等效的关系代数。

the question can be solved by SQL query but unable to derive equivalent relational algebra.

推荐答案

这可能是正确的答案

Π(PRE-REQ)-Π(PRE-REQ-(已完成⋈ PRE-REQ) )

Π(PRE-REQ) - Π( PRE-REQ - (COMPLETED ⋈ PRE-REQ ))

这篇关于查询的关系代数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 01:57