SQL Flashcards
What does SQL stand for?
Structured Query Language.
Which function is used to fetch an item from a database?
SELECT
Which function is used to insert data into a database?
INSERT
Which function is used to edit/modify existing data in a database?
UPDATE
Which function is used to delete data from a database?
DELETE
Which function is used to create a new data table?
CREATE TABLE
Which function is used to delete a data table?
DROP
(a) Using SQL write a command to fetch a CustomerID from Customers, where the BookingDate is 12/7/22 in Bookings.
(b) Sort these into descending order.
SELECT BookingID FROM Bookings
WHERE SELECT CustomerID = (SELECT CustomerID FROM Bookings WHERE BookingDate = “12/7/22”)
ORDER BY CustomerID DESC
Using SQL write a command to insert new values into a table called ‘Students’.
INSERT INTO Students
(StudentID, StudentName, DOB, Gender, Postcode)
VALUES
(“ST9”, “Adam”, “29/01/2001”, “M”, “OX69TG”)