An Example of a Database
Before we move onto the example, we must identify the need to store data in tabular form.
One of the main reasons to store data regarding a specific object in a table is ease of understanding. So, instead of keeping relevant information regarding an object (like a student) in separate files, tables allow us to keep the important data regarding that object (like student ID, name, address, age, etc.) in one place.
A table is a collection of related data held in a table format within a database. It consists of columns and rows.
Each row in a relational database represents one instance of the type of object described in that table. A row is also called a record. While the columns in a table are the set of facts that we keep track of regarding that type of object. A column is also called an attribute.
A university database example
Let’s consider a university database that is used to maintain information concerning students, courses, and departments in a university environment. The diagram below shows the database structure and a few sample data records.
|Intro to programming