Skip to content

Instantly share code, notes, and snippets.

@tphdev
Last active July 10, 2018 01:53
Show Gist options
  • Save tphdev/0da05cb87d9d554fc6f7e46fe3e368bb to your computer and use it in GitHub Desktop.
Save tphdev/0da05cb87d9d554fc6f7e46fe3e368bb to your computer and use it in GitHub Desktop.
relational model

Relational Model :

A framework for managing data. Data is organized into tables and relations.

Tables

============
TABLES (representation of data)
============
	
COUNTRY
---------
name
population
capital
square meters

	
STATE
---------
name
population
square meters
	
PRESIDENT
---------
name
date_of_birh

	
LANGUAGE
---------
name
latin_origin
	
	

Relations

============
RELATIONS (connections between tables)
============
	
+ COUNTRY has_a PRESIDENT
|- PRESIDENT belongs_to_one COUNTRY
	
+ COUNTRY has_many STATES
|- STATE belongs_to_one COUNTRY
	
+ COUNTRY has_many LANGUAGES
|- LANGUAGES belong_to_many COUNTRIES
	
	
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment