levo

Databases

Structured Query Language: creating and changing data

  • 3 things to know
  • A2 Unit 1

Overview

Structured Query Language and data definition language and data manipulation language.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What is Structured Query Language?

Numbers

Write the SQL to insert a new member.

Numbers

Write the SQL to change a member's surname.

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is Structured Query Language?

    Model answer

    Structured Query Language is the standard language for defining and manipulating data in a relational database. It is declarative: a statement says what data is wanted or what change is required, and the database management system decides how to carry it out.

  2. 2

    Write the SQL to create a table called Member with a member number, a surname and a join date.

    Model answer

    The statement is CREATE TABLE Member (MemberNo INTEGER PRIMARY KEY, Surname VARCHAR(30) NOT NULL, JoinDate DATE); which creates the table with MemberNo as its primary key and requires a surname on every row.

  3. 3

    What does the NOT NULL constraint do?

    Model answer

    NOT NULL requires a column to hold a value in every row, so a record cannot be saved with that column empty. It is used for any attribute the system must always know.

  4. 4

    Write the SQL to add a foreign key when creating a Loan table that refers to Member.

    Model answer

    Inside the CREATE TABLE statement the clause FOREIGN KEY (MemberNo) REFERENCES Member(MemberNo) is added, which makes the database enforce referential integrity on that column.

  5. 5

    Write the SQL to insert a new member.

    Model answer

    The statement is INSERT INTO Member (MemberNo, Surname, JoinDate) VALUES (1041, 'Doherty', '2026-09-01'); which adds one row, naming the columns so the values cannot be matched to the wrong ones.

  6. 6

    Write the SQL to change a member's surname.

    Model answer

    The statement is UPDATE Member SET Surname = 'Doherty' WHERE MemberNo = 1041; which changes the surname on the single row identified by that primary key value.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Systems Analysis and Development Approaches
Design, Development and Testing
Implementation and System Security
Programming

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A check requires a value.
presencerangeformat

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

ANormal data is 12, which should be accepted.
BBoundary data is 1 and 50, which should be accepted.
C0 and 51, just outside the limits, should be rejected.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

One byte is made up of 8 bits.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Databases, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.