AQA GCSE requires you to write four SQL commands. All of them appear in Paper 2. Here's what each one does:
SELECT retrieves data from a table. There are four clauses — always written in this order, one per line:
When data comes from two tables, list both in FROM — and you must include a linking condition in WHERE to join them on their shared key field.
Member(MemberID, FirstName, LastName, DateOfBirth)
Award(AwardID, MemberID, AwardName, DatePresented)
INSERT INTO adds a new record to a table. You name the table, list the fields in brackets, then provide the matching values.
Member(MemberID, FirstName, LastName, DateOfBirth)
UPDATE changes the value of a field in existing records. It has three clauses — always in this order:
DELETE removes records from a table. It's the simplest command — just two clauses.
Student(StudentID, FirstName, LastName, YearGroup)
Loan(LoanID, StudentID, CopyID, DepositPaid)
SELECT Field1, Field2 FROM Table1, Table2 WHERE Table1.Key = Table2.Key AND Field = 'value' ORDER BY Field ASC
INSERT INTO TableName (F1, F2, F3) VALUES (123, 'text', 'date')
UPDATE TableName SET Field = NewValue WHERE IDField = value
DELETE FROM TableName WHERE Field = 'value'