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....

  • 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.

  • 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...

  • The following SQL query returns one row per surgeon. The granularity before GROUP BY is a surgeon-panel combination, in...

    The following SQL query returns one row per surgeon. The granularity before GROUP BY is a surgeon-panel combination, in other words, for each surgeon, one panel they performed in. Surgeons can only be listed once per panel, but a log can have more than one panel. SELECT staff.STAFF_NM_WID "surgeon", COUNT( orl.LOG_ID ) "Number of Logs" FROM OR_LOG orl INNER JOIN V_LOG_STAFF staff ON orl.LOG_ID = staff.LOG_ID INNER JOIN OR_LOG_ALL_PROCS procs ON orl.LOG_ID = procs.LOG_ID AND procs.LINE = 1 --First Listed...

  • consider the following relational database that records details of parts and suppliers. Primary keys are underlined...

    consider the following relational database that records details of parts and suppliers. Primary keys are underlined and the Foreign Keys are identified with (FK). Suppliers (sid, sname, address, credit) Parts (pid, pname, color) Catalog (sid (FK), pid (FK), cost) The credit attribute denotes the size of the supplier’s credit account. The Catalog relation lists the prices charged for parts by Suppliers. Which of the following queries returns the snames of suppliers who supply every part? Select one or more: a....

  • Intro to database systems: Q7. Formulate the following SQL query in relational algebra using an efficient...

    Intro to database systems: Q7. Formulate the following SQL query in relational algebra using an efficient way. The schema is given in the following. Emp(eno, ename, title, city) Proj(pno, pname, budget, city) Works(eno, pno, since) SELECT ename FROM Works , Emp WHERE Works.pno = ‘P150’ AND Works.eno = Emp.eno

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