Skip to content

Instantly share code, notes, and snippets.

@mirzalazuardi
Created January 18, 2019 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mirzalazuardi/11a28e5c9684f5fb524bc2a603ade0a0 to your computer and use it in GitHub Desktop.
Save mirzalazuardi/11a28e5c9684f5fb524bc2a603ade0a0 to your computer and use it in GitHub Desktop.
SQL #2
-- Students
-- Given the following data definition, write a query that returns the number of students whose first name is John.
-- TABLE students
-- id INTEGER PRIMARY KEY,
-- firstName VARCHAR(30) NOT NULL,
-- lastName VARCHAR(30) NOT NULL
SELECT COUNT(*) AS numOfStudent
FROM students
WHERE firstName = 'John'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment