title: PL/SQL select from two tables
body: <p>Having these two tables, as an example:</p>
  
  <pre><code>CREATE TABLE DEPT(
   deptno number(2) NOT NULL,
   DNAME varchar2(13)
  );
  
  CREATE TABLE EMP(
   EMPNO number(4) NOT NULL,
   ENAME varchar2(13),
   DEPTNO NUMBER(2) NOT NULL (this is referencing DEPT (DEPTNO)
  );
  </code></pre>
  
  <p>I want to select the names of the employees that are working in the 'Accounting' and 'Sales' departments, so I would do this:</p>
  
  <pre><code>CREATE OR REPLACE VIEW EXAMPLE
  AS
  SELECT ENAME, DNAME FROM EMP, DEPT
  WHERE DNAME IN ('ACCOUNTING','SALES);
  </code></pre>
  
  <p>But I'm not sure at all this is the right way to do this. Should I be joining the ename with the dname</p>
  
  <p>where ename.dname IN ('ACCOUNTING','SALES') maybe?</p>
  
  <p>Thank you in advance</p>