Not a premium member yet? Save 100's of hours on lesson prep with a comprehensive library of GCSE Computer Science resources - including worksheets, tests, and PowerPoint presentations.
Download the complete GCSE Computer Science bundle including all teacher resources and student revision:
- 200+ Computer Science/ICT resources
+ any we release in the future!
- Access to all student revision notes
- OCR, AQA, Edexcel and WJEC compatible
- New 9-1 GCSE spec
A relational database is made up of different components, of which the table is most important. The database table is where all the data in a database is kept. Without tables, there would not be much need for relational databases.
In a relational database, a table puts in order the information about a single subject into rows and columns. For example, a database for a company would typically contain a table for employee information, which would store employee numbers, addresses, phone numbers, and so on as a series of columns. Every single piece of data is a field in the table. A column consists of all the entries in a single field, such as the telephone numbers of all the employees. Fields, in turn, are arranged as records, which are complete sets of information each of which contains a row. The method of normalization identifies how data will be most effectively systematized into tables.
A table is a named relational database data set that is arranged by rows and columns. The relational table is a vital relational database concept because tables are the principal form of data storage.
Columns form the table’s structure and rows form the content. Tables permit restrictions for columns but not rows. Every database table must have a distinct name. Most relational databases have naming limitations.
Relational tables keep data in columns and rows. When forming a table, columns must be described, but columns may be appended or removed after table creation. During this time, column data restrictions may or may not be defined. For example, when creating an EMPLOYEE_MASTER table for storing employee information, definitions may be added, for example, a DATE_OF_BIRTH column accepting dates only or a EMPLOYEE_NAME column that may not be null.
Table rows are the table’s actual data elements. In the EMPLOYEE_MASTER table, the rows hold each employee record. Thus, a row consists of a data element within each table column. If a row value is not entered, the value is termed “null,” which does not have the same meaning as a zero or space.
Tables have other table connections that are determined by special columns and the most influential are primary and foreign keys. For example, the EMPLOYEE_MASTER table has a EMPLOYEE_ID column that is used to uniquely identify each table employee. If another table needs to refer to a certain employee, a corresponding column that references the EMPLOYEE_MASTER table’s employee id may be inserted. Other tables do not need to store additional employee details that are already stored in the EMPLOYEE_MASTER table.
Overall Structure of a Database Table
A database consists of one or more tables. Each table is made up of rows and columns. Each row in a relational database is distinctly identified by a primary key. This can be by one or more sets of column values. In most scenarios it is a single column.
Every relational table has one primary key. Its purpose is to uniquely identify each row in the database. No rows can have matching primary key value. The practical benefit of this is that you can distinguish each row by just knowing its primary key.
- Columns – These are defined to hold a specific type of data, such as dates, numeric or textual data. It is defined by its name and data type. The name is used in SQL statements when selecting and ordering data while the data type is used to validate information stored.
- Rows – A table can contain zero or more rows. When there is zero row, it is said to be empty. There is no practical limit on the number of rows a table can hold.
The columns are giving the table its personality while the rows its substance.