NEW
Font size
WorksheetsProgramming Fundamentals Part 2
Total questions: 20
Worksheet time: 10mins
Which of these is the string returned by this code?
phrase = "Character"
phrase.subString(0,4)
"hara"
"cter"
"Cha"
"Char"
What would be the result of the following query on the this database table?
SELECT Name FROM Students WHERE House = "King" AND Year = "9"
["Ted","King",9,"D"]
"Ted"
"Poppy"
"Sam"
What would be the result of this SQL query on the database table shown?
SELECT * FROM Students WHERE Grade = "C" AND House= "Curie"
"Cher"
["Poppy","King",8,"C"]
"Sam"
["Sam","Curie",7,"C"]
Which data structure would be suitable for storing a single list of values such as the wind speeds measured over a week?
Table
2-dimensional array
1-dimensional array
Record
Which SQL command is used to view or query a database?
CHOOSE
FIND
SELECT
To add data to an open file from variables or data structures in memory is what file operation?
Close
Write
Open
Read
What file operation would this command initiate?
myFile = open("sample.txt")
Open
Read
Close
Write
Append
What name do we give to code that is used to query a database, it stands for Structured Query Language and includes SELECT, FROM, WHERE?
SQL
LQS
QLS
QSL
Python does not provide an array data structure, but what can we use instead?
List
Function
File
Record
What is the name for a collection of related data items called fields, often stored as a row in a database, it represents something in the real world like a person or product?
Array
Record
Field
Database
This code iterates over a 1-dimensional array called arr. What would be the output of this code?
total = 0
arr = [3,4,1]
for col = 0 to 2
total = total + arr[col]
next col
print(total)
7
9
3
2
8
What file operation does this code initiate?
myFile.writeLine("Add new line")
Write
Read
Close
Open
The file operation that loads data from an open file into a variable or data structure in memory, is called what?
Close
Write
Open
Read
Which of these shows the Exam Reference Language (ERL) code to return the contents of row 0 column 0 of a 2D array called gameboard?
gameboard(row,col) where row=0, col=0
return(gameboard, 0, 0)
gameboard(row=0, col=0)
gameboard[0, 0]
What do we call a data structure that stores many data items of the same data type, can be 1D, 2D or more?
Linked List
Array
Record
Database
Joining two strings together, usually uses the + operator, for example fullname = firstname + lastname, is called what?
Attaching
Merging
Concatenating
Adjoining
What is the name for a collection of related data saved on secondary storage, it can be plain text, CSV or a database?
Float
File
Field
Folder
What file operation connects to a file and prepares it for read or write?
Write
Open
Close
Append
What is one data item in a record, often shown as a column in a database, for example "Name" or "Age", having a single data type?
Field
Database
Record
Table
Which of these is a function in Exam Reference Language (ERL) that returns part of a string when we pass it a starting position and length?
Stringslice
Stringpart
Substring
Slice
