NEW
Font size
WorksheetsHandling Data: Procedures, functions, records, SQL and Files
Total questions: 25
Worksheet time: 13mins
What is a 'procedure' in programming terms?
A subroutine that returns a value.
A subroutine that does not necessarily return a value.
A set of instructions in the style of a programming language but using plain English.
A graphical way of showing an algorithm.
What is a 'function' in programming terms?
A subroutine that returns a value.
A subroutine that does not necessarily return a value.
A set of instructions in the style of a programming language but using plain English.
A graphical way of showing an algorithm.
What is a key word that must be used in a function?
if
then
else
return
What is a parameter?
A constant value, for example Pi
A variable in a program that can be called throughout the program, for example name=str()
A variable that a subprogram needs in order to run, for example function maximum(temp1, temp2)
A variable that is only defined and usable within certain parts of a program, for example while x>0: y=x**x
What is a one-dimensional array?
A data structure that stores a fixed amount of items of one data type.
A data structure that stores items in columns.
A large data structure that stores multiple items of data about one thing.
A single piece of a data.
What is a two-dimensional array?
A data structure that stores a fixed amount of items of one data type.
A data structure that stores items in columns.
A large data structure that stores multiple items of data about one thing.
A single piece of a data.
What would be a suitable fieldname for the following data: 08/11/2003
age
DOB
Date Of Birthday
name
What is a record?
A data structure that stores a fixed amount of items of one data type.
A data structure that stores items in columns.
A large data structure that stores multiple items of data about one thing.
A single piece of a data.
What are tuples?
A list of data that is immutable ie it cannot change.
A list of data that can be changed in a program.
A variable that can be called throughout a program.
A variable that is only defined and usable within certain parts of a program.
What is the advantage of using subprograms?
They are small.
They are big.
They can be tested and used again in the future.
They cannot be tested or used again in the future.
What does File Handling mean?
Transferring files from one computer to another.
Organising files into folders and sub-folders.
Reading and writing to external files.
Reading and writing to internal files.
What does SQL stand for?
Structured Query Language
Simple Query Language
Structured Query Lists
Simple Quite Language
What does CRUD stand for?
Copy, Read, Use, Drop
Create, Read, Update, Delete
Create, Read, Use, Drop
Copy, Read, Use, Delete
What is the first command in an SQL search statement?
SELECT
FROM
WHERE
ORDER BY
Which command applies the criteria in an SQL search statement?
SELECT
FROM
WHERE
ORDER BY
What is the correct SQL statement to find all the Blue cars, using the above data?
SELECT * FROM TB_Cars WHERE "Blue"
SELECT * FROM TB_Cars WHERE COLOUR = "Blue"
SELECT "Blue" FROM TB_Cars WHERE COLOUR = "Blue"
SELECT * FROM TB_Cars WHERE MODEL = "Blue"
What is the correct SQL statement to find all the Ford cars, using the above data?
SELECT * FROM TB_Cars WHERE MODEL = "Ford"
SELECT MAKE FROM TB_Cars WHERE * = "Ford"
SELECT * FROM TB_Cars WHERE MAKE = "Ford"
SELECT * FROM MAKE WHERE "Ford"
What is the correct SQL statement to find all the cars and order them alphabetically on MAKE, using the above data?
SELECT * FROM TB_Cars ORDER BY MAKE;
SELECT MAKE FROM TB_Cars;
SELECT * FROM TB_Cars ORDER BY MODEL;
SELECT MODEL FROM TB_Cars ORDER BY MAKE;
What is the output from this one-dimensional array?
x=[2,4,5,7,9]
print (x[3])
0
3
5
7
What is the correct output from this two-dimensional array?
print myArray([1], [1])
9.00
37.5
12.00
37.1
Which is the correct command to add information to a text file?
myFile.open("textfile.txt")
myFile.close()
myFile.read()
myFile.write("This is a line of text.")
Which is the correct command to open a text file?
myFile.open("textfile.txt")
myFile.close()
myFile.read()
myFile.write("This is a line of text.")
Which is the correct command to close a text file?
myFile.open("textfile.txt")
myFile.close()
myFile.read()
myFile.write("This is a line of text.")
Which is the correct command to read a text file?
myFile.open("textfile.txt")
myFile.close()
myFile.read()
myFile.write("This is a line of text.")
What is the best practice with File Handling?
Never close the file.
Only close the file at the end of the program.
Always close the file after you have finished using it.
Sometimes close the file.
