Skip to content

Instantly share code, notes, and snippets.

@froilan-miranda
Last active June 12, 2017 17:16
Show Gist options
  • Save froilan-miranda/ac585ebe8930e47a9a26 to your computer and use it in GitHub Desktop.
Save froilan-miranda/ac585ebe8930e47a9a26 to your computer and use it in GitHub Desktop.

#MySQL Lab#

  1. Create a addresses database

  2. Create two tables within that database: people, home.

  3. Add 10 entries into the people table and their respective address' and home numbers to the home table. make sure two or more people share the same address

People table will include:

  • First Name - varchar(50) Not Null default ‘’
  • Last Name - varchar(50) Not Null default ‘’
  • Mobile Phone # - varchar(20) Not Null default ‘’
  • Birthday - date Not Null
  • Home Id - small int unsigned default NULL
  • PRIMARY KEY (first_name, last_name, birthday));

Home table will include:

  • Id - small int unsigned not null auto_increment Primary Key
  • Home Phone # - varchar(20) Not Null default ‘’
  • Address - varchar(255) Not Null unique field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment