Teradata Relational Concepts
Relational Database Management System is a DBMS software that helps to interact with databases. The relational database is a collection of objects in the form of tables, views, macros, stored procedures, and triggers.
They use Structured Query Language (SQL) to interact with the data stored in tables directly or individually developed applications.
Relational Database Terminology
Relational databases are a generalization of the mathematics of set theory relations. Therefore, the correspondences between set theory and relational databases are not always direct.
The following table shows the correspondence between set theory and relational database terms.
Tables are the basic unit in RDBMS where the data is stored. Tables are two-dimensional objects consisting of rows and columns. Data is organized in tabular format and presented to the users of a relational database.
References between tables define the relationships and constraints of data inside the tables themselves.
For example, the student data is shown in the tabular format, such as:
We can define conditions that must be met before Teradata Database writes a given value to a column in a table. These conditions are called constraints.
Constraints can include value ranges, equality or inequality conditions, and intercolumn dependencies. Teradata Database supports constraints at both the column and table levels.
During table creation and modification, you can specify constraints on single-column values as part of a column definition or on multiple columns using the CREATE and ALTER TABLE statements.
A column always contains the same kind of information or contains similar data.
For example, a student information table would have a column for date of birth, and nothing other than the student date of birth should be placed in that column.
A row is one instance of all the columns in the table.
An entity is a person, place, or thing about which the table contains information. The table mentioned in the previous paragraphs includes information on the student entity. Each table holds only one kind of row.
The relational model requires that each row in a table be uniquely identified. To accomplish this, we define a uniqueness constraint to identify each row in the table.
For example, each row in the student table would contain, among other things, the first roll no, name, and the last date of birth for that student. The columns in a table represent entities, relationships, or attributes.
The database is a collection of logically related data. Many users access them for different purposes.
For example, a sales database contains complete information about sales, which is stored in many tables.
The primary key is used to identify a row in a table uniquely. No duplicate values are allowed in a primary key column, and they cannot accept NULL values. It is a mandatory field in a table.
Foreign keys are used to build a relationship between the tables. A foreign key in a child table is defined as the primary key in the parent table.
A table can have more than one foreign key. It can accept duplicate values and also null values. Foreign keys are optional in a table.