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 ;
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)
Transcribe the following SQL queries into an equivalent relational algebra expression. 1. SELECT s_number , AVG(...
Express the following SQL queries in relational algebra: 1) What are the dates of the concert of Lionel Richie at the Bell Center? SELECT date FROM Concert C, Show S, Hall H WHERE C.show_id = S.show_id AND S.hall_id = H.hall_id AND S.singer = 'Lionel Richie' AND H.name = ‘Bell Center’
Express the following SQL queries in relational algebra: 2) What are the singers who have never scheduled the concert at Saint-Denis 2? SELECT singer FROM Show WHERE singer NOT IN (SELECT singer FROM Show S, Hall H WHERE S.hall_id = H.hall_id AND H.name = 'Saint-Denis 2')
What is the relational algebra expression for the following SQL statement? Retrieve all the video tapes that have been rented by the customers with ID 101 and 106
This is Relational Algebra NOT SQL!!! I need the following 3 queries written in relational algebra. Retrieve the title of all the Movies in Japanese that don't have any comment. (The language_id for Japanese is 3) Find all the movie titles where an actor called “TOM” OR an actor called “BEN" acted, AND there was another actor called “MARY” acting too. Find the actors that have movies in all the categories. (category IDs are numbered 1-16) actor actor_id number first_name...
Consider following relational database schema and translate the queries ‘a’ and ‘b’ into relational algebra expressions Teacher(ID, Name, Designation, Phone, Address) Course(CourseCode, CourseName, CreditHour) Taught(TeacherID, CourseCode, Semester) a. SELECT Name, Address FROM Teacher, Taught WHERE Teacher.ID=Taught.TeacherID and CourseCode=’IT344’ b. SELECT CourseName FROM Course, Taught WHERE Course.CourseCode=Taught.CourseCode and TeacherID=200
Using Microsoft SQL Server 2 2020-05-29 Describe how SQL queries work USE Adventure Works2012 example no 1 USE Adventure Works2012 GO SELECT AVG(TotalDue) as AVG_TotalDue FROM [Sales) (SalesOrder Header) example no 2 SELECT SalesOrderID Order Date. TotalDue st Name AS TerritoryName. SELECT AVG(TotalDue) FROM (Sales) (SalesOrder Header) ) AS AVG_TotalDue FROM [Sales) (SalesOrderHeader) soh inner join (Sales] [Sales Territory) st ON soh TerritoryID = st.TerritoryID WHERE st Country RegionCode="GB' and Order Date between '2004-06-01' and '2012-06-30 and TotalDue > SELECT...
Subject : computer science -web development Qus: using the database tables below write the SQL queries: ( SELECT; FORM; WHERE; ORDER BY; DISTINCT; GROUP BY; COUNT(); SUM(); AVG(); MAX(); MIN(); JOIN; ON) Student (StudentId, Major, GPA) Transcript( Studentid, CourseNo, Gread); Course( CourseNo, Title, Credits) Display the title of the course(s) that are 3 credits? Display the average GPA of the students Majoring in ‘CSC’ List non duplicated major(s) of students who have received a grades of ‘A’ in CSC350 List...
Give the following queries in the relational algebra using the following relational schema: Student (sid, name, age, address, email, cgpa) enrolledIn (sid, modulecode, grade) module (modulecode, modulename, credits, lecturername) a) What are the names of students enrolled in module code “cs3020”? b) Give the module code of all the modules that are taught by the teacher named “Altaf”? c) Who teaches the module with code”cs1500”? d) Give the name of all the teachers teaching the student with id”12f6778”.
Which of the following is TRUE? SELECT is the SQL equivalent of Projection (Pi) in Relational Algebra Transactions and ACID compliance are only beneficial when there are multiple concurrent users of a database A data warehouse star schema is always in third normal form Use of a search index can only reduce cost of an SQL query when there is a ‘where’ clause as part of this query.
5.10 Express each of the following queries in relational algebra and (ii) SQL using the Student Registration System schema of Figure 3.4. a. List all courses that are taught by professors who belong to the EE or MGT departments. Exercises 189 b. List the names of all students who took courses both in spring 1997 and fall 1998 38 CHAPTER 3 The Relational Data Model FIGURE 3.4 Fragment of the Student Registration database schema STUDENT (Id:INTEGER, Name:STRING, Address:STRING, Statu PROFESSOR...