Before jumping into Django Models, it is beneficial to review the key points of a relational database.
A database that Django officially supports is a relational database, which is the most commonly used database type. A relational database organizes data into columns and rows.
There are five key terms in the relational database you need to understand.
Tables are sets of data organized in rows and columns. A relational database consists of multiple tables. In the main figure example, a database consists of three tables – Employee table, Personal Info table, and Division table.
Fields are a crucial part of a relational database storing data. Each field determines a data type that can store a specific type of data. We'll explain the data field types used in Django later.
A record is a set of values that are assigned to each field or column in a data table. In the example of the main figure, a record consists of data values that cover each field in the Employee table.
A relationship defines a connection between two tables. There are three types of relationships.
Primary key is defined as a field or column of a table that uniquely identifies each record in the table. The main role of the primary key is to define relationships with other tables in a relational database.
Before jumping into Django Models, it is beneficial to review the key points of a relational database.
A database that Django officially supports is a relational database, which is the most commonly used database type. A relational database organizes data into columns and rows.
There are five key terms in the relational database you need to understand.
Tables are sets of data organized in rows and columns. A relational database consists of multiple tables. In the main figure example, a database consists of three tables – Employee table, Personal Info table, and Division table.
Fields are a crucial part of a relational database storing data. Each field determines a data type that can store a specific type of data. We'll explain the data field types used in Django later.
A record is a set of values that are assigned to each field or column in a data table. In the example of the main figure, a record consists of data values that cover each field in the Employee table.
A relationship defines a connection between two tables. There are three types of relationships.
Primary key is defined as a field or column of a table that uniquely identifies each record in the table. The main role of the primary key is to define relationships with other tables in a relational database.