title: MySQL: symbols in queries
body: <p>I recently noticed that there are several strange symbols used in MySQL queries that I haven't seen before. I never used them but I'm trying to understand their meaning. I haven't found any information regarding this since I don't know how they're called.</p>
  
  <p>Let's say, I have this table:</p>
  
  <pre><code>id  | city | population 
  250 | Carlisle | 75305
  </code></pre>
  
  <ol>
  <li>What is this <code>|</code>? What is the output of it?</li>
  </ol>
  
  <p><code>UPDATE cities SET population = population | 5 WHERE id = 250</code></p>
  
  <ol start="2">
  <li>Even more complex situation.</li>
  </ol>
  
  <p><code>UPDATE cities SET population = population &amp; ~2 | 6 WHERE id = 250</code></p>
  
  <ol start="3">
  <li>Query with "where" clause. What WHERE clause is this? What rows would be selected?</li>
  </ol>
  
  <p><code>SELECT * FROM cities WHERE population &amp; 2 &gt; 0</code></p>
  
  <ol start="4">
  <li>Multiple values in INSERT INTO query through PHP. What are those %s and %u values? How to know whether %s or %u should be put in query? Why should I use this instead of simple query with values put directly in VALUES area?</li>
  </ol>
  
  <p><code>sprintf("INSERT INTO cities (id, city, population) VALUES ('%s', '%u', '%s')", $id, $city, $population);</code></p>
  
  <p>Thank you for answer.</p>