9.2

SQL

Cambridge IGCSE Computer Science (0478)  · Unit 9: Databases  · 10 flashcards

SQL is topic 9.2 in the Cambridge IGCSE Computer Science (0478) syllabus , positioned in Unit 9 — Databases , alongside Database concepts.  In one line: SQL stands for Structured Query Language. It is a programming language designed for managing and manipulating data held in a relational database management system (RDBMS). Its primary purpose is to query, insert, update, and delete data.

This topic is examined in Paper 1 (computer systems theory) and Paper 2 (algorithms, programming and logic).

The deck below contains 10 flashcards — 4 definitions and 6 key concepts — covering the precise wording mark schemes reward.  Use the 4 definition cards to lock down command-word answers (define, state), then move on to the concept and application cards to handle explain, describe and compare questions.

Key definition

SQL and what is its primary purpose

SQL stands for Structured Query Language. It is a programming language designed for managing and manipulating data held in a relational database management system (RDBMS). Its primary purpose is to query, insert, update, and delete data.

Questions this SQL deck will help you answer

Definition Flip

What is SQL and what is its primary purpose?

Answer Flip

SQL stands for Structured Query Language. It is a programming language designed for managing and manipulating data held in a relational database management system (RDBMS). Its primary purpose is to query, insert, update, and delete data.

Key Concept Flip

Explain the function of the `SELECT` statement in SQL, providing an example.

Answer Flip

The `SELECT` statement retrieves data from one or more tables in a database.

Example: `SELECT student_name, student_id FROM Students;` would retrieve the name and ID from the 'Students' table.
Definition Flip

What is the purpose of the `FROM` keyword in an SQL query?

Answer Flip

The `FROM` keyword specifies the table(s) from which to retrieve data. It is essential as it tells the database where to find the data specified in the `SELECT` statement.

Key Concept Flip

Describe the function of the `WHERE` clause in SQL and give an example of its usage.

Answer Flip

The `WHERE` clause filters records based on a specified condition.

Example: `SELECT * FROM Products WHERE price > 50;` selects all products where the price is greater than 50.
Key Concept Flip

How does the `ORDER BY` clause affect the output of an SQL query? Give an example.

Answer Flip

The `ORDER BY` clause sorts the result-set in ascending or descending order.

Example: `SELECT * FROM Customers ORDER BY last_name DESC;` sorts customers by last name in descending order.
Definition Flip

Explain the difference between the `AND` and `OR` operators in a `WHERE` clause.

Answer Flip

The `AND` operator displays a record if all the conditions are true. The `OR` operator displays a record if any of the conditions are true. `AND` requires all conditions to be met, `OR` requires at least one.

Key Concept Flip

What is the purpose of the `INSERT` statement in SQL? Give an example.

Answer Flip

The `INSERT` statement adds new rows of data into a table.

Example: `INSERT INTO Employees (employee_id, first_name, last_name) VALUES (101, 'John', 'Doe');` inserts a new employee.
Key Concept Flip

Describe the functionality of the `UPDATE` statement in SQL and give an example.

Answer Flip

The `UPDATE` statement modifies existing records in a table.

Example: `UPDATE Products SET price = 60 WHERE product_id = 5;` updates the price of product with ID 5 to 60.
Key Concept Flip

Explain how the `DELETE` statement is used in SQL and provide an example.

Answer Flip

The `DELETE` statement removes existing records from a table.

Example: `DELETE FROM Customers WHERE customer_id = 123;` deletes the customer with ID 123.
Definition Flip

What is the purpose of the `CREATE TABLE` statement in SQL?

Answer Flip

The `CREATE TABLE` statement creates a new table in the database. It defines the table name and the structure of its columns (name, data type, constraints).

Test yourself

Practice with MCQ questions to check your understanding.

Take Computer Science Quiz
9.1 Database concepts 10.1 Boolean logic

Key Questions: SQL

What is SQL and what is its primary purpose?

SQL stands for Structured Query Language. It is a programming language designed for managing and manipulating data held in a relational database management system (RDBMS). Its primary purpose is to query, insert, update, and delete data.

What is the purpose of the `FROM` keyword in an SQL query?

The `FROM` keyword specifies the table(s) from which to retrieve data. It is essential as it tells the database where to find the data specified in the `SELECT` statement.

Explain the difference between the `AND` and `OR` operators in a `WHERE` clause.

The `AND` operator displays a record if all the conditions are true. The `OR` operator displays a record if any of the conditions are true. `AND` requires all conditions to be met, `OR` requires at least one.

What is the purpose of the `CREATE TABLE` statement in SQL?

The `CREATE TABLE` statement creates a new table in the database. It defines the table name and the structure of its columns (name, data type, constraints).

Tips to avoid common mistakes in SQL

More topics in Unit 9 — Databases

SQL sits alongside these Computer Science decks in the same syllabus unit. Each uses the same spaced-repetition system, so progress in one informs the next.

Cambridge syllabus keywords to use in your answers

These are the official Cambridge 0478 terms tagged to this section. Mark schemes credit responses that use the exact term — weave them into your answers verbatim rather than paraphrasing.

SQL SELECT FROM WHERE ORDER BY AND OR INSERT UPDATE DELETE CREATE query

Key terms covered in this SQL deck

Every term below is defined in the flashcards above. Use the list as a quick recall test before your exam — if you can't define one of these in your own words, flip back to that card.

SQL and what is its primary purpose
The purpose of the `FROM` keyword in an SQL query
Explain the difference between the `AND` and `OR` operators in a `WHERE` clause
The purpose of the `CREATE TABLE` statement in SQL

How to study this SQL deck

Start in Study Mode, attempt each card before flipping, then rate Hard, Okay or Easy. Cards you rate Hard come back within a day; cards you rate Easy push out to weeks. Your progress is saved in your browser, so come back daily for 5–10 minute reviews until every card reads Mastered.