Photo AI

Last Updated Sep 26, 2025

SQL Simplified Revision Notes

Revision notes with simplified explanations to understand SQL quickly and effectively.

user avatar
user avatar
user avatar
user avatar
user avatar

242+ students studying

SQL

SQL (Structured Query Language) is a standard language used to manage and query databases. It allows users to retrieve, manipulate, and update data stored in relational databases. One of the most common uses of SQL is to search for data within tables.

Using SQL to Search for Data

  • SQL allows you to extract specific information from a database using queries.
  • The most basic SQL query uses the SELECT statement to choose which columns of data you want to retrieve.
  • You can refine your search by using the WHERE clause, which sets conditions for the data returned.

Key SQL Commands

SELECT

  • This command is used to specify the columns of data you want to retrieve.
  • You can select specific columns or all columns using * (which means all columns). Example:

SELECT * FROM Customers;

This will retrieve all columns from the Customers table.

FROM

  • This command specifies the table you want to retrieve the data from.
  • It follows the SELECT statement to indicate where the data is stored. Example:

SELECT ContactName, Address FROM Customers;

This retrieves only the ContactName and Address columns from the Customers table.

WHERE

  • This command is used to filter the results of a query based on specific conditions.
  • It limits the data returned by the SELECT statement, ensuring that only rows meeting the condition are displayed. Example:

SELECT ContactName, Address FROM Customers WHERE ContactName = 'Mr Smith';

This retrieves the ContactName and Address of customers where the ContactName is "Mr Smith."

SQL Operators

OperatorDescriptionExample
=Equal toWHERE City = 'London'
<> or !=Not equal toWHERE Age != 30
>Greater thanWHERE Age > 18
<Less thanWHERE Age < 65
>=Greater than or equal toWHERE Price >= 10
<=Less than or equal toWHERE Price <= 50
BETWEENUsed to search for values within a rangeWHERE Age BETWEEN 18 AND 30
LIKESearches for patterns in text fieldsWHERE ContactName LIKE 'Smi%'
INSpecify multiple values for a columnWHERE City IN ('London', 'Paris')

Boolean Operators

Boolean OperatorDescriptionExample
ANDBoth conditions must be trueWHERE Country = 'UK' AND Age >= 18
ORAt least one condition must be trueWHERE Age < 18 OR Age > 65
Parentheses ()Used to group conditions for complex queriesWHERE Country = 'England' AND (City = 'London' OR City = 'Oxford')
infoNote

Key Points to Remember

  • SELECT, FROM, and WHERE are the core SQL commands used to retrieve and filter data from a database.
  • SQL operators like =, LIKE, and IN help refine searches by setting conditions and patterns for the data you want.
  • Boolean operators (AND, OR) allow you to combine multiple conditions for more complex queries.
Books

Only available for registered users.

Sign up now to view the full note, or log in if you already have an account!

500K+ Students Use These Powerful Tools to Master SQL

Enhance your understanding with flashcards, quizzes, and exams—designed to help you grasp key concepts, reinforce learning, and master any topic with confidence!

80 flashcards

Flashcards on SQL

Revise key concepts with interactive flashcards.

Try Computer Science Flashcards

8 quizzes

Quizzes on SQL

Test your knowledge with fun and engaging quizzes.

Try Computer Science Quizzes

8 questions

Exam questions on SQL

Boost your confidence with real exam questions.

Try Computer Science Questions

1 exams created

Exam Builder on SQL

Create custom exams across topics for better practice!

Try Computer Science exam builder

13 papers

Past Papers on SQL

Practice past papers to reinforce exam experience.

Try Computer Science Past Papers

Other Revision Notes related to SQL you should explore

Discover More Revision Notes Related to SQL to Deepen Your Understanding and Improve Your Mastery

96%

114 rated

Additional Programming Techniques

String Manipulation

user avatar
user avatar
user avatar
user avatar
user avatar

421+ studying

185KViews

96%

114 rated

Additional Programming Techniques

File Handling

user avatar
user avatar
user avatar
user avatar
user avatar

407+ studying

184KViews

96%

114 rated

Additional Programming Techniques

Records to Store Data

user avatar
user avatar
user avatar
user avatar
user avatar

469+ studying

197KViews

96%

114 rated

Additional Programming Techniques

Arrays

user avatar
user avatar
user avatar
user avatar
user avatar

296+ studying

200KViews
Load more notes

Join 500,000+ GCSE students using SimpleStudy...

Join Thousands of GCSE Students Using SimpleStudy to Learn Smarter, Stay Organized, and Boost Their Grades with Confidence!

97% of Students

Report Improved Results

98% of Students

Recommend to friends

500,000+

Students Supported

50 Million+

Questions answered