• retagged by
7,879 views
22 22 votes
Consider a relation examinee (regno, name, score), where regno is the primary key to score is a real number.

Write a relational algebra using $( \Pi, \sigma, \rho, \times)$ to find the list of names which appear more than once in examinee.

3 Answers

Best answer
30 30 votes
$\pi_{\text{exm1.name}}(σ_{(\text{exm1.regno} \neq \text{examinee.regno}) \wedge (\text{emp1.name} = \text{emp2.name}) })(ρ _{\text{exm1}}(\text{examinee}) \times  \text{examinee}) $
• edited by
1 1 vote

1) $\Pi_{name}\left ( \sigma _{count(cnt)>1}\left ( _{name}g_{count(regno)\ as \ cnt}\left ( examinee \right ) \right ) \right )$

2) $SELECT_{regno}FROM\;examinee\; HAVING\;(score>avg(score))$

$\Pi _{regno}\left ( \sigma _{score>avg(score)}\left ( examinee \right ) \right )$

3) $SELECT_{centr\_code}FROM\;examinee\;join\;appears WHERE\;(score>80)$

$\Pi _{center\_code}\left ( \sigma _{score>80}\left ( examinee\Join appears \right ) \right )$

• edited by
Position:
Show:

Related questions

90 90 votes
5 answers 5 answers
15.5k
15.5k views
Kathleen asked Sep 14, 2014
15,450 views
Suppose the adjacency relation of vertices in a graph is represented in a table Adj $(X,Y).$ Which of the following queries cannot be expressed by a relational algebra ex...
13 13 votes
4 answers 4 answers
4.4k
4.4k views
go_editor asked Feb 8, 2018
4,446 views
Consider a relation examinee (regno, name, score), where regno is the primary key to score is a real number.Write an SQL query to list the regno of examinees who have a s...
12 12 votes
3 3 answers
4.5k
4.5k views
go_editor asked Feb 8, 2018
4,527 views
Consider a relation $\text{examinee (regno, name, score)},$ where regno is the primary key to score is a real number.Suppose the relation $\text{appears (regno, centr_cod...
70 70 votes
3 answers 3 answers
13.7k
13.7k views
Kathleen asked Sep 14, 2014
13,684 views
Let r and s be two relations over the relation schemes R and S respectively, and let A be an attribute in R. The relational algebra expression $\sigma_{A=a}(r \bowtie s)...