L2 - SQL - Queries - SELECT - UPDATE - DELETE - INSERT (Autosaved) (Autosaved)
L2 - SQL - Queries - SELECT - UPDATE - DELETE - INSERT (Autosaved) (Autosaved)
DATABASES
Objectives
• Understand what structured data is
• Use CTRL + C and CTRL + V to copy and paste it to your home drive
Basic Search Query – SELECT
SELECT Subjects.SubjectName, Subjects.SubjectTeacher
FROM Subjects
WHERE Subjects.ExamBoard = 'Edexcel'
• Adapt this query to find:
• All students who have a surname starting with the letter ‘G’
SELECT Classes.SubjectName, Classes.StudentName
FROM Classes
WHERE Classes.SubjectName = 'Business'
SELECT * -magic all symbol / wildcard
FROM Students
WHERE Students.DateofBirth < #01/01/2000#
Types of Query
• In the AQA spec you will need to demonstrate an ability to use the
following types of DB query.
• SELECT
• DELETE
• UPDATE
• INSERT
Your task
• Go into today’s Teams assignment. Read the examples for each query
type, then use them on your copy of the students database.
• Take screenshots to show the sql code you have used to execute the
query.
DELETE – removes records from database