Introduction to Databases

Sql tutorial · PySpark.in

Introduction to Databases: Understanding the Foundation of Modern Applications

Before we dive into learning SQL, it’s important to understand one fundamental concept — what exactly is a database and why do we need it?

What is a Database?

A database is an organized collection of data stored electronically. 

But what does that actually mean? Let's break it down with a real-world example.

Introduction to Databases - Tutorial Image

Understanding Databases Through Real-World Examples:

Imagine you're using a social media website or application on your computer or phone.

When you first sign up, the app presents you with a form asking for information like your:

You submit this information, but where does it all go?

The answer is a database.

Every website and web application needs a place to store user data securely and reliably. That storage location is the database. This is the core of what happens in the back-end when you submit any form online.

And it's not just about sign-up data. Every interaction you have—liking a post, sharing a photo, or updating your profile—is recorded in the database.

Key Takeaway: A database is where all your information is stored in an organized, electronic manner. It doesn't just hold data for one user, but for all the users of the application.

How is Data Stored in a Database?

Now that we know why we need a database, let's look at how it stores information.

Data in a database is stored in the form of tables.

Let's go back to our social media example. When you create a profile for a user named "John," the information from the sign-up form is sent to the database and saved in a table.

A database table is a combination of rows and columns, much like a spreadsheet.

IDNameAgeAddress
1John28123 Main Street
2Ram39125 Main Street

When new information arrives, the database adds it to the next available row.

Introduction to Databases - Tutorial Image

Multiple Tables in a Database:

A typical application uses multiple tables to organize different kinds of information.

For an e-commerce website, you might have separate tables for:

Each table is designed to store a specific type of data efficiently.

More Sql tutorials

All tutorials · Try the free PySpark compiler · Practice challenges