In this blog, I will be giving a basic overview of Database, DBMS, and Relational Database. So let's have a look.
What is a Database?
A database is just what the name implies a base collection of information/data in a structured manner i.e. rows and columns. A database is the backbone of any application to perform its activity. The data is organized in some manner so that the information can be easily retrieved. Some of the simple databases that you might be familiar with are the things like phonebooks or Rolodexes. Databases have become a cornerstone for an overwhelming amount of the computing environment.
If you want to keep company records, you might have a table for employees, a table for customers, and other sales records. All these tables would be combined as a database.
And If want to keep track of employees in an organization. So, employee records will have multiple attributes
like name, email Id, address, department, employee's supervisor, and payroll information, these are data about employees in the same database.
So, moving forward there are some common terms used while working with databases-
Field(Column): a single piece of information. Could be a name, or a number. In some cases, it may even be a null or an empty value.
Record (Row): a collection of related fields.A number of pieces of information that relate to the same object.
For Example- If you keep records of an employee, you might have their name, email ID, Address, etc., and each piece of the information relates back to one employee. This would be the employee's record.
Table(File): a collection of related records. If you put all the employee records together, you will have a table of employee records.
Now we will talk about Relational Database
Relational Database-A relational database is a collection of data in the form of tables that have pre-defined relations between them. Based on the information that’s found in one table you can use this link to get relevant data from another table.
The difference between a database and a relational database is in the way the tables are constructed. If you were keeping company records on a series of Excel spreadsheets, you would have just a database. You could pull information from each table, but you wouldn't have the ability to use information from one spreadsheet as a basis for asking questions about the information contained on another sheet. In a relational database, the tables are constructed so that there is a logical link between them. Based on the information that’s found in one table you can use this link to get relevant data from another table.
Let's understand this through an example,
123 A Street
432 B Street
645 C Street
So in the above table, we have information related to customers
Let's have a look at the order table now
So from the above table, if we want information about the customers we can use the Customer Number from the order table which is also the key with the name Customer ID in the Customer Table, looking at this we can find out the customer name, address, etc. So we can say that these two tables have a logical link so they are related.
Note: I have used the word keys in explaining the above example so in a relational database 'a key' is an attribute or collection of attributes that uniquely defines a row in a table. This is a fundamental rule for a good database design. So, in a relational database, we define these kinds of keys-
1) Primary Key:
The primary key is a column or combination of columns in a table with values that uniquely identify the rows in a table.
Example: In the customer table, the customer ID is a key.
2) Composite Key:
If the rows of a table can be uniquely identified by combining multiple fields then Primary key is created with multiple fields and hence is also called a Composite Key.
Example: If there is a Branch table with the Clients Name, Branch City, and Clients Phone the primary key can be created with "Clients Name" and "Branch City" because the same client has an account/relationship in different city branches.
When a primary key of a table is referenced in another table then it becomes a foreign key. The foreign key doesn't have to be unique.
For example-In, the order table "Customer Number" is the foreign key.
Data Warehouse-A data warehouse is a large collection of business data used to help an organization. This is used for the analysis of structured data from multiple sources.
Data Mart-A data mart is a form of data warehouse focused on a single subject. In the database, users can access data easily and faster because they don’t have to spend time working on more complex Dataware.
DBMS/Database Management system-A database management system is a software tool that enables users to access, manage and retrieve databases easily. The database supports multi-user environments that allow users to access and manipulate data in parallel and securely. Common features of databases are-
1)creating and adding data structures
2)Security, backup, control, and disaster recovery
DBMS Programs are Access, Microsoft SQL Server, Postgres, Oracle, FoxPro, Postgres, RBase, and Paradox.
Conclusion-In this blog I tried to give basic information about the database, relational databases, and DBMS which could help beginners understand the concept of data structure. I hope you will find this blog helpful.