SQLite Queries

studied byStudied by 1 person
0.0(0)
Get a hint
Hint

The Table name is Albums and the column name is Title. Write a query that shows the names of all albums.

1 / 18

flashcard set

Earn XP

Description and Tags

19 Terms

1

The Table name is Albums and the column name is Title. Write a query that shows the names of all albums.

SELECT Title

FROM Albums;

New cards
2

The Table name is Albums and the column name is Title. Write a query that shows the names of all Albums in Ascending Alphabetical Order.

SELECT Title

FROM Albums

ORDER BY Title ASC;

New cards
3

Write a query that shows all Albums by the artist with ArtistId = 58, assuming you have an Albums table that contains the columns Title

SELECT Title

FROM Albums

WHERE ArtistId = 58;

New cards
4

Write a query that shows all Customers who live in Canada from the Country column in the Customers table.

SELECT *

FROM Customers

WHERE Country = 'Canada';

New cards
5

Write a query that shows all Customers who live in Canada from the Country column in the Customers table. Order By LastName and Lascending Alphabetical Order

SELECT *

FROM Customers

WHERE Country = 'Canada'

ORDER BY LastName ASC;

New cards
6

Write a query that shows the FristName and LastName of all Customers who come from the Company "Microsoft Corporation", assuming the Customers table has the Column Company

SELECT FirstName, LastName

FROM Customers

WHERE Company = 'Microsoft Corporation';

New cards
7

Write a query that shows the FirstName and LastName of all Customers who do not have a Company (where the Company field is NULL)

SELECT FirstName, LastName

FROM Customers

WHERE Company IS NULL;

New cards
8

Write a query that shows the FirstName and LastName from the table Customers who live in either Sweden or Spain

SELECT FirstName, LastName

FROM Customers

WHERE Country IN ('Sweden', 'Spain');

New cards
9

Write a query that shows all the Customers from the USA that dont have Fax (where the Fax field is NULL)

SELECT *

FROM Customers

WHERE Country = 'USA' AND Fax IS NULL;

New cards
10

Write a query that shows all the Customers from the Country USA that have Fax (where the Fax field is not NULL)

SELECT *

FROM Customers

WHERE Country = 'USA' AND Fax IS NOT NULL;

New cards
11

Write a query that shows all the Customers from the Country USA in the City California that have Fax (where the Fax field is not NULL)

SELECT * FROM Customers

WHERE Country = 'USA' AND City = 'California' AND Fax IS NOT NULL;

New cards
12

Write a query that shows all the Email addresses from the Customers Table that end with "com"

SELECT Email

FROM Customers

WHERE Email LIKE '%.com';

New cards
13

Write a query that shows all the Email addresses from the Customers table that start with jack or stan

SELECT Email

FROM Customers

WHERE Email LIKE 'jack%' OR Email LIKE 'stan%';

New cards
14

Write a query that shows all the Email addresses from the Customers table that contain the word murray

SELECT Email

FROM Customers

WHERE Email LIKE '%murray%';

New cards
15

Write a query that shows the FirstName and LastName from the Customers table who have a PostalCode that starts with 6, 7, 8, or 9. Use LIKE

SELECT FirstName, LastName

FROM Customers

WHERE PostalCode LIKE '6%'

OR PostalCode LIKE '7%'

OR PostalCode LIKE '8%'

OR PostalCode LIKE '9%';

New cards
16

Write a query that shows the FirstName, LastName, City and PostalCode from the table Customers that live in Copenhagen

SELECT FirstName, LastName, City , PostalCode

FROM Customers

WHERE City = 'Copenhagen';

New cards
17

Write a query that shows the FirstName, LastName, City and PostalCode from the table Customers that live in Copenhagen and Paris

SELECT FirstName, LastName, City, PostalCode

FROM Customers

WHERE City = 'Copenhagen'

OR City = 'Paris';

New cards
18

The Table name is Tracks and the column name is Name. Write a query that shows all Tracks, Name that dose not have a UnitPrice of 0.99

SELECT Name

FROM Tracks

WHERE UnitPrice != 0.99;

New cards
19

The Table name is Tracks and the column name is Name. Write a query that shows all Tracks whose Name start with the word Go.

SELECT Name

FROM Tracks

WHERE Name LIKE 'Go%'

New cards

Explore top notes

note Note
studied byStudied by 4 people
... ago
5.0(1)
note Note
studied byStudied by 21 people
... ago
5.0(1)
note Note
studied byStudied by 21 people
... ago
5.0(1)
note Note
studied byStudied by 1 person
... ago
5.0(1)
note Note
studied byStudied by 6 people
... ago
5.0(1)
note Note
studied byStudied by 31 people
... ago
5.0(1)
note Note
studied byStudied by 6 people
... ago
5.0(1)
note Note
studied byStudied by 674 people
... ago
5.0(4)

Explore top flashcards

flashcards Flashcard (63)
studied byStudied by 22 people
... ago
5.0(1)
flashcards Flashcard (85)
studied byStudied by 14 people
... ago
5.0(1)
flashcards Flashcard (183)
studied byStudied by 7 people
... ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (34)
studied byStudied by 21 people
... ago
5.0(1)
flashcards Flashcard (58)
studied byStudied by 17 people
... ago
5.0(1)
flashcards Flashcard (58)
studied byStudied by 12 people
... ago
5.0(2)
flashcards Flashcard (76)
studied byStudied by 452 people
... ago
5.0(7)
robot