In SQL, which keyword is used in conjunction with SELECT to return only unique values from a column?
AQA A Level · Computer Science 7517
Structured Query Language (SQL): Practice Questions
5 multiple-choice questions marked as you go, and 5 written questions with worked solutions. All on Structured Query Language (SQL).
Consider the following SQL query:
SELECT ProductName
FROM Products
WHERE Price BETWEEN 10 AND 20;
What is the result of this query?
A database contains two tables: Student (StudentID, Name) and Enrollment (EnrollmentID, StudentID, Course).
Which query correctly retrieves the names of students enrolled in the 'Computer Science' course?
Which SQL command is used to add a new record to a table in a relational database?
Which of the following SQL statements correctly changes the 'City' value to 'London' for all records in the 'Customers' table where the 'ID' is 5?
State the SQL command used to remove all records from a table named LogData where the status is 'expired'.
Write your answer out first, then check it against the worked solution.
In SQL, what is the purpose of the LIKE operator, and which wildcard character is used to represent zero or more characters?
Write your answer out first, then check it against the worked solution.
In SQL, what is the specific difference between using a primary key and a foreign key when establishing relationships between two tables?
Write your answer out first, then check it against the worked solution.
Write a SQL query to retrieve the FirstName and LastName of all students from a table named Students who scored more than 80 marks in a subject called 'Computer Science'. Assume the Students table is linked to a Grades table via StudentID.
Write your answer out first, then check it against the worked solution.
A developer needs to define a new table Project using SQL. The table must include:
- ProjectID: An integer that serves as the primary key.
- ProjectName: A string up to 50 characters, which cannot be null.
- StartDate: A date field.
- Budget: A decimal value representing currency.
Write the SQL DDL (Data Definition Language) command to create this table.
Write your answer out first, then check it against the worked solution.
* The content provided by thinka is generated by AI and may not always be accurate or up-to-date. Please use it as a supplementary resource and verify with official materials.
You've seen the model answer. Now get yours marked.
This page can show you how a good answer looks. It cannot tell you what your answer was missing. thinka marks your written work against the real mark scheme in about 15 seconds.
Want more questions like these? Get a fresh set on this topic, graded as you go.
Practice More