NEW
Font size
S
M
L
XL
WorksheetsGCSE J277 - Data Types and Structures Mega Quiz
Total questions: 80
Worksheet time: 40mins
Name
Class
Date
1.
Which data type would be ideal to use for a persons username
a)
Character
b)
Real
c)
String
d)
Boolean
2.
Which data type would be ideal to use for if a person has attended a lesson
a)
Character
b)
Real
c)
String
d)
Boolean
3.
Which data type would be ideal to use for storing the price of an item
a)
Integer
b)
Real
c)
String
d)
Boolean
4.
Which data type would be ideal to use for storing how many items are in stock
a)
Integer
b)
Real
c)
String
d)
Boolean
5.
Which data type would be ideal for use for storing a single data item
a)
Character
b)
Real
c)
String
d)
Boolean
6.
A character can be either a letter, number of symbol (A, 2, #)
a)
True
b)
False
7.
5.24 would be stored as
a)
Integer
b)
Real
c)
String
d)
Boolean
8.
1234 would be stored as
a)
Integer
b)
Real
c)
String
d)
Boolean
9.
TRUE would be stored as
a)
Integer
b)
Real
c)
String
d)
Boolean
10.
1234.0 would be stored as
a)
Integer
b)
Real
c)
String
d)
Boolean
11.
"John Smith" would be stored as
a)
Integer
b)
Real
c)
String
d)
Boolean
12.
123O would be stored as
a)
Integer
b)
Real
c)
String
d)
Boolean
13.
Y / N would be stored as
a)
Integer
b)
Real
c)
String
d)
Boolean
14.
What data type would be ideal for use for storing a persons age
a)
Integer
b)
Real
c)
String
d)
Boolean
15.
What data type would be ideal for storing a persons exact weight
a)
Integer
b)
Real
c)
String
d)
Boolean
16.
The Python data type for a whole number
a)
real
b)
int
c)
str
d)
chr
17.
The Python data type for a decimal number
a)
real
b)
int
c)
str
d)
chr
18.
The Python data type for concatenated outputs
a)
real
b)
int
c)
str
d)
chr
19.
The Python data type used for extracting and storing single data items
a)
real
b)
int
c)
str
d)
chr
20.
Casting is
a)
The same as a substring
b)
Converting one string to another
c)
Converting one data type to another
d)
A mathematical calculation
21.
Which of these is NOT a valid clause (part) of a SQL statement
a)
SELECT
b)
FROM
c)
WHERE
d)
TABLE
22.
What is the correct order for these keywords in a SQL statement
a)
SELECT, WHERE, FROM
b)
SELECT, FROM, WHERE
c)
FROM, WHERE, SELECT
d)
WHERE, FROM, SELECT
23.
Choosing which fields of data are retrieved is done in which part of the statement
a)
SELECT
b)
FROM
c)
WHERE
d)
ORDER BY
24.
Choosing the criteria for which data is retrieved is done in which part of the statement
a)
SELECT
b)
FROM
c)
WHERE
d)
ORDER BY
25.
Choosing the table data is extracted from is done in which part of the statement
a)
SELECT
b)
FROM
c)
WHERE
d)
ORDER BY
26.
Which of these wildcards would retrieve ALL fields (Columns) from a table
a)
!
b)
ALL
c)
*
d)
@
27.
Which of these statements would retrieve everyone with the name "Jim"
a)
SELECT * FROM users WHERE name = "Jim"
b)
SELECT * FROM users WHERE name = Jim
c)
SELECT * FROM users WHERE name == "Jim"
d)
SELECT * FROM users WHERE name == Jim
28.
If I wanted to filter data I extract, which clause would I use
a)
SELECT
b)
FROM
c)
WHERE
d)
ORDER BY
29.
Allows you to specify more than one condition on the WHERE clause
a)
Or
b)
Also
c)
And
d)
When
30.
Allows you to specify only one of a series of conditions needs to be met on the WHERE clause
a)
Or
b)
Also
c)
And
d)
When
31.
What is missing from this SQL statement: Select * People
a)
WITH
b)
WHERE
c)
FROM
d)
AND
32.
How would we write a SQL query to select "Description" from the item table
a)
SELECT Item.description
b)
EXTRACT Description FROM item
c)
SELECT item FROM Description
d)
SELECT Description FROM Item
33.
Which statement would display chairs in the Items table that have a price greater than £50
a)
SELECT * FROM Items WHERE Type = 'Chair' OR Price < 100
b)
SELECT * FROM Items WHERE Type = 'Chair' AND Price > 50
c)
SELECT * FROM Iterms WHERE Type = 'Chair' AND Price >= 50
d)
SELECT * FROM Items WHERE Price > 50
34.
How would you extract all columns from a table named "Persons"
a)
SELECT *.Persons
b)
SELECT Persons
c)
SELECT [all] FROM Persons
d)
SELECT * FROM Persons
35.
How do you select all the records from a table named "Persons" where "FirstName" is "Peter"?
a)
SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
b)
SELECT * FROM Persons WHERE FirstName='Peter'
c)
SELECT [all] FROM Persons WHERE FirstName='Peter'
d)
SELECT * FROM Persons WHERE FirstName<>'Peter'
36.
How do you select a column named "FirstName" from a table named "Persons"?
a)
EXTRACT FirstName FROM Persons
b)
SELECT Persons.FirstName
c)
SELECT FirstName FROM Persons
d)
SELECT * FROM Persons
37.
The OR operator extracts all records if any conditions listed are TRUE
a)
True
b)
False
38.
The AND operator extracts all records if any conditions listed are TRUE
a)
True
b)
False
39.
What is the purpose of *
a)
Selects ALL fields from the table
b)
Selects only the first field in the table
c)
Selects the last field in the table
d)
Shows only the first row in the table
40.
Data in databases is stored in
a)
Fields
b)
Tables
c)
Graphs
d)
Charts
41.
Arrays store related data
a)
True
b)
False
42.
It's more efficient to store data in separate variables rather than a single array
a)
True
b)
False
43.
You can access an element in an array using its index number
a)
True
b)
False
44.
What is the first index number used in an array
a)
[0]
b)
[1]
45.
Data in arrays can be different data types
a)
True
b)
False
46.
How many sets of data (rows) can be held in a 1 dimensional array
a)
0
b)
1
c)
2
d)
Multiple
47.
How many sets of data (rows) can be held in a 2 dimensional array
a)
0
b)
1
c)
2
d)
Multiple
48.
people = ["John", "Rob", "Bob"]
print (people[1])
what would this result be?
a)
John
b)
Rob
c)
Bob
49.
Which of these is the correct code for creating a list of names?
a)
nameList = John, Harry, Jesse, John, Harry, Harry
b)
nameList = ("John", "Harry", "Jesse", "John")
c)
nameList = ["John", "Harry", "Jesse", "John", "Harry"]
d)
nameList = [John, Harry, Jesse, John, Harry, Harry]
50.
index 3 of the following array: ["John", "Harry", "Jesse", "John", "Jeremy", "Tom"]
a)
John
b)
Harry
c)
Jesse
d)
Jeremy
51.
index 4 of the following array: ["John", "Harry", "Jesse", "John", "Jeremy", "Tom"]
a)
John
b)
Harry
c)
Jesse
d)
Jeremy
52.
The list needs one more name added to the end - "Felipe". Which code would do this?
a)
nameList.append(Felipe)
b)
append(nameList,"Felipe")
c)
nameList.append["Felipe",7]
d)
nameList.append("Felipe")
53.
Which symbols are used to open and close an array?
a)
( )
b)
{ }
c)
[ ]
d)
" "
54.
Which of these assigns an array to a variable?
a)
fruit = input(["apples", "oranges", "bananas"])
b)
fruit = ["apples", "oranges", "bananas"]
c)
fruit == ["apples", "oranges", "bananas"]
d)
fruit["apples", "oranges", "bananas"]
55.
An empty list can be declared as
a)
fruitList = ""
b)
fruitList = ["empty"]
c)
fruitList == []
d)
fruitList = []
56.
The first element in an array is always element 1
a)
True
b)
False
57.
Each data item in an array has the same data type
a)
True
b)
False
58.
Data items aren't found using the index number
a)
True
b)
False
59.
MyArray = [3,56,21,5,7]
print MyArray[1]
a)
3
b)
56
c)
21
d)
5
60.
MyArray = [3,56,21,5,7]
MyNumber = 11
MyArray[4] = MyNumber
a)
MyArray = [3,56,21,5,7]
b)
MyArray = [3,56,21,5,11]
c)
MyArray = [3,56,21,11,7]
d)
MyArray = [11,56,21,11,7]
61.
Text files are an effective way of storing records
a)
True
b)
False
62.
SQL is an effective way of storing records
a)
True
b)
False
63.
Small records can easily be loaded and stored in arrays
a)
True
b)
False
64.
Records only contain 1 field
a)
True
b)
False
65.
Each field in a record can have its own data type
a)
True
b)
False
66.
A field in a table is a variable
a)
True
b)
False
67.
We can't mix data types used in records
a)
True
b)
False
68.
Fields in records need a data type declaring
a)
True
b)
False
69.
Records can contain multiple fields
a)
True
b)
False
70.
Records stored in text files are stored in RAM
a)
True
b)
False
71.
Records stored in arrays and lists are stored in RAM
a)
True
b)
False
72.
Binary searches can be used to search records
a)
True
b)
False
73.
Linear searches can be used to search records
a)
True
b)
False
74.
Records stored in databases are often on remote servers
a)
True
b)
False
75.
Records stored in text files are stored in Secondary Storage
a)
True
b)
False
76.
Records stored in arrays and lists are stored in Secondary Storage
a)
True
b)
False
77.
Records stored in text files are more secure than remote databases
a)
True
b)
False
78.
An attribute is one item of data
a)
True
b)
False
79.
SQL can't be used to retrieve data from records
a)
True
b)
False
80.
* is a wildcard and would extract all fields in a record
a)
True
b)
False
Reset
