(SQL examples for Beginners)
In this end-to-end example, you will learn – SQL Tutorials for Business Analyst: What is Database and what is SQL?
What is Database? What is SQL?
Before we learn about a database, let us understand –
What is Data?
In simple words, data can be facts related to any object in consideration. For example, your name, age, height, weight, etc. are some data related to you. A picture, image, file, pdf, etc. can also be considered data.
What is a Database?
A database is a systematic collection of data. They support electronic storage and manipulation of data. Databases make data management easy.
Let us discuss a few examples: An online telephone directory uses a database to store data of people, phone numbers, other contact details. Your electricity service provider uses a database to manage billing, client-related issues, handle fault data, etc.
Let us also consider Facebook. It needs to store, manipulate, and present data related to members, their friends, member activities, messages, advertisements, and a lot more. We can provide a countless number of examples for the usage of databases.
What is SQL?
SQL is the standard language for dealing with Relational Databases. SQL can be used to insert, search, update, and delete database records. SQL can do lots of other operations, including optimizing and maintenance of databases. SQL stands for Structured Query language, pronounced as “S-Q-L” or sometimes as “See-Quel”… Relational databases like MySQL Database, Oracle, MS SQL Server, Sybase, etc. use ANSI SQL.
How to use SQL?
SELECT * FROM Members WHERE Age > 30
SQL syntaxes used in different databases are almost similar though few RDBMS use a few different commands and even proprietary SQL syntaxes.
What is a Database Management System (DBMS)?
Database Management System (DBMS) is a collection of programs which enables its users to access database, manipulate data, reporting and representation of data. It also helps to control access to the database. Database Management Systems are not a new concept and as such, had been first implemented in the 1960s.
Charles Bachman’s Integrated Data Store (IDS) is said to be the first DBMS in history. With time database technologies evolved a lot while usage and expected functionalities of databases have been increased immensely.
Types of DBMS
Let us see how the DBMS family got evolved with time. The following diagram shows the evolution of DBMS categories.
There are 4 major types of DBMS. Let us investigate them in detail.
- Hierarchical: This type of DBMS employs the “parent-child” relationship of storing data. This type of DBMS is rarely used nowadays. Its structure is like a tree with nodes representing records and branches representing fields. The windows registry used in Windows XP is an example of a hierarchical database. Configuration settings are stored as tree structures with nodes.
- Network DBMS: This type of DBMS supports many-to-many relations. It usually results in complex database structures. RDM Server is an example of a database management system that implements the network model.
- Relational DBMS: This type of DBMS defines database relationships in the form of tables, also known as relations. Unlike network DBMS, RDBMS does not support many to many relationships. Relational DBMS usually have pre-defined data types that they can support. It is the most popular DBMS type in the market. Examples of relational database management systems include MySQL, Oracle, and Microsoft SQL Server database.
- Object-Oriented Relation DBMS: This type supports the storage of new data types. The data to be stored is in the form of objects. The objects to be stored in the database have attributes (i.e., gender, ager) and methods that define what to do with the data. PostgreSQL is an example of an object-oriented relational DBMS.
What is NoSQL?
NoSQL is an upcoming category of Database Management Systems. Its main characteristic is its non-adherence to Relational Database Concepts. NoSQL means “Not only SQL”. The concept of NoSQL databases grew with internet giants such as Google, Facebook, Amazon etc. who deal with gigantic volumes of data.
When you use a relational database for massive volumes of data, the system starts getting slow in terms of response time. To overcome this, we could “scale up” our systems by upgrading our existing hardware. The alternative to the above problem would be to distribute our database load on multiple hosts as the load increases. This is known as “scaling out”.
NoSQL database is non-relational databases that scale-out better than relational databases and are designed with web applications in mind. They do not use SQL to query the data and do not follow strict schemas like relational models. With NoSQL, ACID (Atomicity, Consistency, Isolation, Durability) features are not guaranteed always.
Why it makes sense to learn SQL after NoSQL?
With the advantages of NoSQL databases outlined which scale-out better than relational models, you might be thinking why one would still want to learn about the SQL database? Well, NoSQL databases are highly specialized systems and have their special usage and limitations. NoSQL suit more for those who handle huge volumes of data. The vast majority use relational databases and associated tools.
Relational databases have the following advantages over NoSQL databases.
- SQL (relational) databases have a mature data storage and management model. This is crucial for enterprise users.
- SQL databases support the notion of views that allow users to only see data that they are authorized to view. The data that they are not authorized to see is kept hidden from them.
- SQL databases support stored procedure SQL which allows database developers to implement a part of the business logic into the database.
- SQL databases have better security models compared to NoSQL databases.
The world has not deviated from the use of relational databases. There is a growing demand for professionals who can handle relational databases. Thus, learning databases and SQL still holds merit.
- DBMS stands for Database Management System.
- We have four major types of DBMSs namely Hierarchical, Network, Relational, Object-Oriented
- The most widely used DBMS is the relational model that saves data in table formats. It uses SQL as the standard query language
- SQL language is used to query a database
- The database approach has many advantages when it comes to storing data compared to the traditional flat file-based systems
Disclaimer: The information and code presented within this recipe/tutorial is only for educational and coaching purposes for beginners and developers. Anyone can practice and apply the recipe/tutorial presented here, but the reader is taking full responsibility for his/her actions. The author (content curator) of this recipe (code / program) has made every effort to ensure the accuracy of the information was correct at time of publication. The author (content curator) does not assume and hereby disclaims any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from accident, negligence, or any other cause. The information presented here could also be found in public knowledge domains.
Latest end-to-end Learn by Coding Projects (Jupyter Notebooks) in Python and R:
There are 2000+ End-to-End Python & R Notebooks are available to build Professional Portfolio as a Data Scientist and/or Machine Learning Specialist. All Notebooks are only $29.95. We would like to request you to have a look at the website for FREE the end-to-end notebooks, and then decide whether you would like to purchase or not.