SQL Flashcards
State SQL that will insert the value ‘boyhood’, ‘family’, 2014 into fields Title, Genre, year into the table Film.
Insert into Film (Title, Genre, yeaer) values (‘Boyhood’, ‘family’, 2014)
State SQL that will diusplay all fields and records froim film table.
Select * from Film
State SQL that will display film titles that start with ‘The’ from film table.
Select Title from Film where Title like ‘The%’
State SQL that will display film titles that contains ‘Will’ from film table.
Select Title from Film where Title like ‘%Will%’
State SQL that will display the Title and year of films before the year 2000.
Select Title, Year from Film where Year < 2000
State SQL that will display the title and year of films starting with ‘The’ that was before the year 2019.
Select Title, Year from Film where Title Like ‘The%’ AND year < 2019.
State SQL that will update the record in the film table whose FilmID equals 5.
UPDATE Film
SET Genre=’Comedy’, Year=2017
WHERE FilmID=5
State SQL that will Delete all records from the Film table that have a FilmID of 56
DELETE FROM Film
WHERE FilmID=56
State SQL that will Removes the Films table from the database
DROP TABLE Films;
State the SQL that allows for Selecting from more than one table (using JOIN)
SELECT
FROM
JOIN
ON.=.
EXAMPLE:
SELECT Rentals.RentalDate, Customers.CustomerSurname
FROM Rentals
JOIN Customers ON Rentals.CustomerID=Customers.CustomerID