What is a Column?

In a relational database, a column is a vertical group of cells within a table.

It’s also used to describe the vertical group of cells within a result set of a query, or other database objects, such as views, stored procedures, table-valued functions, etc.

In a table, each column is typically assigned a data type and other constraints which determine the type of value that can be stored in that column. For example, one column might email addresses, another might accept phone numbers.

Continue reading

What is a Row?

In relational database terms, a row is a collection of fields that make up a record.

The cells in a row run horizontally, and together, contain all data for that record.

A row can contain as many fields as required, each one defined in a different column. There must be at least one column defined in a table before a row of data can be added. The row is the smallest unit of data that can be inserted into a table and deleted from a table.

Continue reading

What is a Cell?

In database terminology, a cell is a part of a table where a row and column intersect. A cell is designed to hold a specified portion of the data within a record. A cell is sometimes referred to as a field (although a column is also often referred to as a field).

A table row is made up of one or more cells running next to each other horizontally. A column is made up of one or more cells running below each other vertically.

Continue reading

What is a Table?

A database table is a structure that organises data into rows and columns – forming a grid.

Tables are similar to a worksheets in spreadsheet applications. The rows run horizontally and represent each record. The columns run vertically and represent a specific field. The rows and columns intersect, forming a grid. The intersection of the rows and columns defines each cell in the table.

Continue reading

What is a Database?

A database is a collection of data, stored in a logical and structured manner.

The way in which data is organised, allows for efficient retrieval of the data. Data can be viewed, inserted, updated, and deleted as required.

Most modern databases are built with database software such as Microsoft Access, SQL Server, MySQL, etc. But strictly speaking, a database could be a simple as an Excel spreadsheet or even a text file.

Continue reading

What is a Relationship?

In relational database design, a relationship is where two or more tables are linked together because they contain related data. This enables users to run queries for related data across multiple tables.

Relationships are a key element in relational database design.

Here’s an example:

Diagram of one-to-many relationship
Example of one-to-many relationship.

In the above example, the City table has a relationship with the Customer table. Each customer is assigned a city. This is done by using a CityId field in the Customer table that matches a CityId in the City table.

While it’s certainly possible to store the full city name in the Customer table, it’s better to have a separate table that stores the city details. You can easily use a query to look up the CityName by using the CityId that’s stored for that customer.

Continue reading

What is a Primary Key?

A primary key is one or more columns that have been configured as the unique identifier field for the table.

Most primary keys are comprised of a single column, but they can also be comprised of multiple columns.

Any value stored in a primary key field is unique to that record. No other record contains that value. The value is a unique identifier.

Continue reading

What is a Foreign Key?

A foreign key is a field that is linked to another table‘s primary key field in a relationship between two tables.

In relational database management systems, a relationship defines a relationship between two or more tables. That is, the data in one table is related to the data in the other. One table contains the primary key and the other table contains the foreign key.

When we establish a relationship between the tables, we link the foreign key with the primary key. From that point on, any value in the foreign key field should match a value from the primary key field in the other table.

Continue reading

What is a View?

In the world of databases, a view is a query that’s stored on a database.

The term can also be used to refer to the result set of a stored query.

To create a view, you write a query, then save it as a view.

To run a view, you query it, just like you’d query a table. The difference is that, the view itself is a query. So when you query the view, you’re effectively querying a query.  This enables you to save complex queries as views, then run simple queries against those views.

Continue reading