Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

create table movies ( movie_id integer, name varchar(1000), score integer ); create table cast ( movie_id integer, cast_id integer, cast_name varchar(1000) ); Using the tables

create table movies ( movie_id integer, name varchar(1000), score integer );

create table cast ( movie_id integer, cast_id integer, cast_name varchar(1000) );

Using the tables created above, find the movies with score > 80 and has no cast members with name David. Output format: movie_id, score.

insert into movies1 values(111, "Frozen", 90); insert into movies1 values(222, "Cars", 10); insert into movies1 values(333, "Finding Nemo", 100); insert into movies1 values(444, "Toy Story", 20); insert into cast1 values(111, 1, "David"); insert into cast1 values(111, 2, "Sarah"); insert into cast1 values(222, 3, "Jim"); insert into cast1 values(222, 4, "Brennan"); insert into cast1 values(333, 5, "Gary"); insert into cast1 values(333, 6, "Pat"); insert into cast1 values(444, 7, "Kim"); insert into cast1 values(444, 8, "Jim");

This is what I tried, yet it does prints out movie_id 111 and 333 when it should only print out movie_id 333 select distinct m.movie_id, m.score from movies1 m inner join cast1 c on c.movie_id = m.movie_id where m.score > 80 and c.cast_name not like "%David%";

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_2

Step: 3

blur-text-image_3

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

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

Explain Group discussion as a tool of communication.

Answered: 1 week ago

Question

How do you determine the load-bearing capacity of a soil?

Answered: 1 week ago

Question

what is Edward Lemieux effect / Anomeric effect ?

Answered: 1 week ago

Question

Define Management by exception

Answered: 1 week ago

Question

Explain the importance of staffing in business organisations

Answered: 1 week ago

Question

1. How did you go about making your selection?

Answered: 1 week ago