title: select data from table where name = list?
body: <p>Let's say I have a table names like this :</p>
  
  <pre><code>cust_id    cust_name
     1         John
     2         Mary
     3         Pete
  </code></pre>
  
  <p>and I create a list of customers and orders in python like this :</p>
  
  <pre><code>{'Pete','pen','Mary','apple','Pete','pencil','John','shirt','John','watch','Mary','sandal'}
  </code></pre>
  
  <p>how do I get the <code>cust_id</code> from the table above where the name is like on the list so that a new table will be like this?</p>
  
  <pre><code>id_order    cust_id    orders  
     1           3        pen
     2           2       apple
     3           3       pencil
     4           1       shirt
     5           1       watch
     6           2       sandal
  </code></pre>
  
  <p>so the main point of my question how do i select <code>cust_id</code> in the order of my python customer list? and insert them to a new table of order above?</p>