What Is a Database Row? Understanding and Identifying a Record
A database row is one record in a table: one set of values describing an item such as a customer or an order. Its columns hold that record’s attributes. A row does not automatically have a unique identity or a guaranteed position, so use a key to target it and an explicit sort condition when order matters.
What does one row represent?
In a customer table, a row might represent one customer; columns such as customer_id, name, and email describe that customer. In an orders table, a row might represent one order. The table’s design defines what an item means and which values it must have.
CREATE TABLE customers (
customer_id bigint PRIMARY KEY,
name text NOT NULL,
email text UNIQUE
);
SELECT customer_id, name, email
FROM customers
WHERE customer_id = 42;The predicate selects the customer whose ID is 42. The primary key provides a stable way to identify that row. email is unique when supplied, while this definition permits NULL; whether an email is required, and how case or normalization is handled, depends on the application’s requirements. This SQL is illustrative and has not been executed.
Is every row automatically unique?
No. “Record” is a common practical synonym for row, but an SQL table does not necessarily enforce uniqueness by itself. Relational theory commonly models a relation as a set without duplicate tuples; SQL tables can contain repeated values when no key or uniqueness constraint prevents them. A primary key can consist of one column or a combination of columns.
When changing or deleting a particular record, identify it by a primary key or another sufficiently unique condition, not by its apparent position. Several customers can share a name, so WHERE name = 'Kim' may affect more than one person. A key makes the intended target explicit.
Does a table have a row order?
No guaranteed logical order is implied by storage. Rows may appear in a particular order on disk or in repeated query results, but changes to data, indexes, or the query plan can change that order. Specify ORDER BY created_at to request chronological ordering. Add a second criterion such as the primary key when ties also need a deterministic order.
SELECT customer_id, name
FROM customers
ORDER BY name, customer_id;This sorts by name, then by ID when names match. Without an ordering clause, the query result’s order is not guaranteed.
What does NULL mean when working with a row?
NULL represents an absent or unknown value; it is not the same as zero or an empty string. Test it with IS NULL or IS NOT NULL, rather than = NULL. A NOT NULL constraint requires a value to be supplied, but cannot establish that the value is accurate or valid in the real world.
An update that changes only selected columns should preserve the other columns. Some application code replaces an entire object and can accidentally erase omitted values or set them to NULL. Before an update, check that its condition selects the intended rows and consider the transaction, backup, and recovery requirements.
Practical checks
Decide which real-world or business item each row represents.
Choose a primary key. If using a natural key, consider whether it can change and whether it exposes personal information.
Use constraints such as `NOT NULL`, `UNIQUE`, and foreign keys to enforce relevant rules.
Add `ORDER BY` whenever a query needs a particular order.
Restrict updates and deletes to a key or a sufficiently narrow condition; verify the number and scope of affected rows.
Sources and scope
[PostgreSQL documentation: table basics and row order](https://www.postgresql.org/docs/18/ddl-basics.html)
[PostgreSQL documentation: constraints and primary keys](https://www.postgresql.org/docs/current/ddl-constraints.html)
[PostgreSQL documentation: sorting query results](https://www.postgresql.org/docs/current/queries-order.html)
The PostgreSQL documentation was checked on 2026-11-22. This article explains “row” and “record” in practical terms while distinguishing the possibility of duplicates in unconstrained SQL tables from their lack of an implicit order. The SQL examples are illustrative and were not executed; check the documentation for other database products for product-specific details.