Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//
var persons base
relation { id integer
, name character
, gender integer
, age integer}
key {id};
persons :=
relation{
tuple { id 1, name "Tarou", gender 1, age 10 },
tuple { id 2, name "Hanako", gender 2, age 20 },
tuple { id 3, name "Jirou", gender 1, age 30 },
tuple { id 4, name "Saburou", gender 1, age 40 },
tuple { id 5, name "Akemi", gender 2, age 8 },
tuple { id 6, name "Sadayo", gender 2, age 70 },
tuple { id 7, name "Hiroko", gender 2, age 15 }};
// グループ
var groups base
relation { id integer
, name character }
key {id};
groups :=
relation {
tuple { id 1, name "Matu" },
tuple { id 2, name "Take" },
tuple { id 3, name "Ume" }};
// 割当て
var assignments base
relation { id integer
, p_id integer
, g_id integer
, date character }
key {id};
assignments :=
relation {
tuple { id 1, p_id 1, g_id 1, date "2010/04/01" },
tuple { id 2, p_id 2, g_id 1, date "2009/09/01" },
tuple { id 3, p_id 3, g_id 2, date "2010/04/01" },
tuple { id 4, p_id 1, g_id 2, date "2010/05/01" },
tuple { id 5, p_id 1, g_id 3, date "2011/04/01" }};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment