(1). What is a Database or Database Management System (DBMS)?
Twist: What is the difference between a file and a database? Can files qualify as a database?
Note: Probably these questions are too basic for experienced SQL SERVER guys. But from a fresher’s point of view, it can be a difference between getting a job and being jobless.
- Database provides a systematic and organized way of storing, managing and retrieving from a collection of logically related information.
- Secondly, the information has to be persistent, that means even after the application is closed the information should be persisted.
- Finally, it should provide an independent way of accessing data and should not be dependent on the application to access the information.
Okay, let me spend a few more sentences on explaining the third aspect. Below is a simple figure of a text file that has personal detail information. The first column of the information is
Address and finally
Phone Number. This is a simple text file, which was designed by a programmer for a specific application.
It works fine in the boundary of the application. Now, some years down the line a third party application has to be integrated with this file. In order for the third party application to be integrated properly, it has the following options:
- Use the interface of the original application.
- Understand the complete details of how the text file is organized, example the first column is
Phone Number. After analyzing, write a code which can read the file, parse it etc. Hmm, lot of work, right.
That’s what the main difference is between a simple file and a database; database has an independent way (SQL) of accessing information while simple files do not (That answers my twisted question defined above). File meets the storing, managing and retrieving part of a database, but not the independent way of accessing data.
Note: Many experienced programmers think that the main difference is that file cannot provide multi-user capabilities which a DBMS provides. But if you look at some old COBOL and C programs where files were the only means of storing data, you can see functionalities like locking, multi-user etc. provided very efficiently. So it’s a matter of debate. If some interviewers think of this as a main difference between files and database, accept it… going in to debate means probably losing a job.
(Just a note for fresher’s: Multi-user capabilities mean that at one moment of time more than one user should be able to add, update, view and delete data. All DBMS’ provides this as in-built functionalities, but if you are storing information in files, it’s up to the application to write logic to achieve these functionalities).
(2). What is the Difference between DBMS and RDBMS?
As mentioned before, DBMS provides a systematic and organized way of storing, managing and retrieving from a collection of logically related information. RDBMS also provides what DBMS provides, but above that, it provides relationship integrity. So in short, we can say:
RDBMS = DBMS + REFERENTIAL INTEGRITY
For example, in the above Figure, every person should have an
Address. This is a referential integrity between
Address. If we break this referential integrity in DBMS and files, it will not complain, but RDBMS will not allow you to save this data if you have defined the relation integrity between person and addresses. These relations are defined by using “Foreign Keys” in any RDBMS.
Many DBMS companies claimed that their DBMS product was RDBMS compliant, but according to industry rules and regulations, if the DBMS fulfills the twelve CODD rules, it’s truly a RDBMS. Almost all DBMS (SQL SERVER, ORACLE etc.) fulfill all the twelve CODD rules and are considered truly as RDBMS.
Note: One of the biggest debates is whether Microsoft Access is an RDBMS? We will be answering this question in later section.