0% found this document useful (0 votes)
18 views

SELECT Name, Breed, Age, Gender From Dog Where Age 1: 1 Daisy Poodle 2 F 2 Jack Labrador 5 M 3 Max Beagle 1 M

Uploaded by

kamalminha13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

SELECT Name, Breed, Age, Gender From Dog Where Age 1: 1 Daisy Poodle 2 F 2 Jack Labrador 5 M 3 Max Beagle 1 M

Uploaded by

kamalminha13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Dog_ID Name Breed Age Gender

1 Daisy Poodle 2 F
2 Jack Labrador 5 M
3 Max Beagle 1 M

1. Give the results of the query shown below. (2)

SELECT Name, Breed, Age, Gender


FROM Dog
WHERE Age > 1

2. Write a query that returns all the male dogs, showing only the Name and Breed fields. (3)

3. Write a query that returns all Labradors displayed in ascending order by Name. Show all fields. (4)

City_ID Name Population Region


LON London 8907918 London
BRM Birmingham 1153717 West Midlands
GLS Glasgow 612040 Scotland
LIV Liverpool 579256 North West

4. Give the results of the query shown below. (2)

SELECT Name, Population, Region


FROM City
WHERE Population < 1000000

Structured Query Language (SQL) Page 1 of 2 © ZigZag Education, 2018–2020


5. Write a query that returns all the cities with a population larger than 700,000, showing only the Name
and Population fields. (3)

6. Write a query that returns all cities with a population greater than 600,000, displayed in ascending
order by Name. Show all fields. (4)

7. Shown below is the design for a table called DVD. Write a query that returns all DVDs with a stock level
of 0. Show all fields. (3)D
DVD (DVD_ID, Title, Rating, Genre, Stock_Level)

8. Write a query that returns all DVDs in the family genre, with a U rating. Show all fields. (3)

9. Write a query that returns all DVDs in the action or horror genres. Show all fields. (3)

10. Write a query that returns all DVDs with a title that starts with “The”. Show all fields. (3)

11. Write a query that returns all DVDs in the horror genre with a stock level of 50 or above.
Only the Title and Stock_Level fields should be shown. (3)

Structured Query Language (SQL) Page 2 of 2 © ZigZag Education, 2018–2020

You might also like