2.2.10

Structuring Data

Test yourself

Records

Structured data refers to any data that resides in a fixed field within a record or file so that it can be easily entered, stored, queried, and analysed.

Illustrative background for RecordsIllustrative background for Records ?? "content

Records

  • Records are made up of fields.
  • For example, a person could be represented as a record where the fields include their name, age, and address.
Illustrative background for Comma separated values (CSV)Illustrative background for Comma separated values (CSV) ?? "content

Comma separated values (CSV)

  • One method of storing a record is using comma separated values.
  • Each record is put on its own line.
  • Each field is separated by a special character such as a comma.
Illustrative background for Pros and consIllustrative background for Pros and cons ?? "content

Pros and cons

  • Pros:
    • Very simple, text-based format.
    • Can be read by many applications.
    • Easy to use in programs.
  • Cons:
    • Inefficient for large datasets.
    • Can only store text data.
    • No built-in means of sorting or searching.

Structured Query Language

A database is a structured collection of data. Structured query language (SQL) is a language used to query this data.

Illustrative background for SQLIllustrative background for SQL ?? "content

SQL

  • SQL is a language that can tell databases what to do.
  • SQL can be used for selecting, inserting, updating, and deleting data.
  • For GCSE you only need to know how to select (search for) data.
Illustrative background for Select statementsIllustrative background for Select statements ?? "content

Select statements

  • A SELECT statement searches for and returns data. E.g:
    • SELECT * FROM table_name;
  • The * character tells the database to return all fields.
  • The * character can be replaced by specific fields. E.g:
    • SELECT name FROM users;
Illustrative background for Where clauseIllustrative background for Where clause ?? "content

Where clause

  • Sometimes we don't want to return data for all records.
  • We can filter the data using a where clause as follows:
    • SELECT * FROM users WHERE ID=3;
  • The above line would only return a user's data where they have an ID of 3.
Illustrative background for WildcardsIllustrative background for Wildcards ?? "content

Wildcards

  • Sometimes we don't know the exact value we want to use in a where clause.
  • We can use wildcards to find records which match some sort of pattern.
  • We can use the % symbol to represent anything. For example, if we want to find any names starting with 'Ba' then we could query:
    • SELECT name FROM users WHERE name LIKE "Ba%";

Jump to other topics

1Computer Systems

1.1Systems Architecture

1.2Memory & Storage

1.3Computer Networks, Connections & Protocols

1.4Network Security

1.5Systems Software

1.6Ethical, Legal, Cultural & Environmental Concern

2Computational Thinking, Algorithms and Programming

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson