I've got a table called students:
+------------+------------+-----------+---------------------+---------------------+ | student_id | first_name | surname | email | reg_date | +------------+------------+-----------+---------------------+---------------------+ | 1 | Emily | Jackson | [email protected] | 2012-10-14 11:14:13 | | 2 | Daniel | ALexander | [email protected] | 2014-08-19 08:08:23 | | 3 | Sarah | Bell | [email protected] | 1998-07-04 13:16:32 | | 4 | Alex | Harte | [email protected] | 1982-06-14 00:00:00 | +------------+------------+-----------+---------------------+---------------------+ When creating the table:
CREATE TABLE students( -> student_id INT NOT NULL AUTO_INCREMENT, -> first_name VARCHAR(30) NOT NULL, -> surname VARCHAR(50) NOT NULL, -> email VARCHAR(200) NOT NULL, -> reg_date DATETIME NOT NULL, -> PRIMARY KEY (student_id), -> UNIQUE (email)); What does the 'UNIQUE (email)' mean? Does it mean if the primary key isn't unique, look at the email to see if that's unique instead? Or something different?
Thanks
[email protected]as their address.