Relational Algebra Queries for User, Post, and Comment Database
-
Find the uid of the youngest user(s). π uid (σ age = min(age)(User))
-
Find the number of posts made by each user uid. γ uid, count(pid) (Post)
-
Find the username of user who does not make any post or comment. π username (User - (π username (User ⨝ Post ⨝ Comment)))
-
Find the uid of user who comments all the posts made by username 'Alan Turing'. π uid ((π uid (User ⨝ username = 'Alan Turing'(User))) ⨝ Comment)
原文地址: https://www.cveoy.top/t/topic/o73i 著作权归作者所有。请勿转载和采集!