title: I am trying fetch data from sqlit3 database and haveing this ambiguous column name problem, I don't see any issue, need an explanation
body: <p>I am Trying to fetch the list of movies where two people are star in the same movies here is the table format:</p>
  <pre><code>CREATE TABLE people (
                  id INTEGER,
                  name TEXT NOT NULL,
                  birth NUMERIC,
                  PRIMARY KEY(id)
              );
  CREATE TABLE stars (
                  movie_id INTEGER NOT NULL,
                  person_id INTEGER NOT NULL,
                  FOREIGN KEY(movie_id) REFERENCES movies(id),
                  FOREIGN KEY(person_id) REFERENCES people(id)
              );
  CREATE TABLE movies (
                      id INTEGER,
                      title TEXT NOT NULL,
                      year NUMERIC,
                      PRIMARY KEY(id)
                  );
  </code></pre>
  <p>Query:
  Running the below query is giving me ambiguous column name: movie_id, i don't understand what is the issue here,</p>
  <pre><code>select movie_id from (
          (select movie_id,person_id from (
              select id from people where name = &quot;Johnny Depp&quot;) as x 
                  inner join 
                      stars on x.id = stars.person_id) as xx 
                                  
          inner join 
                                      
          (select movie_id,person_id from (
              select id from people where name = &quot;Helena Bonham Carter&quot;) as y 
                  inner join 
                      stars on y.id = stars.person_id) as yy 
                                      
          on xx.movie_id = yy.movie_id
                      ); 
  </code></pre>