What Is a Database? Tables, Rows and Columns
Where computers keep information tidy, safe and easy to find
- explain what a database is and why it is useful,
- name the three building blocks: table, row and column,
- say why databases beat spreadsheets and loose files,
- describe what a DBMS is and name a few (MySQL, PostgreSQL, SQLite),
- explain how SQL is the language we use to talk to a database.
1. What is a database?
Think about your school. Someone has to remember the name of every student, which class they are in, and how old they are. If there are 500 students, keeping all of that in your head is impossible. You need a place to store the facts and a fast way to find them again.
A database is exactly that place. It is an organised collection of information (we call the pieces of information data) that lives inside a computer. Because it is organised, the computer can answer questions like "Which students are in grade 7?" in the blink of an eye.
An everyday picture: imagine a huge library. Books are not thrown in a pile on the floor - they sit on labelled shelves, sorted so you can walk straight to the one you want. A database is the library for a computer's information: everything has a place, and a place for everything.
2. Tables, rows and columns
The most common kind of database is the relational database. It stores data in tables. A table looks like a grid on squared paper:
- A table holds one kind of thing. A
studentstable holds students; abookstable holds books. - A column is one piece of information that every item has - for students that might be name, grade or city. Columns run up and down.
- A row (also called a record) is one single item - one whole student, with a value in every column. Rows run left to right.
- A cell is where one row meets one column: a single value, such as the name "Aida".
A handy way to remember it: columns are the kinds of facts, and each row is one thing that has all of those facts filled in.