Overview of Tables in SQL
Tables are the fundamental level to store data in a relational database management system. It contains a header row at the top of the table which gives list of column names, followed by rows that contain data.
we will discuss about the basic operations performed on a database by using important SQL operators.
Watch this SQL Create Table video
In this tutorial section, we will discuss about the overview of tables in SQL
What Is a Table?
A table is a database object which is comprised of rows and columns in SQL. Simplifying it more we can say that it’s a collection of related data held in a table format.
Want to get certified in SQL! Learn SQL from top SQL experts and excel in your career with intellipaat’s SQL certification.
A database can contain n number of tables. Within a table, the number of columns is specified but not the number of rows. A table can have any number of rows.
Consider the previous example of the School Database and let’s pick the Student Details table from it. The Student Details table can have any number of students details entered into it, but the columns should be related and limited like Student_Name, Student_ID, Age, BOD, Address, and Percentage of Marks.
The snapshot displays a table from an Employee Database, which contains employee details.
Kick-start your career in SQL with the perfect SQL Training Course now!
Records and Fields in SQL
Tables contain rows and columns, where the rows are known as records and the columns are known as fields.
A column is a set of data values of a particular type (like numbers or alphabets), one value for each row of the database, for example, Age, Student_ID, or Student_Name.
A row represents a single data item in a table, and every row in the table has the same structure, for example, Shaze[Student_name] or 007[Student_ID].
Let us understand fields and records in detail.
Fields in SQL
Fields are basically columns in a table with specific information about the data.
Consider the snapshot below, there is an e_salary field in the table which provides information about the salary of different employees. Similarly, the e_age field provides information about the age of different employees.
Still have queries? Come to Intellipaat’s SQL Community, clarify all your doubts, and excel in your career!
Records in SQL
A record is basically an individual entry that exists in a table.
Records give the complete information of a single entry or entity. Consider the snapshot below. One row is selected, i.e., Anne. This row gives the complete information of about the particular employee, Anne.
So, now we know that a collection of records and fields makes a table and a collection of tables makes a database. In the next tutorial section, we will disscus about the basic operations performed on a database.
Wish to crack SQL job interviews? Intellipaat’s Top SQL Interview Questions are meant only for you!