660 views
1 votes
1 votes

I want to join the two tables of movies and actors and then output only those results that have gender =”F”, can you tell me where I am going wrong?

1 Answer

Best answer
1 votes
1 votes

The code syntax is correct.However,You need to analyze the Data Storage Structure for the IMDB database.

In the imdb.sql link you shared,with reference to the question

There are 412,320 movies in the movies table of the database sorted A-Z alphabatically.

 

Image link : https://drive.google.com/file/d/12rhdAbiabhvU1J4XqodEppkCy1RKCp9n/view?usp=sharing

Actors : There are 845,465 actors

Image link : https://drive.google.com/file/d/1HZDq7yAiFww5VsObs9zYbS5OMerqeraF/view?usp=sharing

But,the interesting part is ,it first displays Male in A-Z order,and then,the female actresses,however,starts from 528,787

Image Link : https://drive.google.com/file/d/1KqXcqR30IN8QtNYOQFhJO8vqqRraydsZ/view?usp=sharing

So,till the last value of m.id which is 412,320 will also have Male as Gender and so,your join returned empty set.

Image link : https://drive.google.com/file/d/1Hoh05hfAw9E_av2aV25X0-Jkqo_R5Cwp/view?usp=sharing

Hence,Your Command worked for Male Gender but not for Female.

edited by

Related questions