title: String comparisons of case sensitive in mysql
body: <p>I have to write a query that returns the number of students whose first
  name is John in mysql but String comparisons should be case sensitive.</p>
  
  <pre><code>create TABLE students
  (id INTEGER PRIMARY KEY,
  firstName VARCHAR(30) NOT NULL,
  lastName VARCHAR(30) NOT NULL
  )
  </code></pre>
  
  <p>i tried</p>
  
  <pre><code>select count(*)
    from students 
   WHERE firstName COLLATE Latin1_General_CS_AS = 'John'
  </code></pre>
  
  <p>but it only works on sql server 2008</p>
  
  <p>i also tried </p>
  
  <pre><code>select count(*)
    from students 
   WHERE firstName COLLATE Latin1_General_CS_AS like 'John' 
  </code></pre>
  
  <p>but it does not differ in 'JOHN' and 'John'</p>
  
  <p>I have to get the answer right on website:<a href="https://www.testdome.com/d/sql-interview-questions/17" rel="nofollow noreferrer">https://www.testdome.com/d/sql-interview-questions/17</a>
  as this is my assignment.</p>