Sign in or start a free trial to avail of this feature.
6. Introduction to Databases
The remaining lessons of this course discuss databases in some detail. This lesson introduces the concept of a database and discusses the key points that we’ll explain in the remaining lessons.
The goal of this lesson is to explore important concepts relating to databases.
What is a Database?
A database is any organized collection of data. More specifically, we generally think of a database as a collection of data tables. Many databases are relational databases, where the data tables are connected through having some data in common.
Traditionally, getting data from a database involved writing a query. A query is a function that you can use to search for information of interest. Queries are written in a database query language, such as the Structured Query Language, known as SQL. More recently, however, you can analyze a database through an application like Tableau or Power BI, without needing to write any queries of your own.
Overview of Database Concepts
Several important database concepts will be covered in the remaining lessons of this course, including the following:
- A database is made up of tables. Each table stores information on a different aspect of the database, such as customers, stores, products etc.
- All data stored in a database must have a type.
- Database tables can be combined together by joining them.
You can create a database diagram that helps you understand the layout of the database
In the remaining lessons of this course we'll look at databases. Storing data in a structured format will often mean storing it in a database, especially as the amount of data you have grows larger and larger. In this lesson we'll explore important database concepts. In further lessons we'll expand on these concepts and explain them in greater detail. First, let's answer the question, what is a database? The definition of a database is actually fairly broad. A database is any organized collection of data. Therefore we could say that a single Excel spreadsheet is a database if it's organized in a structured way.
In reality, however, people don't tend to think of Excel spreadsheets as being databases. When we think of a database we generally think of a collection of tables. These tables are stored electronically and the information in them can be easily accessed or manipulated. Many databases in use today are relational databases where the different tables are connected to each other through having some data in common.
To get data from a database you would traditionally write a query. A query is a function that can help you search for information of interest. Using a query, you could ask for all the customers in the database from a specific location or all the products with sales about a particular level. Queries are written in a database query language.
The most popular of these languages is the Structured Query Language known as SQL or sequel. However, more recently it's become possible to do much of this database analysis without the use of a query language.
Instead, users import the data into an application like Tableau or Power BI and perform the analysis there. This has been one of the big reasons for growth in self-service business intelligence in recent years. Let's run through some of the important properties and characteristics of databases. All databases are made up of tables. Each table stores information on a different aspect of the database, like customers, stores, products, et cetera.
One notable difference between data stored in Excel and data stored in a database is that all data in a database must have a type.
If you've used Excel, you may know that you can give cells a particular format such as currency or percentages.
However, you're not obliged to do this. Data types are somewhat like the cell format except they're required instead of optional. We'll discuss this in more detail later in this course. On some occasions you may find that you want to combine two tables in a database together, perhaps because you feel their information would be better in a single table. Joining tables can be a complicated subject primarily because there are many types of joins available. We'll explain the different join types and see how they work in lesson nine. Finally, we'll see how to create a diagram of your database. When your database contains a large number of tables a picture can be very useful in understanding the layout. It can help you see what tables are present, what data is stored in each table and how the tables are all related to each other. We'll learn about some important conventions to consider when creating a database diagram. We've now introduced the concept of databases and we're ready to start learning about them in more detail. We'll start this in the next lesson by explaining database tables.