levo

Programming Fundamentals

Arrays, records and SQL

  • 3 things to know
  • J277/02
Start revising · £5/month

Overview

One- and two-dimensional arrays indexed from zero, records and fields, and SELECT, FROM and WHERE queries on a small table with worked results.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What does each of SELECT, FROM and WHERE do in an SQL query?

Key term

What is an array?

Key term

Why is an array described as a static, fixed-length data structure?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is an array?

    Model answer

    An array is a data structure that holds several items of the same data type under one name. Each item is reached by its index.

  2. 2

    Why is an array described as a static, fixed-length data structure?

    Model answer

    An array's size is set when it is declared and cannot change while the program runs. The programmer must decide the number of elements in advance.

  3. 3

    How many elements does array teams[6] create, and what are its first and last indexes?

    Model answer

    The declaration creates 6 elements. The indexes run from 0 to 5 because arrays are indexed from 0.

  4. 4

    After array scores = [12, 7, 19, 4], what is scores[2]?

    Model answer

    The value of scores[2] is 19. Index 0 holds 12, so index 2 is the third item.

  5. 5

    After array scores = [12, 7, 19, 4], what does scores[0] = scores[1] + scores[3] do?

    Model answer

    The line stores 11 in scores[0]. The values 7 and 4 are added, and the result replaces the 12.

  6. 6

    What is a two-dimensional (2D) array?

    Model answer

    A 2D array stores data in a grid of rows and columns. Each element is reached by two indexes, such as board[1, 0].

Other ways to work this

The same content, four other ways.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Systems Architecture
Memory and Storage
Computer Networks, Connections and Protocols
Network Security

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

A bit is the unit of data.
smallestlargestmain

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

Integer means a whole number with no fractional part.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Programming Fundamentals, on a schedule.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.