What is RDBMS?
RDBMS stands for Relational Database Management System. RDBMS is the basis for SQL, and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.
A Relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd.
What is a table?
The data in an RDBMS is stored in database objects which are called as tables. This table is basically a collection of related data entries and it consists of numerous columns and rows.
Remember, a table is the most common and simplest form of data storage in a relational database. The following program is an example of a CUSTOMERS table −
+----+----------+-----+-----------+----------+ | ID | Name | Age | Address | Salary | +----+----------+-----+-----------+----------+ | 1 | Sachin | 40 | Mumbai | 20000.00 | | 2 | Dhoni | 34 | Ranchi | 15000.00 | | 3 | kholi | 28 | Delhi | 20000.00 | | 4 | Rohit | 32 | Mumbai | 16500.00 | | 5 | Ashwin | 30 | Chennai | 18500.00 | | 6 | Kumar | 24 | Banglore | 14500.00 | | 7 | Bumrah | 24 | Pune | 10000.00 | +----+----------+-----+-----------+----------+
What is Field
Every table is broken up into smaller entities called fields. The fields in the CUSTOMERS table consist of Id, Name, Age, City and Salary.
A field is a column in a table that is designed to maintain specific information about every record in the table.
What is a Record or a Row?
A record is also called as a row of data is each individual entry that exists in a table. For example, there are 4 records in the above CUSTOMERS table. Following is a single row of data or record in the CUSTOMERS table −
+----+----------+-----+-----------+----------+ | 1 | Sachin | 40 | Mumbai | 20000.00 | +----+----------+-----+-----------+----------+
What is a column?
A column is a vertical entity in a table that contains all information associated with a specific field in a table.
For example, a column in the CUSTOMERS table is Name shown below −
+-----------+ | Name | | Sachin | | Dhoni | | kholi | | Rohit | | Ashwin | | Kumar |
What is a NULL value?
A NULL value in a table is a value in a field that appears to be blank, which means a field with a NULL value is a field with no value.
It is very important to understand that a NULL value is different than a zero value or a field that contains spaces. A field with a NULL value is the one that has been left blank during a record creation.
SQL Constraints
Constraints are the rules enforced on data columns on a table. These are used to limit the type of data that can go into a table. This ensures the accuracy and reliability of the data in the database.
Constraints can either be column level or table level. Column level constraints are applied only to one column whereas, table level constraints are applied to the entire table.
Following are some of the most commonly used constraints available in SQL −
- NOT NULL Constraint
- DEFAULT Constraint
- NOT NULL Constraint
- DEFAULT Constraint
- UNIQUE Constraint
- PRIMARY key
- FOREIGN Key
- CHECK Constraint
- INDEX
Comments
Post a Comment