What language is used to create database queries?
SQL
Reference language
JavaScript
Which of the following SQL statements could you use If you want to select the username, e-mail and postcode fields from a table named ‘users’?
SELECT users FROM username, e-mail, postcode;
SELECT username, email, postcode FROM users;
FROM users SELECT username, email, postcode;
Which of the following would be returned if this command were executed?
SELECT PupilID, Surname, Class FROM Pupil
WHERE Class = ‘1T1’;
The pupil field from the PupilID, Surname and Class tables, where the class in each table is 1T1
The value 1T1, if it appears in either the PupilID, Surname or Class fields within the pupil table
Data held in the PupilID, Surname and Class fields from the pupil table where the class field holds the value 1T1
Which SQL keyword is used to return results in a specific order?
IN ORDER
SET ORDER
ORDER BY
What would need to be added to this SQL example to sort the data by class in ascending order and merit points in descending order?
ORDER BY class ASC, merit points ASC;
ORDER BY class ASC, merit points DESC;
ORDER by merit points DESC, class ASC;
Which statement would be used to add a new record using SQL?
ADD INTO
PUT INTO
INSERT INTO
What would happen if this SQL command were used?
UPDATE Pupil
SET PastoralCareTeacher = ‘Mr Gilchrist’
WHERE PastoralCareTeacher = ‘Miss Armstrong’;
All data in the pastoral care field would be updated to now hold Mr Gilchrist, apart from fields that contain Miss Armstrong
Fields currently containing Miss Armstrong would be updated to now hold Mr Gilchrist
Fields currently containing Mr Gilchrist would be updated to now hold Miss Armstrong
What name is given to the join that would return results as part of a query where the value of a primary key in one table is equal to the value of a foreign key in another?
same-join
equi-join
exact-join