Columns and Records

Rows and Columns

In this post we will discuss columns and records in SQL. When writing an SQL Statement, you will need to select data from a table. A table stores information about a collection of objects or entities. For example, if we were selling bicycles and accessories, we would need to keep track of all the assorted products available. We would create a table to record each of these products.

SQL Columns and Rows

So, each row would be a record for each of these objects (bicycles). Each object will have a series of properties or attributes that describe that object. In our products table, these properties are stored in columns.

To retrieve this data using a SELECT statement we would use the code below where you separate each column you would like to retrieve using commas. Then you would specify FROM which table you would like to retrieve the records. In this case, the table’s name is Production.Product. This statement will return all the rows or records from the table. If we wanted to filter out specific records, we would add a WHERE statement on the line following the FROM statement.

SELECT statement diagrammed

Be the first to comment on "Columns and Records"

Leave a comment

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.