What is a Record?

In relational databases, a record is a collection of fields that contain data about a given entity.

A record is typically stored as a row in a table. A record contains the smallest amount of data that can be inserted, updated or deleted from a table.

An example of a record could be a single row in a “Customers” table. This row could contain the customer’s first name and last name for example. Therefore, the record contains the customer’s first name and last name. It could also contain other fields as required – such as an ID field, the date the record was created, etc.

Continue reading

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

How to Create a Stored Procedure in SQL Server

To create a stored procedure in SQL Server:

  1. Click New Query on the SSMS toolbar
  2. Type (or paste) a CREATE PROCEDURE statement (example below)
  3. Click the Execute button on the toolbar

This will add the stored procedure to the database. You can see it under the Stored Procedures node in the Object Explorer.

Below are screenshots and more detail for the above steps.

Continue reading

How to Create a View in SQL Server

To create a view in SQL Server:

  1. Open a new query by clicking the New Query button in the SSMS toolbar
  2. Type or paste a CREATE VIEW statement (example below)
  3. Run the script

The view will now be created in the database. You will be able to see it under the Views node in the Object Explorer.

You can now use SELECT statements against the view in future queries.

Below are screenshots of the above steps.

Continue reading

How to Use the Query Designer in SQL Server

To use the Query Designer in SQL Server:

  1. Open a new query by clicking New Query on the toolbar
  2. Open the Query Designer by selecting Query > Design Query in Editor... from the top menu
  3. Add the tables you want to run the query against
  4. Build the criteria for your query then click OK

The query will appear in the query window. To run the query, click ! Execute or press F5

Below are screenshots for the above steps.

Continue reading

How to Create a Table in SQL Server using a Query

To create a table in SQL Server using a query:

  1. In the SQL Server Management Studio, click the New Query button on the toolbar
  2. Type or paste a CREATE TABLE script (example below)
  3. Click the ! Execute button on the toolbar

Here’s an example:

Screenshot of SSMS with the New Query button highlighted.
Clicking the “New Query” button on the SSMS toolbar opens a new query. Clicking “Execute” runs the query.

Continue reading