title: How to get values from a table where value depends on another table?
body: <p>Hi everyone I'm using Oracle Database using Oracle 10g. I have 2 tables
  Car and Owns.</p>
  
  <pre><code>Create Table Car(
  "license" varchar(255) not null primary key,
  "year" varchar(255),
  "model" varchar(255)
  );
  </code></pre>
  
  <p>I inserted these values</p>
  
  <pre><code>insert into Car values('12-3000', '2012', 'Axio');
  insert into Car values('11-3000', '2008', 'Corolla');
  insert into Car values('12-4000', '2013', 'Axio');
  insert into Car values('12-5000', '2013', 'Premio');
  insert into Car values('11-5000', '2010', 'Nano');
  insert into Car values('11-6000', '2011', 'Alto');
  insert into Car values('12-6000', '2015', 'Nano Twist');
  </code></pre>
  
  <p>This is Owns table</p>
  
  <pre><code>Create Table Owns (
  "nid" varchar(20) not null,
  "license" varchar(255),
  primary key("nid", "license")
  );
  </code></pre>
  
  <p>Also i inserted those values</p>
  
  <pre><code>insert into Owns values('123451', '11-3000');
  insert into Owns values('123452', '12-4000');
  insert into Owns values('123453', '12-5000');
  insert into Owns values('123454', '11-5000');
  insert into Owns values('123455', '11-6000');
  insert into Owns values('123456', '12-6000');
  insert into Owns values('123457', '12-3000');
  </code></pre>
  
  <p>Now I need to find the national id (nid) of those person who has "Axio" models.
  How to write that query?
  It may be this kind...</p>
  
  <pre><code>select "nid" from Owns where "license" = (select "license" from Car where "model" = 'Axio');
  </code></pre>
  
  <p>Thanks in Advance.</p>