Answers for "Mysql Create table with foreign keys."

SQL
2

Mysql Create table with foreign keys.

CREATE TABLE products(
    productId INT AUTO_INCREMENT PRIMARY KEY,
    productName varchar(100) not null,
    categoryId INT NOT NULL,
    CONSTRAINT fk_category
    FOREIGN KEY (categoryId) 
    REFERENCES categories(categoryId)
        ON UPDATE CASCADE
        ON DELETE CASCADE
) ENGINE=INNODB;
Posted by: Guest on April-06-2022

Code answers related to "Mysql Create table with foreign keys."

Code answers related to "SQL"

Browse Popular Code Answers by Language