Learn database fundamentals and how PostgreSQL organizes data with databases, schemas, tables, rows, columns, and keys. Explore database management guides.
A database is an organized collection of information (data) that is stored electronically so that we can easily access, manage, update, and retrieve it.
In simple words:
A database is a place where we store information in an organized way so that we can use it whenever needed.
Consider a university that maintains information about its students.
Instead of writing student information in registers, the university stores it in a database.
| Student ID | Student Name | Department | Semester |
|---|---|---|---|
| 101 | Ali | Computer Science | 1 |
| 102 | Ahmed | Information Technology | 2 |
| 103 | Sara | Mathematics | 3 |
This information is stored in an organized structure called a table.
| [Understanding Database Table Structure: Rows, Columns, Fields, and Records | Akshita Patel posted on the topic | LinkedIn](https://images.openai.com/static-rsc-4/IGSfkiOeuXopQ8zMYSKjmYVwcUgVbaJgQoJO_QuA2qTC9lNfQyYFAIUCCq0vU2jOnzROpAXASaJLFTzc5emrpnjy5tB9N2cxvm9qbDkUq0k8_q14JMueWcpZlaAavPGc_bZWZ23f50-7G1t9i-orl_sYi6XAg-Nehpz5iW7nRWg?purpose=inline) |
Databases help us to:
Before working with PostgreSQL, students should understand its basic structure.
|  |
| Term | Meaning |
|---|---|
| Database | A collection of organized information. |
| Schema | A logical structure inside a database that organizes database objects. |
| Table | Stores information in rows and columns. |
| Row | Represents one complete record. |
| Column | Represents a particular type of information. |
| Data Type | Defines what kind of data a column can store. |
| Primary Key | Uniquely identifies each record in a table. |
| Foreign Key | Connects records between related tables. |
Consider the following table:
| student_id | name | age | department |
|---|---|---|---|
| 101 | Ali | 20 | CS |
| 102 | Ahmed | 21 | IT |
| 103 | Sara | 19 | Mathematics |
In this example:
studentsstudent_id, name, age, departmentstudent_id