thumbnail

SQL Interview Questions

SQL Questions and Answers

1. Show first name, last name, and gender of patients whose gender is 'M'.

Question:
SELECT first_name, last_name, gender
FROM patients
WHERE gender = 'M';

2. Show first name and last name of patients who do not have allergies (NULL).

Question:
SELECT first_name, last_name
FROM patients
WHERE allergies IS NULL;

3. Show first name of patients that start with the letter 'C'.

Question:
SELECT first_name
FROM patients
WHERE first_name LIKE 'C%';

No Comments