Skip to content

Instantly share code, notes, and snippets.

@macagua
Created June 23, 2019 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macagua/7dc3102ba4d49091eb318bb041bb0b35 to your computer and use it in GitHub Desktop.
Save macagua/7dc3102ba4d49091eb318bb041bb0b35 to your computer and use it in GitHub Desktop.
DDL (Data Definition Language) syntax example for a MySQL Database
-- 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