Foreign Key (2 marks)
Describe the role of a foreign key in a relational database.
Foreign Key (2 marks) Read More »
Describe the role of a foreign key in a relational database.
Foreign Key (2 marks) Read More »
A database named LibraryBooks contains a table Books that has the following columns: BookID, Title, Author, and YearPublished. Write an SQL query to retrieve the titles of all books that were published after the year 2000.
SQL Query 1. (3 marks) Read More »
Consider a database with a table named Customers that includes the columns CustomerID, FirstName, LastName, and City. Write an SQL query to find the full names of all customers who live in ‘London’.
SQL Query 2. (3 marks) Read More »
A table named Orders contains the columns OrderID, CustomerID, OrderDate, and Amount. Describe how you would write an SQL query to display the OrderID and Amount for all orders placed in the month of December, 2021, where the order amount was over £500. Include an explanation of your SQL command.
SQL Query 3. (5 marks) Read More »