Basic Database Terminologies
Basic Database Terminologies
SLO # 7.2.1
Understanding Database Management Systems
2. Record/Tuple/Row
● A collection of related data fields that represent a single entity or instance in a table.
● Each row contains values for all the fields defined in the table.
● Examples: A customer record, a product record, an order record
3. Table
• Character Data (CHAR, VARCHAR): Stores text or strings of characters, such as names,
addresses, or descriptions.
• Integer Data (INT): Represents whole numbers, like ages, student IDs, or product quantities.
• Real Number Data (REAL): Handles decimal numbers, including prices, measurements, or
scientific data.
• Boolean Data (BOOLEAN): Stores logical values, either true or false, indicating conditions
or decisions.
• Date and Time Data (DATE, TIME, TIMESTAMP): Stores date and time information, such
as birthdates, event timestamps, or order dates.
Keys
In a library, books are categorized and linked using unique identifiers, like ISBNs or catalog numbers.
Similarly, relational databases use keys to identify and connect records within and across tables.
• Primary Key: The unique identifier for each record in a table, ensuring no duplicates exist. It's like a
student's unique ID number.
• Candidate Key: A potential primary key, meaning it can uniquely identify records. There can be multiple
candidate keys in a table, but only one becomes the primary key.
• Alternate Key: A candidate key that is not chosen as the primary key. It still uniquely identifies records
but plays a secondary role.
• Secondary Key: Used for searching and sorting records, like student names or course codes. They may
not be unique but aid in data retrieval.
• Foreign Key: Links a record in one table to a related record in another table. It's like a reference number
connecting a student's enrollment record to their personal information record.
Real-World Examples
• Character Data: Storing student names, book titles, or product descriptions.
• Date and Time Data: Recording student birthdates, order timestamps, or event schedules.
Key Relationships
• Primary Key: Student ID uniquely identifies each student record.
• Candidate Key: Both student ID and email address could be candidate keys, but only one
becomes the primary key.
• Alternate Key: Email address, if not chosen as the primary key, becomes an alternate key.
• Secondary Key: Student name or course code can be used for searching and sorting
student records.
• Foreign Key: Student ID in an enrollment table links to the student ID in the student
information table.
Conclusion
Relational databases provide a structured way to organize and
manage data. Understanding data types ensures accurate storage and
retrieval of information. Keys play a crucial role in identifying and
connecting records, maintaining data integrity and enabling efficient
access.