title: Oracle SQL Syntax: Column bases
body: <p>Currently I'm thinking about some artificially created SQL statements and want to know the base tables to each attributes in the statement. However there are statements where we can't determine the base table without having the table definition. As I will apply my thoughts on Oracle SQL statements I want to know if all the statements that I made up, will actually be valid Oracle SQL?</p>
  
  <p>1)</p>
  
  <pre><code>select a from table
  </code></pre>
  
  <p>attribute a belongs to table, as there is no other base table</p>
  
  <p>2)</p>
  
  <pre><code>select a from table t
  </code></pre>
  
  <p>attribute a belongs to table, as there is no other base table</p>
  
  <p>3)</p>
  
  <pre><code>select t.a from table t
  </code></pre>
  
  <p>attribute a belongs to table, according to prefix.</p>
  
  <p>4)</p>
  
  <pre><code>select a from table1, table2
  </code></pre>
  
  <p>attribute a either belongs to table1 or table2, we can't say without the table definitions</p>
  
  <p>5)</p>
  
  <pre><code>select a from table1 t1, table2
  </code></pre>
  
  <p>attribute a either belongs to table1 or table2, we can't say without the table definitions</p>
  
  <p>6)</p>
  
  <pre><code>select a from (select * from table t) s
  </code></pre>
  
  <p>attribute a belongs to table, as the subselect in the from clause only contains table. </p>
  
  <p>Best,
  Will</p>