Advertisement
Nikitalox

Лр2-запрос на создание таблицы invoice

May 15th, 2024
1,283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.41 KB | None | 0 0
  1. CREATE TABLE IF NOT EXISTS `firstModel`.`invoice` (
  2.   `idinvoice` INT NOT NULL AUTO_INCREMENT,
  3.   `userid` INT NOT NULL,
  4.   `productid` INT NOT NULL,
  5.   `cost` DECIMAL(10,2) NOT NULL,
  6.   PRIMARY KEY (`idinvoice`),
  7.   INDEX `user_idx` (`userid` ASC) VISIBLE,
  8.   CONSTRAINT `user`
  9.     FOREIGN KEY (`userid`)
  10.     REFERENCES `firstModel`.`user` (`id`)
  11.     ON DELETE NO ACTION
  12.     ON UPDATE NO ACTION)
  13. ENGINE = InnoDB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement