I think it is an important distinction to say that SQL is a Programming Language. Hence, the last word of SQL being “Language”.
There are some major advantages to using traditional relational databases, which we interact with using SQL. The five most apparent are:
- SQL is easy to understand.
- Traditional databases allow us to access data directly.
- Traditional databases allow us to audit and replicate our data.
- SQL is a great tool for analysing multiple tables at once.
- SQL allows you to analyse more complex questions than dashboard tools like Google Analytics.
Why Businesses like Databases:
- Data integrity is ensured – only the data you want entered is entered, and only certain users are able to enter data into the database.
- Data can be accessed quickly – SQL allows you to obtain results very quickly from the data stored in a database. Code can be optimized to quickly pull results.
- Data is easily shared – multiple individuals can access data stored in a database, and the data is the same for all users allowing for consistent results for anyone with access to your database.
Entity Relationship Diagram (ERD):
An Entity Relationship Diagram (ERD) is a common way to view data in a database. Below is the ERD for a database called “Parch and Posey”. These diagrams help you visualize the data you are analysing including:
- The names of the tables.
- The columns in each table.
- The way the tables work together.
(You can think of each of the boxes below as a spreadsheet)
In the “Parch and Posey” database there are five tables (Essentially 5 spreadsheets):
You can think of each of these tables as an individual spreadsheet. Then the columns in each spreadsheet are listed below the table name. For example, the region table has two columns: id and name. Alternatively, the web_events table has four columns.
The “crow’s foot” that connects the tables together shows us how the columns in one table relate to the columns in another table.
SQL vs. NoSQL:
You may have heard of NoSQL, which stands for not only SQL. Databases using NoSQL allow for you to write code that interacts with the data a bit differently than what we will do in SQL. These NoSQL environments tend to be particularly popular for web-based data, but less popular for data that lives in spreadsheets the way we have been analysing data up to this point. One of the most popular NoSQL languages is called MongoDB.