Imagine you are the principal of a school with 1,000 students. How would you keep records of their names, ages, classes, examination scores and school fees?
You could write everything in a notebook or Excel spreadsheet. But what happens when the school has 10,000 students? Finding information could become difficult.
This is where databases and SQL become useful. In this module, you will learn what databases are, how they work and how SQL helps people find and analyse information.
By the end of this module, you should be able to:
Data means facts or information collected about people, places, things or activities.
Examples of data include:
When data is properly organised, it becomes easier to understand and use for making decisions.
A database is an organised collection of information that can be stored, accessed, managed and updated using a computer.
Think about a school database. It may contain information about students, teachers, examination results and school fees.
Example: A School Students Database
| Student ID | Name | Age | Class |
|---|---|---|---|
| 101 | John | 13 | JSS 2 |
| 102 | Amina | 12 | JSS 1 |
| 103 | David | 14 | JSS 3 |
| 104 | Grace | 13 | JSS 2 |
The table above stores information about students. A school can have many tables inside one database.
A database table looks similar to a spreadsheet in Microsoft Excel. It organises information into rows and columns.
A table is where related information is stored. For example, a school database may have a Students table, Teachers table and Results table.
A row contains information about one particular record. For example, one row may contain all the details of one student.
A column stores one type of information about different records. Examples include Name, Age, Class and Student ID.
Remember:
SQL means Structured Query Language. It is a language used to communicate with relational databases.
Imagine a school principal wants to find all students in JSS 2. Instead of checking every student's record manually, the principal can use an SQL command to request that information.
SQL allows us to:
A Database Management System, also called a DBMS, is software that helps people create, store, organise and manage databases.
Think of a database as a filing cabinet and the DBMS as the system that helps you organise, find and manage the files inside it.
Examples of database management systems include:
SQL works by allowing you to send instructions to a database. These instructions are called queries.
For example, imagine a supermarket has a database containing information about its products.
The database may contain:
| Product ID | Product Name | Price (โฆ) |
|---|---|---|
| 1 | Rice | 85,000 |
| 2 | Beans | 45,000 |
| 3 | Vegetable Oil | 12,000 |
If you want to see all the products, you can write:
SELECT * FROM Products;
Let's understand this command:
The command asks the database to show every column and every record in the Products table.
Data analysis means examining information to discover useful facts, patterns and answers to questions.
Imagine a supermarket owner wants to know:
SQL helps the owner retrieve and organise the information needed to answer these questions.
Many professionals use SQL in their daily work, including:
SQL is useful in many industries, including:
In this module, you have learned that:
Test what you have learned by answering these questions.
Imagine you are managing a small school in Ibadan. Your school has the following student records:
| Student ID | Name | Age | Class |
|---|---|---|---|
| 201 | Samuel | 13 | JSS 2 |
| 202 | Mary | 12 | JSS 1 |
| 203 | Peter | 14 | JSS 3 |
| 204 | Esther | 13 | JSS 2 |
Complete these activities:
Congratulations! You have completed Module 1. You now understand the basic ideas behind SQL and databases. In the next module, you will learn how to set up and work with an SQL environment.
CRMNuggets โ Learn. Practice. Get Certified.