title: Intersection of Two Tables in SQL
body: <p>Basically I need to create a new table that uses specific information from two other tables.</p>
  
  <p>For example, I have a table called person with the elements person_id, first_name, last_name, gender, age, and fav_quote. I have a second table called department with the elements dept_id, dept_name, and building. I now need to create and intersection table with the person_id and dept_id elements included. And both must be the primary key (which I assume just means PRIMARY KEY (person_id, dept_id) command in my source).</p>
  
  <blockquote>
    <p>CREATE TABLE person (</p>
    
    <p>person_id INT(8) NOT NULL auto_increment,</p>
    
    <p>first_name VARCHAR(25) NOT NULL,</p>
    
    <p>last_name VARCHAR(25) NOT NULL,</p>
    
    <p>gender VARCHAR(1),</p>
    
    <p>age INT(8),</p>
    
    <p>fav_quote TEXT,</p>
    
    <p>PRIMARY KEY (person_id)</p>
    
    <p>);</p>
    
    <p>CREATE TABLE department (</p>
    
    <p>dept_id INT(8) NOT NULL auto_increment,</p>
    
    <p>dept_name VARCHAR(25) NOT NULL,</p>
    
    <p>building VARCHAR(25) NOT NULL,</p>
    
    <p>PRIMARY KEY (dept_id)</p>
    
    <p>);</p>
  </blockquote>
  
  <p>That is the code I have for the initial two tables I'm just not sure how to create an intersection and, having gone back over my notes, I can't find the instructions on how to write it. </p>