title: How to have multiple words contained in a search
body: <p>I'm trying to make a search bar that continually narrows down rows in my database depending on the string used. I want to be able to have my search contain multiple words and have each word search different column.</p>
  
  <p>example.db</p>
  
  <pre><code>Make      Model      Year
  ------    ------     ------
  Toyota    Corolla    2000
  Toyota    Corolla    2002
  Toyota    Camry      2000
  Toyota    Camry      2002
  Honda     Civic      2002
  </code></pre>
  
  <p>This is what I have so far...</p>
  
  <pre><code>@app.route("/search")
  def search():
      q = request.args.get("q") #q is a string containing make, model, and/or year 
  
      car = db.execute("SELECT * FROM places WHERE Make LIKE :q\
                                                OR Model LIKE :q\
                                                OR Year LIKE :q, q=q+"%")
  </code></pre>
  
  <p>Right now, this works if I only search for one column. If I have /search?q=corolla, it will select the two rows with model corolla. If I have /search?q=toyota+corolla, it will select no rows, since no single column has toyota corolla.</p>
  
  <p>I want to make it so that the more information I enter into q, the narrower my search results would be<br>
  ie.</p>
  
  <ol>
  <li>/search?q=toyota returns 4 rows</li>
  <li>/search?q=toyota+corolla returns 2 rows</li>
  <li>/search?q=toyota+corolla+2000 returns 1 row</li>
  </ol>
  
  <p>I've been googling around for a while, but I can't seem to word my question correctly. So far, I've tried splitting the string by spaces and querying for each word, but that was just the same as searching them individually. I also tried adding a wild card in front of q, but that didn't solve the problem of having multiple words in the search at all. I'm completely stumped on what feels to be something simple. The input will always be in the order of make, model, year if that matters. Any help appreciated.</p>