Question

Transcribe the following SQL queries into an equivalent relational algebra expression. 1. SELECT s_number , AVG(...

Transcribe the following SQL queries into an equivalent relational algebra expression.

1.

SELECT s_number , AVG( grade )
FROM grades
GROUP BY s_number
HAVING AVG( grade ) > 5 . 5 ;

2.

SELECT SUM( volume )
FROM fertilizer_applications
LEFT JOIN crop_field
ON fertilizer_applications . crop_field_id = crop_field . id
GROUP BY field_number
HAVING field_number = 3 ;

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

SELECT s_number , AVG( grade )
FROM grades
GROUP BY s_number
HAVING AVG( grade ) > 5 . 5 ;

============================================================================================

πs_number,AVG(grade) σAVG(grade)>5.5 γs_number,AVG(grade) (grades)

============================================================================================

2.

SELECT SUM( volume )
FROM fertilizer_applications
LEFT JOIN crop_field
ON fertilizer_applications . crop_field_id = crop_field . id
GROUP BY field_number
HAVING field_number = 3 ;

============================================================================================

πSUM(volume) σfield_number=3 γfield_number,SUM(volume) σcrop_field⟕fertilizer_applications.crop_field_id=crop_filed.idfertilizer_applications(fertilizer_applications)

Add a comment
Know the answer?
Add Answer to:
Transcribe the following SQL queries into an equivalent relational algebra expression. 1. SELECT s_number , AVG(...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT