What is the difference between primary and foreign keys in relational databases?
Primary keys serve as the identifier of a unique record in a database table. It can be unique information, such as a driver’s license number, telephone number including area code, car VIN number, etc.
CREATE TABLE `ecommerce`.`customer` ( `driving_license` VARCHAR(100), `name` VARCHAR(150) NOT NULL, `surname` VARCHAR(150) NOT NULL, `email` VARCHAR(150), `phone` VARCHAR(200), PRIMARY KEY `Primary key`( `driving_license` ) ) ENGINE = InnoDB;
Multi-column primary keys
A primary key can contain one or more columns.… Read the rest