Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

how would you apply the process of development to a team?

Answered: 1 week ago

Question

5. Benchmark current training practices.

Answered: 1 week ago