Tables in SQL

Tables are the basic level in which data is stored in a relational database management system. It contains a header row at the top of the table which lists the names of the columns, followed by rows containing data.

In this tutorial section, we’ll discuss the overview of SQL tables

  • What Table is it?
  • Database Files and Fields

What is a Table?

A table is an entity that consists of rows and columns in the SQL database. Simplifying it further we may claim it’s a list of related data kept in table format.

A database can have n number of tables in it. The number of columns is defined within a table but not the number of rows. A table may have rows of any number.

what is a table

Consider the previous School Database case, and let’s select from it the Student Information list. The Student Information table may contain any number of details of the students, but the columns should be linked and restricted, such as Student Name, Student ID, Age, BOD, Email, and Mark Percent.

The snapshot displays a table from an Employee Database containing details about the employee.

Records and Fields in SQL

Tables contain rows and columns, where the rows are referred to as records and the columns are called fields.

A column is a set of data values of a given form (such as numbers or alphabets), one value for each database row, e.g. Age, Student ID, or Student Name.

A row represents a single piece of data in a table and each row in the table has the same structure, e.g. Shaze[Student name] or 007[Student ID].

Let us understand in depth the fields and documents.

SQL Fields

Fields are essentially columns in a table which contain unique data information.

Consider the snapshot below, the table contains an e salary field which provides information on the different employees ‘ salaries. Similarly, the category e age offers details on the age of different employees.

sql fields

SQL Records

A record is basically a single entry that resides inside a list.

Records include full descriptions of a single entry or individual. Check out the screenshot below. One row is selected, that is to say Anne. This row contains full details about the employee in question, Anne.

sql records

So, we now know a collection of records and fields is making a table, and a collection of tables is making a database. We’ll disscus about the basic operations performed on a database in the next section of tutorial.

Leave a Reply