Question
WRITE RELATIONAL ALGEBRA 1-Retrieve the 3 top videos by visualization with the total of views for each video, identifying the videos by the title. select
WRITE RELATIONAL ALGEBRA
1-Retrieve the 3 top videos by visualization with the total of views for each video, identifying the videos by the title.
select v.title , count(*) total_of_views FROM video v inner join visualization z on v.id = z.video_id group by v.title order by count(*) desc limit 3;
2-Retrieve the title on the basis of the ascending order
SELECT title FROM video ORDER BY Title ASC;
3-show all the video urls whose google account owner id has birthdate <1990
SELECT url FROM video WHERE id = (select id from google_account where birthdate<'1990-01-03'::date limit (1));
4- Select users_subscriptions of the users whose payment date is less than the current date
SELECT google_account_id FROM user_subscription INNER JOIN payment_history ON user_subscription.id = payment_history.id
5-select the url of the videos whose google account owner has a birthdate lower than 1990.
SELECT url FROM video WHERE google_account_owner_id IN (select id from google_account where google_account.birthdate < '1990-01-01');
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started