Most relational databases (PostgreSQL, MySQL/InnoDB, SQL Server, Oracle) build indexes as a B-tree, specifically a B+ tree. A B-tree keeps keys sorted and balanced so that the tree stays shallow even as it grows. A table with a billion rows still only needs about 4 to 5 levels of tree, so a lookup touches only a handful of disk pages. B-trees are good for equality (= 'x') and range queries (BETWEEN, >, <, ORDER BY) because the data is already sorted.
Some workloads use other index types. A hash index gives O(1) equality lookups but cannot do range queries. PostgreSQL offers GIN and GiST indexes for full-text search, JSON, and geospatial data. Many search and analytics systems use an inverted index, which maps each term to the list of documents that contain it.
Indexes can be single-column or composite (multiple columns). Order matters in a composite index: an index on (last_name, first_name) helps queries that filter by last_name, or by last_name and first_name together, but does not help a query that filters only by first_name. A covering index goes further by including every column the query needs, so the database answers the query from the index alone and never touches the table.