A relational database is made up of several components, of which the table is most significant. The database table is where all the data in a database is stored, and without tables, there would not be much use for relational databases.
Overall Structure of a Database Table
A database consists of one or more tables. Each table is made up of rows and columns. If you think of a table as a grid, the column go from left to right across the grid and each entry of data is listed down as a row.
Each row in a relational is uniquely identified by a primary key. This can be by one or more sets of column values. In most scenarios it is a single column, such as employeeID.
Every relational table has one primary key. Its purpose is to uniquely identify each row in the database. No two rows can have the same primary key value. The practical result of this is that you can select every single row by just knowing its primary key.
Database Table Columns
Columns are defined to hold a specific type of data, such as dates, numeric, or textual data. In the simplest of definitions a column is defined by its name and data type. The name is used in SQL statements when selecting and ordering data, and the data type is used to validate information stored.
So, a DateOfBirth column defined as a date, can be referred to in an order by clause as
ORDER BY DateOfBirth
And, if you try to add a value of “Hello Kitty” to the column, as part of its validation, it will recognize it isn’t a date, and reject it.
Columns names can’t be duplicated in a table. So, having two “name” columns is a no no. Though you could have two “name” columns, such as name1, and name2, you’ll learn later on, that this is frowned up, as it breaks normal form (I explain this in another post).
Database Table Rows
A database table can contain zero or more rows. When there are zero, it said to be empty. There is not practical limit on the number of rows a table can hold; however, remember the table’s primary key may have some influence on this.
What I mean, is that if your table holds states, and the primary key is the state’s abbreviation, then by definition, since there are only fifty states in the union, and you can not have duplicates in a primary key, your table is limited to fifty rows.
There is no guarantee that the rows in a table are stored in a particular order. Use the ORDER BY clause to do so.
Also, strictly speaking, in a relational database table there is no first or last row. Yes, you can tease out a first row of a result using a keyword such as LIMIT or TOP, but those are used once the data is retrieved and sorted. The difference here is that you’re seeing the first row of the result, not what is physically stored in the table.
Wrap up
In summary, you can think of the columns as giving the table its personality and the rows its substance.
Remember! I want to remind you all that if you have other questions you want answered, then post a comment. I’m here to help you.
Read More: Database Normalization – in Easy to Understand English >>
Just want to say thank you and so in my understanding one column like an array name and the raws are the arrays elements
Hi,
noticed some errors in the way of spelling possibly
“Though you could have two “name” columns, such as name1, and name2, you’ll learn later on, that this is frowned up, as it breaks normal form (I explain this in another post).”
* Is this supposed to be “Frowned Upon”?
“There is not practical limit on the number of rows a table can hold;”
*Is “not” supposed to be no? “There is no practical limit”
hi Kris. I am studying for Exam 98-‐364 Databas Administration
Fundamentals. I am a beginner in DB. Is there anyway l can get tutorials from you?. Youtube links or articles, anything that can help
Hi, Signup for my email list “Getting Started Learning SQL” that is a good way to get going.
This is a very, very interesting subject. Thank you Chris. I would like to know much more about Database Development and Management.
Thanks! I’m glad you liked it!
I APPRECIATE
How can I draw a uml normalization diagram for a bank
Good question! I’m stratring a series on data modeling. Check this out, it should help!
https://www.essentialsql.com/data-modeling-principles-action/
How can I draw a uml normalization diagram
Hi
I can’t get my head around the relationship parts of an edr. Can you explain simply step by step
Hi Garvin,
I would check out this post on Simplified Data Modeling. It explains the difference between primary and foreign keys, and then teach you about one to one and one to many relationships. Those two items are the basics to understanding ERDs.
IF you are wondering how to split columns out into tables in the first place, then read about normalization here.
If you have a more specific question, please ask.