Skip to content

Instantly share code, notes, and snippets.

@Y0lan
Last active July 7, 2019 23:54
Show Gist options
  • Select an option

  • Save Y0lan/f2fa20dd9d82b0328d31986a1d4fbdc0 to your computer and use it in GitHub Desktop.

Select an option

Save Y0lan/f2fa20dd9d82b0328d31986a1d4fbdc0 to your computer and use it in GitHub Desktop.
CREATE TABLE IF NOT EXISTS `users` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(60) NOT NULL,
`surname` varchar(60) NOT NULL,
`email` varchar(60) NOT NULL,
`phone` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `clients` (
`id` int NOT NULL,
`name` varchar(60) NOT NULL,
`surname` varchar(60) NOT NULL,
`email` varchar(60) NOT NULL,
`phone` varchar(20) NOT NULL,
`age` int NOT NULL,
`security_number` varchar(0) NOT NULL,
`birthdate` date NOT NULL
);
ALTER TABLE `clients` ADD CONSTRAINT `id` FOREIGN KEY () REFERENCES `users` (`id`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment