SQL Flashcards

1
Q

State SQL that will insert the value ‘boyhood’, ‘family’, 2014 into fields Title, Genre, year into the table Film.

A

Insert into Film (Title, Genre, yeaer) values (‘Boyhood’, ‘family’, 2014)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

State SQL that will diusplay all fields and records froim film table.

A

Select * from Film

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

State SQL that will display film titles that start with ‘The’ from film table.

A

Select Title from Film where Title like ‘The%’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

State SQL that will display film titles that contains ‘Will’ from film table.

A

Select Title from Film where Title like ‘%Will%’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

State SQL that will display the Title and year of films before the year 2000.

A

Select Title, Year from Film where Year < 2000

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

State SQL that will display the title and year of films starting with ‘The’ that was before the year 2019.

A

Select Title, Year from Film where Title Like ‘The%’ AND year < 2019.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

State SQL that will update the record in the film table whose FilmID equals 5.

A

UPDATE Film
SET Genre=’Comedy’, Year=2017
WHERE FilmID=5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

State SQL that will Delete all records from the Film table that have a FilmID of 56

A

DELETE FROM Film

WHERE FilmID=56

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

State SQL that will Removes the Films table from the database

A

DROP TABLE Films;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

State the SQL that allows for Selecting from more than one table (using JOIN)

A

SELECT
FROM
JOIN
ON.=.

EXAMPLE:
SELECT Rentals.RentalDate, Customers.CustomerSurname
FROM Rentals
JOIN Customers ON Rentals.CustomerID=Customers.CustomerID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly