A database is an organised store of information that software can search, add to and change.
This guide is for anyone who wants to know what sits behind the apps and websites they use. You do not need to code. If your business keeps customer, order or staff records in any app, those records are very likely to sit in a database.
In short
- Many databases store information in tables of rows and columns, a bit like linked spreadsheets.
- Apps ask a database for information using short requests called queries, often written in a language called SQL.
- Apps usually reach the database with their own password or token, which makes the app a non-human identity.
- Databases hold valuable data, so limit who and what can reach them, and keep their passwords out of code.
What you will learn
- Explain what tables, rows, columns and queries are.
- Describe how an app talks to its database.
- Spot why the app's database password is a valuable secret.
- Ask simple questions about who and what can reach your data.
- Grid of records (table)
- a set of rows, where every row has the same named columns.
- Question to the data (query)
- a request asking the database to find, add or change records.
- Software password (database credential)
- the password, key or token an app uses to reach the database.
What is a database?
Think of a well-organised filing cabinet. Each drawer holds one kind of record, such as customers or orders. Every card in a drawer has the same boxes to fill in.
A common kind of database, called a relational database, works much like this. It stores data in tables. Each table is a named collection of rows, and each row has the same set of named columns [1]. A customer table might have columns for name, town and phone number, with one row per customer.
To get information out, software sends a query (a request for data), often written in a language called SQL. A query names the columns wanted, the table to look in and, if needed, which rows to pick [2].
Where the comparison stops working: a filing cabinet sits in one room, and you can see who opens it. A database is often reached over a network by many apps and tools at once, each using its own password or token.
Why does it matter?
Databases often hold customer, order and staff records in one place. That makes them a prime target.
If you run a small business
What could happen: the password your app uses to reach the database is copied, and someone downloads your customer list.
Check this: ask your supplier where the database password is kept and who can see it.
If you work with AI coding tools
What could happen: an AI tool finds a powerful token and deletes live data while doing a routine task.
Check this: keep tokens with delete rights away from places AI tools can read.
Next: AI Agents for Beginners
If you are new to IT work
What could happen: a test database with real customer data is left open to the internet.
Check this: confirm that each database can only be reached from the systems that need it.
What does it look like?
Here is a made-up customer table and the settings an app might use to reach it.
Example only. All values are made up.
table: customers (1) id | name | town | phone 0001 | FAKE Person A | Exampleton | 0000 000000 0002 | FAKE Person B | Sampleville | 0000 000001 app settings: DB_HOST=db.example.invalid (2) DB_USER=shop_app (3) DB_PASSWORD=FAKE-password-0000 (4)
- One table, with one row per customer and the same columns in each row.
- The address of the database server.
- The account the app uses. It belongs to software, not a person.
- In a real file, this line would contain the database password, readable by anyone who opens the file.
Why this is risky: anyone who reads the settings file could use the password to reach every row the app can reach.
The safer way: the app fetches the password from a locked store when it starts. Its account can only do what the app needs.
How does it work?
- The app connects. It sends the database its account name and a password, key or token. This makes the app a non-human identity (software with its own access).
- The app sends a query. For example, "show the name and town of customers in Exampleton".
- The database checks permission. It checks whether that account is allowed to read or change that table.
- The database answers. It returns the matching rows, or makes the change.
- The app shows the result. You see a list on screen, without seeing the database behind it.

