In this post, we observe our first database created in our last tutorial and learn the terminology associated with it. See the video below and the notes that follow:
Term | Definition |
Record | A single row in a database table. (also known as tuple). A record consists of 2 or more fields. |
Field | A single item of data in a record. It can be thought of as a column in a table. (also known as an attribute) |
Data type | The type of data that can be saved in a field. The database management system (DBMS) only allows the specified datatype for each field. For example, The DBMS would not allow text data to be saved in a field that has a data type of “Date/Time”. |
Primary Key | A field that uniquely identifies each row in a table or entity. It is always present for each row, i.e. It is never allowed to be blank or empty. |
Foreign key | This is a field used to store primary key data from another table. This allows for tables to be related. |
Key (or Key field) | Either a primary key or foreign key. Primary keys and foreign keys are called keys because they can be used to represent a record in a table. |
Composite Key | when two or more keys are combined to form another. |
Composite Primary Key | When 2 Keys are combined to form a primary key. |
Candidate Key | A key or composite key that can be reasonably assumed to uniquely identify a row in a table. |
Terminology With examples and explanation
Record – A single row in a database table. (also known as tuple). A record consists of 2 or more fields. E.g, a single row in our subject table.
Field – A single item of data in a record. It can be thought of as a column in a table . (also known as an attribute) E.g “First Name” in our student Table
Data type – The type of data that is allowed to be saved in a field. The database management system (DBMS) only allows the specified datatype for each field. For example, The DBMS would not allow text data to be saved in a field that has a data type of “Date/Time”.
Primary Key – A field that uniquely identifies each row in a table or entity. It is always present for each row, i.e It is never allowed to be blank or empty. E.g Student ID
Foreign key – This is a field used to store primary key data from another table. This allows for tables to be related. E.g Student ID in our enrolment table.
Key (or Key field) – Either a primary key or foreign key. Primary keys and foreign keys are called keys because they can be used to represent a record in a table. E.g any primary or secondary key found in the database tutorial.
Composite Key – when two or more keys are combined to form another. E.g (Student ID, Subject Code) from our Enrolment Table.
Composite Primary Key – When 2 Keys are combined to form a primary key. For example, in our student table, we could use a students last name, first name and DOB combined to be the primary key for our table .(This is assuming that we never encounter two students with the same names and date of birth!)
Candidate Key – A key or composite key that can be reasonably assumed to uniquely identify a row in a table. E.g (First Name, Last Name, DOB) in the student table.
© 2021 Vedesh Kungebeharry. All rights reserved.
[…] Database Terminology in Context […]
LikeLiked by 1 person