i recently read an article about creating secure php login system which will guide step by step and now this question camed to me why in this article there is no primary key in login_attempts table.
the article which i talked about:
this article
Create the "login_attempts" table:
CREATE TABLE `secure_login`.`login_attempts` (
`user_id` int(11) NOT NULL,
`time` VARCHAR(30) NOT NULL
) ENGINE=InnoDB
please go to step 4
Create a table to store login attempts.
then the question is realy clear just as title is.is there any situation that we dont have any primary key?
Yes there is, but you need to atleast add a non-unique
INDEXon columnUser_IDto improve the performance when querying on the table.