Skip to content
Home » Blog » Database – Structure and examples

Database – Structure and examples

Need a refresher on what databases are and why we need them? Here we go!

Databases are used to track and store large amounts of information.

How is data organized and stored in databases?

Data is organized from smallest to largest sets of data into  fields ⇒  records ⇒ tables.

  • Fields are the smallest unit of information and store single items of data. Multiple fields are grouped together form a a record. Examples – name, date of birth or telephone number.
  • Records are a complete set of information about one thing or person, made up of multiple fields. Example – one student’s school record.
  • Tables are a collection of related records grouped together. Example – a school database.

What are primary keys?

A primary key is data that is unique to each record in a database or file. This prevents other records from having the same value and ensures the record is unique.

For example, there may be 3 students with the name “John Doe” in a school. The first and last names wouldn’t be a good primary key to separate them out.  An unique number like an automatic Student ID (like s512221) can be set as the primary key field in the database. That way, each student can be uniquely identified in the database.

How about some real-life examples?

1. Simple Address Book Database

If you were to organize your address book into a database, here is how it would look:

  • Database and table – Since this is a simple example, your entire address book would be the database, and there would be a single table in it called ‘Address Book’ or ‘Contact List’. This table would have as many records as you have friends and acquaintances in your address book.
  • Record – Each person listed in your address book is one record – so, your business partner Elon Musk is a record, while your personal friend Warren Buffet would be another record. Each record will have multiple fields.
  • Field – Each field has single pieces of data about each person in your address book. So, Elon Musk’s address, city, zip code, email address, website, office phone number, home phone number, and mobile phone number, are all individual fields.

2. School Management Database

In a slightly more complex example, here is how a simplified school management database would look:

  • Database  – Multiple tables in one large database called ‘School Management DB’.
  • Table – Multiple tables like StudentContact data, TeacherData, TeacherPayroll, StudentRegistration, StudentGrades, LibraryBookRecords, etc.
  • Record – Each table would have defined records. Examples – a single record in the StudentContact table would have name, address, parents’ names, telephone number, DOB, and other information. A single record in TeacherPayroll would have teacher salary information, banking information, number of days worked, etc.
  • Field – Each field would then hold single pieces of data about each student or teacher.

While these are some popular and widely used database examples, there are many, many more. Keep following our blog for more great articles!

Latest posts by Aniruddha Pochimcherla (see all)