🚧 Under construction — VoTechWorks is being built. A free tech program — complimentary, as our commitment to get America working.
voTechWorksGrade 13 · a vocational technology learning center, by urbanicity
newSchoolWorks.com › VoTechWorks › Technology & Design › Data Science & Analytics › SQL and PostgreSQL for Data Analytics › Lesson 1
TEC-DATA85-04 · Lesson 1 · 9 clock hours · theory

Relational Database Concepts and Workstation Safety

Objective. Students explain the relational model, identify the components of a PostgreSQL installation, and apply ergonomic and cybersecurity controls to a database workstation.

⚠ Pending professional review

This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.

VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.

What Is a Relational Database?

A relational database organizes data into tables (also called relations). Each table represents one type of thing — a customer, an order, a product. Rows in a table are called records or tuples; columns are called attributes or fields. The relational model was formalized by E.F. Codd in 1970 and remains the foundation of most production data systems you will work with as a data analyst.

Relational databases are powerful because they reduce data duplication and let you connect information across tables using shared values. PostgreSQL, the open-source database system used in this course, implements the relational model and follows the SQL standard closely.

Core Concepts: Entities, Attributes, and Relationships

An entity is a real-world thing your database tracks — for example, a Customer or an Invoice. An attribute is a property of that entity — for example, a customer's last name or email address. When you design a table, each entity becomes a table and each attribute becomes a column.

A relationship is a meaningful link between two entities. Relationships are represented by storing a key value from one table inside another table. The three common relationship types are:

Keys: Primary and Foreign

A primary key is a column (or combination of columns) whose value uniquely identifies every row in its table. No two rows may share the same primary key value, and it may never be NULL. Common choices are an auto-incrementing integer (called a serial or identity column in PostgreSQL) or a UUID.

A foreign key is a column in one table that references the primary key of another table. It enforces referential integrity — the database prevents you from storing a foreign key value that does not exist in the referenced table. For example, an `orders` table might have a `customer_id` column that is a foreign key pointing to `id` in the `customers` table.

Normalization: 1NF, 2NF, and 3NF

Normalization is the process of organizing tables to reduce redundancy and prevent update anomalies. You need to know the first three normal forms for your certification exams.

First Normal Form (1NF): Every column holds only atomic (indivisible) values; there are no repeating groups. A cell must not contain a list or multiple values.

Second Normal Form (2NF): The table is in 1NF, and every non-key column depends on the whole primary key, not just part of it. This matters when a primary key spans multiple columns.

Third Normal Form (3NF): The table is in 2NF, and no non-key column depends on another non-key column (no transitive dependencies). Each piece of information lives in exactly one place.

Higher normal forms exist but are beyond the scope of this lesson.

Components of a PostgreSQL Installation

When you open the class VM, you will find a running PostgreSQL 16 instance. Key components to recognize:

The default superuser account is named `postgres`. You should treat this account like a root account on a Linux system — use it only for administration.

Cybersecurity Controls for Database Workstations

Database workstations handle sensitive data, so security practices are not optional.

Weak passwords are the most common entry point for attackers. Use long, unique passphrases for every database account, and never leave the default `postgres` password unchanged in any environment beyond a local practice VM.

Unencrypted connections expose data in transit. PostgreSQL supports TLS (Transport Layer Security) for client connections. In production, always require encrypted connections by setting `ssl = on` in `postgresql.conf` and enforcing it in `pg_hba.conf`.

Unrestricted superuser access violates the principle of least privilege. Create role-specific database users with only the permissions their job requires. Analysts typically need SELECT on specific schemas — not CREATE, DROP, or superuser rights.

Additional controls include keeping PostgreSQL patched to the current minor release, logging failed login attempts, and locking workstations when stepping away.

Ergonomic Safety at the Database Workstation

Data analysts spend long hours at computers. Poor workstation setup causes musculoskeletal injuries over time. OSHA's computer workstation guidance identifies these key adjustments:

Document your workstation setup in the lab log at the start of every lab session. This creates a record that your environment meets safety standards and builds the habit of safety documentation required in professional data environments.

Key terms8

Relation (Table)A two-dimensional structure of rows and columns used to store data about one type of entity in a relational database.
Primary KeyA column or set of columns whose values uniquely identify each row in a table and cannot be NULL.
Foreign KeyA column in one table that references the primary key of another table, enforcing referential integrity between the two.
NormalizationThe process of organizing database tables to eliminate redundancy and prevent data anomalies, typically carried out through a series of normal forms (1NF, 2NF, 3NF).
Referential IntegrityA database rule that ensures every foreign key value matches an existing primary key value in the referenced table.
Least PrivilegeA security principle stating that a user or process should be granted only the minimum permissions needed to perform its job.
Transitive DependencyA situation in which a non-key column depends on another non-key column rather than directly on the primary key; eliminated in Third Normal Form.
pg_hba.confThe PostgreSQL host-based authentication configuration file that specifies which users and hosts may connect to the database and by what authentication method.
In class: Instructor-led concept map: entities, attributes, relationships, primary keys, foreign keys, and normalization levels 1NF–3NF drawn on whiteboard; students reproduce the map in their own notes. · Workstation safety walkthrough: students adjust chair height, monitor distance, and keyboard angle to OSHA ergonomic guidelines, then document their setup in a lab-log entry. · Pair exercise: students identify three cybersecurity risks relevant to database work (weak passwords, unencrypted connections, unrestricted superuser access) and write one mitigation for each.
Materials: PostgreSQL 16 documentation (postgresql.org), OSHA ergonomics guidance for computer workstations, class VM image with PostgreSQL pre-installed, whiteboard/markers
Check: Exit ticket: five short-answer questions on relational model vocabulary and two ergonomic controls; instructor marks for 80% correct before students proceed to Lesson 2.

Practice check8

Answer each question, then check it. Nothing is recorded; this is your own practice.

Data concepts and environments (CompTIA Data+)
1. Which of the following BEST describes a primary key?
Data concepts and environments (CompTIA Data+)
2. A database table stores customer orders. The `orders` table includes a `customer_id` column that matches the `id` column in the `customers` table. What is the `customer_id` column called in the `orders` table?
Data concepts and environments (CompTIA Data+)
3. A table is in First Normal Form (1NF). Every non-key column depends on only part of a composite primary key. Which normal form does this table violate?
Data concepts and environments (CompTIA Data+)
4. In a PostgreSQL installation, which file controls which users and hosts are permitted to connect and by what authentication method?
Security (CompTIA Data+ / Google Data Analytics)
5. Which cybersecurity principle states that a database analyst's account should have only SELECT rights on the schemas needed for their reports, and not CREATE or DROP rights?
Workplace safety and health
6. According to OSHA ergonomic guidance for computer workstations, where should the top of a monitor be positioned relative to the user's eyes?
Data concepts and environments (CompTIA Data+)
7. A table called `employee_project` has columns: `employee_id`, `project_id`, `employee_name`, and `hours_worked`. The primary key is the combination of `employee_id` and `project_id`. `employee_name` depends only on `employee_id`. Which problem does this represent?
Security (CompTIA Data+ / Google Data Analytics)
8. To reduce the risk of data being intercepted while traveling between a client application and a PostgreSQL server, an analyst enables TLS on the server. Which category of cybersecurity control does this represent?
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.