Skip to main content

Row

In SQL, a "row" refers to a record in a table. Each row in a table represents a set of related data, and every row in the table has the same structure.

For instance, in a table named "customers", a row may represent one customer, with columns containing information like ID, name, address, email, etc.

Here is a conceptual SQL table:

IDNAMEADDRESSEMAIL
1JohnNYjohn@example.com
2JaneLAjane@example.com
3JimChicagojim@example.com

Each of these line of data is referred to as a 'row' in the SQL table.

To select a row, you would use a SELECT statement. Here's an example of how you might select a row:

SELECT * 
FROM customers
WHERE ID = 1;

This would output:

IDNameADDRESSEmail
1JohnNYjohn@example.com

The * in the statement refers to all columns. If you want to only select specific columns, you can replace * with the column name(s):

SELECT NAME, EMAIL
FROM customers
WHERE ID = 1;

In this case, the output would be:

NameEmail
Johnjohn@example.com