TGTGInsighttelegram intelligenceLIVE / telegram public index
Post content
Post content
Most of you responded with first option PRIMARY KEY Yes, a PRIMARY KEY does enforce: Uniqueness & NOT NULL So technically, it's correct — making email a primary key will satisfy the condition that emails must be unique & not null But... here’s the catch: In real-world database design, email is rarely used as a primary key, because: - It can change (users may update emails). - It’s not an ideal unique identifier like a user_id (which is usually an auto-incrementing integer). Using email as PK can make foreign key relationships messy and inefficient, so we'll have to explicitly use UNIQUE & NOT NULL constraints Hope it clear most of the doubts :)