HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Databases and SQL
  2. /Computer Science
  3. /Database Tables, Data Types and Primary Keys
Chapter 9 · Part 1 of 3Databases and SQL
Next part: SQL Queries: SELECT, WHERE and ORDER BY →
High School (9–10)Algorithms, Programming and Logic › Databases and SQLFree course

Database Tables, Data Types and Primary Keys

A class register has a row for each student and a column for each detail, such as the name or the date of birth.

  • That is a database table.
  • You learn to define a table from what has to be stored, to name its fields and records, to choose a data type for each field and to pick a primary key.
  • You also see how validation stops wrong data from getting into the table.

3 lessons, about 1 h 15 min3 simulations10 problems3 practice questionsPython in every lesson

StemPy LabCreated by StemPy Lab

Free

Every lesson is open to read. Enroll to keep your place in the course. No payment needed.

This course includes

  • 3 lessons, about 1 h 15 min
  • 3 simulations with sliders
  • 3 practice questions with new numbers each time
  • 3 Python programs to run
  • 10 problems with worked solutions
  • 2 Python labs
1 question set
  • 1 revision note
  • 1 test
  • Log in to save

    Course outline (3 lessons)

    1. 1
      Lesson 1about 25 min

      Tables, fields and records

      A database table stores data about many things of one kind, such as the members of a club. Each row is a record and each column is a field. You learn these words, count records and fields, and define a single-table database from a list of what has to be stored.

      1 simulation1 practice question1 Python program3 problems
      Read the lesson
    2. 2
      Lesson 2about 25 min

      Data types and the primary key

      Each field stores one kind of data, so each field gets a data type: text, character, Boolean, integer, real or date/time. Each table also needs a primary key, a field whose value is different in every record. You choose suitable data types and pick a suitable primary key for a table.

      1 simulation1 practice question1 Python program4 problems1 Python lab
      Read the lesson
    3. 3
      Lesson 3about 25 min

      Validation in a database table

      A database is only useful if its data is sensible. Validation is a check that the computer makes on data before it goes into a table. You choose suitable checks for each field: range, length, type, presence, format and check digit, and you write validation in Python before a record is added.

      1 simulation1 practice question1 Python program3 problems1 Python lab1 question set1 note
      Read the lesson

    Test Your Learning

    Database Tables and Keys: Practice Paper
    IGCSE format15 questions · 20 min
    Not started

    Your teacher

    StemPy LabStemPy Lab

    1 follower

    Loading…

    ← All Courses
    ← PreviousSQL Queries: SELECT, WHERE and ORDER BY →
    More onAlgorithms, Programming and Logic › Databases and SQL

    Discussion (0)

    Log in to join the discussion.

    Loading…