Filter and Sort Patients by Allergies in SQLite

This database contains a table called patients. Your task is to write an SQL query to extract specific information from the patients table. You need to retrieve the first_name, last_name, and allergies of patients who have allergies to either 'Penicillin' or 'Morphine'.

Ordering Criteria

Your query should return results ordered in ascending order, first by allergies, then by first_name, and finally by last_name.

Concepts to Know

  • SELECT: Used to select data from a database.
  • WHERE: Used to filter records based on specific conditions.
  • IN: The IN operator allows you to specify multiple values in a WHERE clause.
  • ORDER BY: Sorts the result-set in ascending or descending order based on one or more columns.

Submit your query to complete the lab.

Adding your container request
Getting your dedicated container
Connecting to your container
Setting up your editor
Finalizing your playground
TerminalEditorBrowser