A popular question is what is a database and in this article we will give you a high level overview of the concept with a few examples.
In the first section I will explain what is a database and what is it used for. This will be brief explanation with high level examples so if you are new to databases don't worry about understanding every bit I say (and remembering new terminology) as I will explain that in more details a bit later in this post and feel free to read it again once you read everything… suddenly things might be much clearer. I will finish this blog post by giving you better understanding of how it all works (Database + everything else)
A database as the name may suggest in the simplest form is a container storing data that people (or devices) can interact with. This container usually stores data in a structured way and it does it by creating objects (entities/tables) that represent real life objects, processes or events for instance Customer, Invoice or Meeting. Objects have properties (attributes/fields/columns) that describe it. For instance Customer object (in our customer customer is a company not an individual person) can be described by its Company Name, address line1, address line2, county, post code, country, main contact, Importance (eg important customer), and so on. Once we have the structure (object + properties) we can store data in it.
Let's take customer object (entity) that contains several attributes (properties) for instance Company name, Address (I will limit number of attributes here). Using this structure we can add new customer with its CompanyName and Address. Each customer is called an "instance" (record) of the object and should be unique and stored only once (no duplications) in the object. A very important aspect of each object is to uniquely identify each row (instance) and this is usually accomplished by creating auto generated ID (meaningless) for instance 1,2,3,4,5 (common approach)… or creating natural key (meaningful) for instance value MS01 can represent company name Microsoft UK.
I will help digest this very important information by giving you visual representation of what I said. Below I describe customer object (entity). In database real life objects (entities) are called simply tables. So our table is called Customer
If you have many objects; usually they somehow relate to each other for instance if we supply let say service to our customers then we would send them invoices for the services provided. One invoice always relates to only one customer. This is called simply relationship and there are several different types of relationships but the most common one is one-to-many relationship which means that one customer can receive many (or none) invoices. The way we "relate" unique invoice to one customer is by creating an attribute in invoice object (table) called CustomerID (PrimaryKey in Customer object…see previous explanation) and putting the relevant CustomerID in it for instance CustomerID=2 relates to "Philips" and a column that uses PrimaryKey (in our case CustomerID in table Invoice) from another table is called foreign key and by having this information we can relate invoice to customer.
On the left side we have an image of filling cabinet which is a good candidate to explain this as most of us have seen filling cabinets before and have some idea how they work. Our filling cabinet is a database (but not electronic). The top draw contains customers in alphabetic order by name and the bottom one contains invoices grouped by customer and than sorted by customer name. Each invoice contains customer name (or code) so there is relationship between invoices and customers records as each invoice has one customer name…. Below I will give you visual representation of the idea of relationships.
Databases are very common these days so I will give you some real life examples of databases which should allow you to easily find plenty of other examples on your own (once you find one on your own the rest will follow).
Examples of databases
Library Database The picture below shows simplified view of library database. We have 3 objects: Library, Student and Book and as you can see they have relationships between them.
Hospital Database The picture below shows simplified view of hospital database. We have 5 objects: Hospital, Doctor, Patient, Office Desk and Patients' Bed. I have created relationships between them but I have not described you. Are you able to describe relationships between these objects?
Sample database Can you think about a database from your every day life? Are you able to identify the objects and create relationships between them?
Well that is very easy to answer. Basically it is everything what I said above. You have entities (tables) and relationships between them so end result is relational database. Relational database design has its rules but these are outside of this post.
Database Management System (DBMS) is a software that allows to "communicate" with databases. Examples of such software are SQL Server, Oracle, MySQL and a few other ones and most of them have its own idea of the way they communicate with the database files so you won't be able to use SQL Server to communicate with MySQL database file as it is written in different format. You can think about it like a language that people communicate with. You can say a sentence in English but only people who know English will understand it. You could say the same sentence in French but only people who know French will understand it although it means the same thing.
DBMS is usually very powerful software that allows to create a database (write to disk) and manipulate the structure (tables) and data (rows/values) in tables but very often they allow you to do much more than this. Database management system will often manage security so only people who are "allowed" to see the data will have access to it , enforce rules so only allowed data can be entered, manage concurrent updates (two people trying to update the same value at the same time) and usually many other specific tasks. These tasks are performed either using DBMS User Interface (UI) or scripts written using Structure Query Language (SQL) that DBMS supports.
Normalization is a process of breaking down tables into smaller ones and soon we will publish article on Normalization process but for one you can also review three reasons for normalization.
I have explained what is a database and that represents real-life objects (entities) which are called tables. Each table can describe the object using attributes commonly known as fields/attributes. We can store data in table as rows and each row represent one instance of the object and finally we learnt that we can create relationships between different objects by creating attribute that represent primary key of another table and which is called foreign key. The second part briefly describe a few topics related to databases.
I hope that I helped you understand the basics of what a database is and gave you some extra information which you can use to learn more about it.