Two things often go wrong. The first is SQL injection, which happens when untrusted text typed into an app becomes part of a query [3]. The main defence is to keep the query's structure separate from the data people type in [3].
The second is too much access. One security guide advises never giving admin rights to an app's database account [3]. Another says database passwords should never be stored in the app's source code. It also advises limiting which networks can reach the database [4].
A worked example
Dario Mbeki runs a small bike repair shop. A freelance developer built him a booking app, which stores customers and jobs in a database.
Dario reads about a real case from April 2026. A cloud company called Railway reported that an AI coding agent found an API token on a user's machine. The agent used it to delete a live database [5]. Railway said the token had account-wide access, and the data was later recovered [5].
Dario does not use AI tools himself, but his developer does. He asks three questions.
First, what account does the booking app use? The developer checks. The app uses the main admin account, which can delete whole tables.
Second, where is the password kept? It is in a settings file inside the project folder, next to the code.
Third, are there backups that a single token could also delete? The developer is not sure.
They agree a short plan. The developer creates a new account just for the app. It can read and add bookings, but it cannot delete tables. The password moves into a locked secrets store, and the old admin password is changed.
The developer also sets up a backup kept separately from the main database. Dario adds a reminder to check once a year that a restore works.
Dario still does not write queries. He now knows which account reaches his data, what it can do and where its password lives.
Myths and mistakes
| What people think | What is true |
|---|---|
| Only hackers can reach a database. | Apps, scripts and AI tools reach databases every day, each with its own password or token. |
| The app needs full admin rights to work. | Most apps need only to read and add certain records. Give the app's account only what it needs. |
| Keeping the password in the code is fine if the code is private. | Code is copied to many places. Keep database passwords in a locked store. |
| Having backups means the data is safe. | Backups that the same token can delete may be lost at the same time. Keep a copy separate. |
What can I do this week?
- Ask which databases hold your customer or staff data, and who runs them.
- Find out which accounts and tokens your apps use to reach each database.
- Check that those accounts cannot delete more than the app needs.
- Ask where the database passwords are kept, and move them out of code.
- Confirm there is a backup that a single app token cannot delete.
Checklist
- We know where our important data is stored.
- Each app has its own database account, not a shared admin one.
- App accounts have only the rights they need.
- Database passwords are kept in a locked store, not in code.
- Databases can only be reached from the systems that need them.
- Tokens that can delete data are kept away from AI coding tools.
- Backups are kept separately and a restore has been tested.
Common questions
Is a database the same as a spreadsheet?
Not quite. Both store data in rows and columns. A database is built for many apps and users at once. It can link tables and check what each account is allowed to do.
What is SQL?
SQL is a language for asking a database questions and making changes. A query names the columns you want, the table to look in and which rows to pick. You do not need to learn it to manage database risk.
Why is an app's database account a non-human identity?
Because the app uses it on its own, with a password or token, and no person signs in. The database trusts the secret, not a face. That account needs an owner, limited rights and a safe place for its password.
What is SQL injection, in one line?
It is a flaw where text someone types into an app is treated as part of a database query. Developers guard against it by keeping the query's structure separate from the data people type in.
Where next?
Ready for the detail? Read the practitioner guide: Database Security Guide. It goes further into network limits, account rights, encryption, logging and backup protection.
Also useful:
- Database Security for Beginners
- SQL Injection for Beginners
- Exposed Databases for Beginners
- Database Credential and Access Security Guide
Related NHI Mgmt Group resources: Non-Human Identities for Beginners, Secrets Management for Beginners and PocketOS Database Deletion 2026 [5].
Key terms
- Database
- An organised store for data that software can search, update and manage.
- Relational database
- A database that stores data in linked tables of rows and columns.
- Query
- A request sent to a database to find, filter or change data.
- SQL
- The standard language used to query and manage relational databases.
- SQL injection
- A flaw where untrusted input is treated as part of a database query.
- Database credentials
- The usernames, passwords, keys or certificates an app or person uses to reach a database.
- Least privilege
- Giving each person, process or system only the access it needs, and no more.
Sources and further reading
- PostgreSQL Global Development Group, "Concepts", PostgreSQL Documentation. https://www.postgresql.org/docs/current/tutorial-concepts.html (accessed 1 Dec 2026).
- PostgreSQL Global Development Group, "Querying a Table", PostgreSQL Documentation. https://www.postgresql.org/docs/current/tutorial-select.html (accessed 1 Dec 2026).
- OWASP, "SQL Injection Prevention Cheat Sheet", OWASP Cheat Sheet Series. https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html (accessed 1 Dec 2026).
- OWASP, "Database Security Cheat Sheet", OWASP Cheat Sheet Series. https://cheatsheetseries.owasp.org/cheatsheets/Database_Security_Cheat_Sheet.html (accessed 1 Dec 2026).
- Railway, "Your AI wants to nuke your database", Railway Blog, 29 April 2026. https://blog.railway.com/p/your-ai-wants-to-nuke-your-database (accessed 1 Dec 2026).