Question

How to write this query in Formal Relational Query Languages? SELECT M.Name, M.Email FROM Manager AS...

How to write this query in Formal Relational Query Languages?

SELECT M.Name, M.Email
FROM Manager AS M, ManagerCertificate AS MC
WHERE M.ID = MC.ManagerID
GROUP BY M.Name
HAVING count distinct (MC.CertificateID) = 2;

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

RESULT1 ← Manager ⨝ ID= ManagerID ManagerCertificate


RESULT2 ← π Manager.Name, Manager.Email(Manager.NameCount Distinct(CertificateID=2)(RESULT1))

Frist we have performed a  Join operation on  Manager and ManagerCertificate and stored it into a temporary table named RESULT1.

From the RESULT1 we are performing Project operation with a group by functiion which is represented by ℑ in relational algebra

<grouping attributes><function list> (R)

Add a comment
Know the answer?
Add Answer to:
How to write this query in Formal Relational Query Languages? SELECT M.Name, M.Email FROM Manager AS...
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
  • Problem 3 [40 points, Formal Query Languages]| Consider the following relational schema to represent information about...

    Problem 3 [40 points, Formal Query Languages]| Consider the following relational schema to represent information about suppliers S, parts P, and projects J, S#, P#, and J# are primary keys for S, P, and J respectively. For a tuple of SPJ, a particular supplier supplies a specific part to a specific project in the specified quantity S(S#, SNAME, STATUS, CITY) P(P#, PNAME, COLOR, WEIGHT, CITY) J(J#, JNAME,CITY) SPJ(S# P# J#, QTY) Write queries for the following requests in specified languages....

  • Please clear and direct answer Consider the following SQL query and related relations          SELECT P.Name FROM...

    Please clear and direct answer Consider the following SQL query and related relations          SELECT P.Name FROM Players P, Games G WHERE P.Id = G.PlayerId      AND P.Game = 'Football' AND G.Season ='2019' where: Players (Id, Name, Game) Games (PlayerId, GameCode, Season) Translate the above SQL query to a relational algebra expression. Draw the Query tree for above relational algebra expression in part (a).

  • 1 - Which of the following allows you to create subtotals in the output from a...

    1 - Which of the following allows you to create subtotals in the output from a SELECT statement? Group of answer choices _ SUBTOTAL _ ORDER BY _ HAVING _ GROUP BY 2 - A query includes grouping done using the AVG, SUM, COUNT, MIN, or MAX function. Which SQL keyword is used to select rows after this grouping has been done? Group of answer choices _ WHERE _ DISTINCT _ HAVING _ LIKE 3 - Which of the following...

  • 1- Consider the following SQL query and related relations          SELECT P.Name FROM Players P, Games G...

    1- Consider the following SQL query and related relations          SELECT P.Name FROM Players P, Games G WHERE P.Id = G.PlayerId AND P.Game = 'Football' AND G.Season ='2019' where: Players (Id, Name, Game) Games (PlayerId, GameCode, Season) A- Translate the above SQL query to a relational algebra expression. B- Draw the Query tree for above relational algebra expression in part (a). Note: Please no screenshot

  • MYSQL Applied Database I just want to make sure that the syntax looks okay for my...

    MYSQL Applied Database I just want to make sure that the syntax looks okay for my database SQL statements, any help would be much appreciated: 1.A query that asks for customer star review for Tony Stark on Opportunity Detail. SELECT CONCAT (employee_first_name,' ',employee_last_name) AS                            employee_name, review_star_count, FROM customer_reviews, JOIN e employees ON employee_id =employee_id, WHERE employee_id=4 AND opportunity_id=1; 2.A query that shows how many orders Additional Dot Twain License, in an order totaling over $900. SELECT product_name, COUNT(o.OrderID) AS...

  • 1. For each query, there are one or more things to do. Some of these queries...

    1. For each query, there are one or more things to do. Some of these queries use SQL constructs we haven't covered in class but that you should be able to figure out the meaning of. a. SELECT C.custid, C.companyname FROM Sales.Customers AS C LEFT OUTER JOIN Sales.Orders as O ON C.custid = O.custid WHERE O.orderid IS NULL Provide the result set generated by this query. One of the result rows should be (22, Customer DTDMN). What does this tell...

  • 2. Specify the query using relational algebra Retrieve the name (first name, last name) of the...

    2. Specify the query using relational algebra Retrieve the name (first name, last name) of the employee who is either a manager or a supervisor. *Don't just copy and paste from another chegg post.

  • Please turn this join statement into a Sub-query. Select avg(baseball.sellingprice) as AverageSellingPrice, Suppliers.SupplierName From baseball, Suppliers...

    Please turn this join statement into a Sub-query. Select avg(baseball.sellingprice) as AverageSellingPrice, Suppliers.SupplierName From baseball, Suppliers where baseball.suppliercode = suppliers.suppliercode group by Suppliers.suppliername Having suppliers.suppliername = "logo goods"; Thank you

  • 1. Select the correctly written query. SELECT ALL FROM CUSTOMERS WHERE 10243 IS CUSTOMERID PULL *...

    1. Select the correctly written query. SELECT ALL FROM CUSTOMERS WHERE 10243 IS CUSTOMERID PULL * FROM CUSTOMERS WHERE CUSTOMERID = 10243 GET LIST FROM CUSTOMERS SELECT * FROM CUSTOMERS WHERE CUSTOMERID = 10243 2. The GROUP BY clause can be used in place of a JOIN clause in a SQL query? True False 3. The number of join conditions is always equal to the number of tables being joined _____ one. Plus Divided by Times Minus

  • How do I combine these 2 queries to produce something like this QUERY 1 SELECT hotel.country,...

    How do I combine these 2 queries to produce something like this QUERY 1 SELECT hotel.country, time.year, time.month, COUNT(booking.room_id) as booked FROM booking LEFT JOIN room on room.room_id = booking.room_id LEFT JOIN hotel on room.hotel_id = hotel.hotel_id LEFT JOIN time on booking.time_id = time.time_id GROUP BY hotel.country, time.year, time.month ORDER by hotel.country, time.year, time.month QUERY 2 SELECT hotel.country, time.year, time.month, COUNT(checkout.room_id) as checkedout FROM checkout LEFT JOIN room on room.room_id = checkout.room_id LEFT JOIN hotel on room.hotel_id = hotel.hotel_id LEFT...

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