Menu

SQL

Card 1 of 23 0 got it 0 still learning
Question
TapClick or press space to see the answer
Answer
All 23 cards in this set
What is meant by a database?
A structured, organised collection of data that is stored so that it can be searched quickly
Which term describes one row of a table, holding all the data about a single item?
Record
Which term describes a search of a database table that states which fields to show and which records to include?
Query
What is meant by the asterisk symbol when it is written after SELECT?
It shows every field of each record that is returned
Which SQL command names the table that the data is to be taken from?
FROM
What is meant by WHERE in an SQL query?
It gives the condition that each record must meet to be included in the result
Which SQL keyword is followed by the list of fields that are to be shown?
SELECT
In a database, which term describes one set of records about a single kind of thing, held in rows and columns?
A table
In a database table, what is a column such as Title or Price called?
A field
What does a SQL query do to the table it searches?
It returns the matching records and leaves the table unchanged
Which three keywords are used to write a SQL query?
SELECT, FROM and WHERE
The table Games has the fields Title, Genre, Price and AgeRating and holds the records shown. Which titles are returned by the query SELECT Title FROM Games WHERE Genre <> 'Racing'?
Castle Siege, Farm Life and Shadow Quest
Which query returns the titles of the games that are rated 3 and cost more than 15?
SELECT Title FROM Games WHERE AgeRating = 3 AND Price > 15
The table Games has the fields Title, Genre, Price and AgeRating and holds the records shown. Which titles are returned by the query SELECT Title FROM Games WHERE Genre = 'Racing' OR Price > 30?
Space Race, Speed Kart, Castle Siege and Shadow Quest
Which query returns the title of every game that is rated 12 or over?
SELECT Title FROM Games WHERE AgeRating >= 12
Which WHERE condition correctly searches for records where the genre is Strategy?
WHERE Genre = 'Strategy'
What does the query SELECT Title FROM Games return?
The title of every record in the Games table
The table Games has the fields Title, Genre, Price and AgeRating and holds the records shown. Which records does SELECT Title, Price FROM Games WHERE Price < 25 return?
The title and price of Space Race, Speed Kart and Farm Life
Which WHERE condition returns the games that cost 20 or less, including any game that costs exactly 20?
WHERE Price <= 20
Which WHERE condition correctly searches for games that have an age rating of 12?
WHERE AgeRating = 12
The Games table has the fields GameID, Title, Genre, Price and AgeRating. A query is written as SELECT Title FROM Games WHERE Genres = 'Racing'. Why does the query not work?
The field name Genres is not the name of a field in the table
The query SELECT Title FROM Games WHERE Genre = 'Racing' AND Price < 20 returns the racing games that cost less than 20. Which change would make the query return more games?
Using OR instead of AND
Which query returns the title and price of every game that is rated 3?
SELECT Title, Price FROM Games WHERE AgeRating = 3