{"id":30,"date":"2016-06-26T15:38:30","date_gmt":"2016-06-26T14:38:30","guid":{"rendered":"http:\/\/reldb.org\/wordpress\/?page_id=30"},"modified":"2017-12-24T17:50:27","modified_gmt":"2017-12-24T17:50:27","slug":"1-0-11-syntax","status":"publish","type":"page","link":"https:\/\/reldb.org\/c\/index.php\/read\/1-0-11-syntax\/","title":{"rendered":"1.0.11+ syntax"},"content":{"rendered":"<h1><i>Rel<\/i> Version 1.0.11+ Syntax<\/h1>\n<h2>Introduction<\/h2>\n<p>As of <i>Rel<\/i> version 1.0.10, some significant syntax changes to <b>Tutorial D<\/b> were implemented. These are based on the book <i>Database Explorations: Essays on The Third Manifesto and related topics<\/i> by C. J. Date and Hugh Darwen (ISBN 978-1426937231). The relevant chapter from that book, with revisions, is available on-line at\u00a0<a href=\"http:\/\/www.dcs.warwick.ac.uk\/~hugh\/TTM\/Tutorial%20D-2013-05-23.pdf\">http:\/\/www.dcs.warwick.ac.uk\/~hugh\/TTM\/Tutorial%20D-2013-05-23.pdf<\/a><\/p>\n<p>In <i>Rel<\/i> version 1.0.11, a few additional changes were made.<\/p>\n<p>These changes may impact your ability to run various published <b>Tutorial D<\/b> examples, and they will certainly affect those who are migrating from pre- version 1.0.10 <i>Rel<\/i>databases to the latest version of <i>Rel<\/i>.<\/p>\n<h2>Migrating from a Version of <i>Rel<\/i> Prior to 1.0.11<\/h2>\n<p>Prior to installing the latest version of <i>Rel<\/i>, you must make a backup of your database(s). Then, install the latest version, and load and attempt to execute the backup script(s). If your script successfully loads, you&#8217;re done. If it complains of syntax errors, you&#8217;ll need to edit the script \u2014 based on the following \u2014 until the script successfully loads.<\/p>\n<h2>Changes in <i>Rel<\/i> version 1.0.10 and 1.0.11<\/h2>\n<h3>EXTEND<\/h3>\n<blockquote><p><b>Prior to 1.0.10:<\/b> <code>EXTEND r ADD (p AS q, a AS b)<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>EXTEND invoice ADD (shipping + amount AS subtotal, subtotal + tax AS total)<\/code><\/p><\/blockquote>\n<p><b>1.0.10+:<\/b> <code>EXTEND r: {q := p, b := a}<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>EXTEND invoice: {subtotal := shipping + amount, total := subtotal + tax}<\/code><\/p><\/blockquote>\n<\/blockquote>\n<h3>UPDATE<\/h3>\n<blockquote><p><b>Prior to 1.0.10:<\/b> <code>UPDATE r (p := q, b := a)<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>UPDATE employee WHERE id='E3498' (salary := salary + 2450.33, paygrade := 'P')<\/code><\/p><\/blockquote>\n<p><b>1.0.10+:<\/b> <code>UPDATE r: {p := q, b := a}<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>UPDATE employee WHERE id='E3498': {salary := salary + 2450.33, paygrade := 'P'}<\/code><\/p><\/blockquote>\n<\/blockquote>\n<h3>RENAME<\/h3>\n<blockquote><p><b>Prior to 1.0.10:<\/b> <code>r RENAME (a AS b, d AS e)<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>employee RENAME (salary AS yearly_wage, paygrade as employee_paygrade)<\/code><\/p><\/blockquote>\n<p><b>1.0.10+:<\/b> <code>r RENAME {a AS b, d AS e}<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>employee RENAME {salary AS yearly_wage, paygrade as employee_paygrade}<\/code><\/p><\/blockquote>\n<\/blockquote>\n<h3>SUMMARIZE<\/h3>\n<blockquote><p><b>Prior to 1.0.10:<\/b> <code>SUMMARIZE r ADD (SUM(p) AS q, AVG(a) AS b)<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>SUMMARIZE invoice ADD (SUM(amount) AS total_amount, AVG(tax) AS average_tax)<\/code><\/p><\/blockquote>\n<p><b>1.0.10+:<\/b> <code>SUMMARIZE r: {q := SUM(p), b := AVG(a)}<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>SUMMARIZE invoice: {total_amount := SUM(amount), average_tax := AVG(tax)}<\/code><\/p><\/blockquote>\n<\/blockquote>\n<h3>WITH<\/h3>\n<blockquote><p><b>Prior to 1.0.10:<\/b> <code>WITH a AS b, x AS y : ...<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>WITH r {x, y} AS t1, r {x, p} AS t2: JOIN {t1, t2}<\/code><\/p><\/blockquote>\n<p><b>1.0.10+:<\/b> <code>WITH (b := a, y := x) : ...<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>WITH (t1 := r{x, y}, t2 := r {x, p}) : JOIN {t1, t2}<\/code><\/p><\/blockquote>\n<\/blockquote>\n<h3>WRAP<\/h3>\n<blockquote><p><b>Prior to 1.0.10:<\/b> <code>r WRAP ({a, b} AS c, {d, e} AS f)<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>customers WRAP ({house, street, city, postcode} AS address, {phone, email} AS contact)<\/code><\/p><\/blockquote>\n<p><b>1.0.10:<\/b> <code>(r WRAP ({a, b} AS c)) WRAP ({d, e} AS f)<\/code><\/p>\n<p><b>1.0.11+:<\/b> <code>(r WRAP {a, b} AS c) WRAP {d, e} AS f<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>(customers WRAP {house, street, city, postcode} AS address) WRAP {phone, email} AS contact<\/code><\/p><\/blockquote>\n<\/blockquote>\n<h3>UNWRAP<\/h3>\n<blockquote><p><b>Prior to 1.0.10:<\/b> <code>r UNWRAP (a, b)<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>customers UNWRAP (address, contact)<\/code><\/p><\/blockquote>\n<p><b>1.0.10:<\/b> <code>(r UNWRAP (a)) UNWRAP (b)<\/code><\/p>\n<p><b>1.0.11+:<\/b> <code>(r UNWRAP a) UNWRAP b<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>(customers UNWRAP address) UNWRAP contact<\/code><\/p><\/blockquote>\n<\/blockquote>\n<h3>GROUP<\/h3>\n<blockquote><p><b>Prior to 1.0.10:<\/b> <code>r GROUP ({a, b} AS c, {d, e} AS f)<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>sys.Catalog GROUP ({Name, Definition, CreationSequence} AS vardata, {vardata, isVirtual} AS varinfo)<\/code><\/p><\/blockquote>\n<p><b>1.0.10:<\/b> <code>(r GROUP ({a, b} AS c)) GROUP ({d, e} AS f)<\/code><\/p>\n<p><b>1.0.11+:<\/b> <code>(r GROUP {a, b} AS c) GROUP {d, e} AS f<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>(sys.Catalog GROUP {Name, Definition, CreationSequence} AS vardata) GROUP {vardata, isVirtual} AS varinfo<\/code><\/p><\/blockquote>\n<\/blockquote>\n<h3>UNGROUP<\/h3>\n<blockquote><p><b>Prior to 1.0.10:<\/b> <code>r UNGROUP (a, b)<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>catalog UNGROUP (vardata, varinfo)<\/code><\/p><\/blockquote>\n<p><b>1.0.10:<\/b> <code>(r UNGROUP (a)) UNGROUP (b)<\/code><\/p>\n<p><b>1.0.11+:<\/b> <code>(r UNGROUP a) UNGROUP b<\/code><\/p>\n<blockquote><p><i>Example:<\/i><br \/>\n<code>(catalog UNGROUP vardata) UNGROUP varinfo<\/code><\/p><\/blockquote>\n<\/blockquote>\n<h3>ANY and ALL<\/h3>\n<blockquote><p><b>Prior to 1.0.10:<\/b> ANY and ALL were available as synonyms for OR and AND, respectively.<\/p>\n<p><b>1.0.10+:<\/b> ANY and ALL have been removed.<\/p><\/blockquote>\n<h3>INSERT<\/h3>\n<blockquote><p><b>Prior to 1.0.10:<\/b> INSERT generates an error message if attempting to insert duplicate tuples.<\/p>\n<p><b>1.0.10+:<\/b> INSERT silently ignores duplicate tuples.<\/p><\/blockquote>\n<h3>COMPOSE<\/h3>\n<blockquote><p><b>1.0.10+:<\/b> An n-adic COMPOSE operator is now available. For example <code>COMPOSE {x, y, z}<\/code> is equivalent to <code>x COMPOSE y COMPOSE z<\/code>.<\/p><\/blockquote>\n<h3>XUNION, TIMES, I_MINUS, I_DELETE and D_INSERT<\/h3>\n<blockquote><p><b>1.0.10+:<\/b> XUNION, TIMES, I_MINUS, I_DELETE and D_INSERT have been implemented. Please refer to the references in the Introduction for further information.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Rel Version 1.0.11+ Syntax Introduction As of Rel version 1.0.10, some significant syntax changes to Tutorial D were implemented. These are based on the book Database Explorations: Essays on The Third Manifesto and related topics by C. J. Date and Hugh Darwen (ISBN 978-1426937231). The relevant chapter from that book, with revisions, is available on-line <a href=\"https:\/\/reldb.org\/c\/index.php\/read\/1-0-11-syntax\/\" rel=\"nofollow\"><span class=\"sr-only\">Read more about 1.0.11+ syntax<\/span>[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":17,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-30","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/reldb.org\/c\/index.php\/wp-json\/wp\/v2\/pages\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/reldb.org\/c\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/reldb.org\/c\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/reldb.org\/c\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/reldb.org\/c\/index.php\/wp-json\/wp\/v2\/comments?post=30"}],"version-history":[{"count":2,"href":"https:\/\/reldb.org\/c\/index.php\/wp-json\/wp\/v2\/pages\/30\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/reldb.org\/c\/index.php\/wp-json\/wp\/v2\/pages\/30\/revisions\/63"}],"up":[{"embeddable":true,"href":"https:\/\/reldb.org\/c\/index.php\/wp-json\/wp\/v2\/pages\/17"}],"wp:attachment":[{"href":"https:\/\/reldb.org\/c\/index.php\/wp-json\/wp\/v2\/media?parent=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}