Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/27/2020 in all areas

  1. Not sure I would call a registration and login system less complex than threads and posts, but I guess it depends... I suggest you take a look at MariaDB's knowledge base section on database theory.
    2 points
  2. 1 point
  3. A "Key" is not a constraint. There are 2 types of keys. "Primary Key" or "Foreign Key". In a table the Primary key is one or more columns in combination, that can be used to uniquely identify a single row in the table. A "Foreign Key" is the "Primary Key" of another table, that establishes a relationship to a single row in the Foreign table. Constraints are restrictions to the overall "Domain" of acceptable values allowed in a particular column. For example, you could have a constraint defined for a "gender" varchar that allows ("male", "female", "unspecified") only. In practice there are inherent constraints for primary and foreign keys. For a primary key, a "Unique" constraint is assumed, as no 2 rows in a table can have the same primary key. For a foreign key, there is an implied "referential integrity constraint" that enforces the rule that any value for the foreign key column (or set of columns) must have a corresponding Primary key in the foreign table. The association of these implied constraints is typically referred to as "Declarative referential integrity" in that when you specify the primary and foreign keys, the constraints are created automatically. With MySQL referential integrity requires a supported engine, typically InnoDB. Pluggable (optional) engines are one of the things that sets MySQL apart from the other major RDBMS. Indexes provide performance for relational joins and searching In practice, all RDBMS use indexes for performance AND some constraints. For example, when you define a key, an associated Index is automatically created for you. This is true of all the major RDBMS, so MySQL is not different from Oracle, Sybase etc. You certainly can index a column or set of columns without that index being associated with another table as a foreign key. So in that way, I agree that Keys and Indexes are not the same thing, so long as you understand that if you define a key an Index is being created. The RDBMS is inherently going to use the key indexes it creates in numerous ways, for performance, constraints and primary key uniqueness. The authority for this terminology is E.F. "Ted" Codd, who was the IBM research fellow that invented the Relational Model for databases, rules of database normalization, SQL etc., upon which all RDBMS are based.
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.