SQL Flashcards
All 6 cards in this deck
In SQL, what does
SELECT *do?Retrieves all fields from the records that match the query.
In SQL, what does the
FROMcommand specify?Which table the data is retrieved from.
In SQL, what does the
WHEREcommand do?e.g.
WHERE Year = 11Filters the records so only those meeting the condition are returned — only records whose Year is 11.
In SQL, what does
LIKEwith the%wildcard do?e.g.
WHERE Name LIKE "S%"Matches incomplete words or patterns — returns records whose Name begins with S.
In an SQL
WHEREclause, what is the difference betweenANDandOR?ANDmeans all the conditions must be true;ORmeans at least one condition must be true.What are the steps to write an SQL query that searches for data?
e.g. the names of pupils in Year 11 from the table
Students- State the fields:
SELECT Name - State the table:
FROM Students - State the condition:
WHERE Year = 11
- State the fields: