CST 353 - Final Week (Week 8)

3 most important things I have learned in this course

1. Joining Tables

Joining tables is an essential part of relational databases, allowing users to combine data from multiple sources based on shared keys. The most common types of joins include INNER JOIN, which returns only matching records between tables, LEFT JOIN and RIGHT JOIN, which returns all records from one table even if no match exists in the other, and FULL OUTER JOIN, which returns all records from both tables. These joins help create meaningful relationships across datasets while still allowing selective access to information supporting both efficiency and privacy by only combining necessary fields.

2. Database Foreign Keys and Their Restrictions

Foreign keys are used to create relationships between tables by linking a column in one table to a primary key in another. They enforce referential integrity, meaning a record in one table cannot reference a non-existent record in another. Restrictions like ON DELETE CASCADE or ON UPDATE RESTRICT control what happens when linked data changes preventing inconsistent data. This structure maintains the logical connection and reliability of the database.

3. Database Scaling

A perfect example of database scaling lies in MySQL vs MongoDB. They each handle scaling differently and serve different purposes. MySQL, a relational database, typically uses vertical scaling, adding more power to a single server, while maintaining strict schemas and relationships. MongoDB, a NoSQL database, uses horizontal scaling through sharding. This makes MongoDB more flexible for large, unstructured datasets, while MySQL is better for structured, transactional systems that depend on consistency and strong relationships.

Comments

Popular Posts