From the course: Learning SQL Programming

What is a database? - SQL Tutorial

From the course: Learning SQL Programming

Start my 1-month free trial

What is a database?

- [Instructor] Before we start learning about a language used to talk to a database, we need to have an understanding of what a database is. At the most basic, a database is a collection of information. Think about a list of people, the city they live in, and their favorite color. This gives us three kinds of information, a name, a city, and a color. In a database, the individual kinds of information are organized into columns, and each set of information is organized into rows. Often, the columns are called fields, and the rows are called records. You can think of a record like a card with an individual person's information on it. The cards all have the same spaces for information. They have the same fields. But each card pertains to one person, and each one is an individual record. Together, fields and records make up a table, and one or more tables make up a database. With this kind of basic information in one table, we could use a spreadsheet like Excel to keep track of our data. But databases allow us not only to add more tables, but also to set up rules and relationships between the tables. The layout and definition of how fields, tables, and relationships are set up is called the schema of the database. Creating setups with relationships and other parameters is beyond the scope of this course, but if you want to learn more about how these relational databases work, be sure to check out Programming Foundations: Databases here on LinkedIn Learning. While the row and column arrangement of data in a table can look like a spreadsheet, it's difficult to ask some kinds of questions about this data using a spreadsheet. With a spreadsheet, we can easily say what the sum total of a row or column is or sort information alphabetically. But if we wanted to ask how many people in New York like the color purple, it gets a little bit more complicated. That's where databases become helpful, and that's why we have SQL.

Contents