Created
June 23, 2019 21:48
-
-
Save macagua/7dc3102ba4d49091eb318bb041bb0b35 to your computer and use it in GitHub Desktop.
DDL (Data Definition Language) syntax example for a MySQL Database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ddl my_db | |
-- create database my_db; | |
-- use my_db; | |
create table person( | |
id int not null, | |
name varchar(50), | |
lastname varchar (40), | |
age varchar (1), | |
constraint primary key (id) | |
); | |
create table users( | |
id int not null, | |
id_person int not null, | |
username varchar(50), | |
constraint primary key (id), | |
constraint fk_id_person foreign key (id_person) references person(id) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment