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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!