CREATE DATABASE IF NOT EXISTS demodb;
 
USE demodb;
 
CREATE TABLE categories(
   cat_id int not null auto_increment primary key,
   cat_name varchar(255) not null,
   cat_description text
) ENGINE=InnoDB;
 
CREATE TABLE products(
   prd_id int not null auto_increment primary key,
   prd_name varchar(355) not null,
   prd_price decimal,
   cat_id int not null,
   FOREIGN KEY fk_cat(cat_id)
   REFERENCES categories(cat_id)
   ON UPDATE CASCADE
)ENGINE=InnoDB;

insert into categories (cat_name, cat_description) values ('drinks', 'Drinks');

update categories set cat_description='Liquids' where cat_id='1';
