Data Modeling easy
Which property must valid a Primary Key possess?
- A It must be represented by a standard signed 64-bit integer to ensure full compatibility with modern, low-level heap memory management.
- B It must be mathematically unique across the entire table and cannot contain a NULL state, ensuring every specific row is addressable.
- C It must be cryptographically encrypted at the hardware level using a rotating public-private key pair before it can be stored on the disk.
- D It must strictly follow a sequential, monotonic numbering pattern that is automatically incremented by the database's internal ticker.
Answer: B. It must be mathematically unique across the entire table and cannot contain a NULL state, ensuring every specific row is addressable.
A Primary Key (PK) is a fundamental constraint that uniquely identifies each record in a table. While many systems use auto-incrementing integers for performance, a PK can technically be any non-repeating data (like a UUID or a composite set of columns). Its primary purpose is to provide a reliable target for Foreign Keys and to ensure that no two rows in the same table are identical in their identifying attribute.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When modeling a Distributed Transaction using the Saga Pattern (Choreography or Orchestration), what type of consistency do you achieve?
- Which practice prevents SQL Injection attacks?
- What is 'Bi-Temporal' data modeling (e.g., in SQL:2011 standard)?
- Adding an Index to a database column generally improves Read performance. What is the negative trade-off?
- Log Systems Merge (LSM) Trees (used in RocksDB, Cassandra) optimize for fast writes. What is their primary downside regarding Disk I/O?
- What is the primary objective of normalizing a relational database schema (e.g., to 3NF)?