top of page

Database Tables

Tutoring Databases > Database Tables

To represent a table in a database, we can draw a table on paper in the form of a grid with rows for entities and columns for attributes.

Problems with a table
  • You cannot have empty entries - they can be NULL, not empty.

  • You should not have any spelling errors - this would be seen as a different value by the software.

  • There can be no additional notes - the cells must hold only values.

  • The values in a column must be of the same type as the other values in the column - you cannot have "Ted" in a phone number column!

Table format
  • Each row must have the same number of cells as every other row in that table.

  • Equally, each column must have the same number of cells as every other column in that table.

Calculating statistics from table entires

To be useful, a database holds information related to it's purpose. For example, a company database might hold tables for employees, offices or suppliers or products. We can perform operations on these tables to report on statistics.

If we wanted to know how many people in the company were called "Jim" and were over the age of 30, then we query the database using a database query.

Combining tables for statistics

We need to be able to combine things from tables to report on statistics and be able to elect things from one table on the basis of information in others.

Avoid deleting something in one table that may affect another table - ensure consistency between tables.

Also avoid replication of data which may lead to data redundancy.

bottom of page