Based on below criteria to write a relational algebra query: To be allowed to po
ID: 3834841 • Letter: B
Question
Based on below criteria to write a relational algebra query:
To be allowed to post articles, a user must register to become a poster after they have created an account. At that time they will also need to specify whether or not they work for a news publishing company and if so, which one. They also need to provide the starting date of their work at the current news publishing company. A poster cannot work for more than one publishing company. The datetime when a user becomes a poster will also be recorded.
Write the relational algebra query for:
List the article id, user id, post date, and title of articles that have been posted by posters working for a publisher. ( only users who are working for a publisher and are allowed to post.)
Explanation / Answer
USERS -- table name
user_id,user_name,working_type,company_name,start_date -- columns
ARTICALS -- table name
artical_id,user_id,title,post_date -- columns
R1 working_type="PUBLISHER" (USERS) -- selecting publisher type user from users
R2 user_id (R1) -- projecting user_id from R1
result user_id,artical_id,title,post_date (ARTICALS) (R2)
hope this helps. if in case of doubt, don't hesitate to comment here.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.