diff --git a/relalg.sty b/relalg.sty index 0930305..fa0983b 100755 --- a/relalg.sty +++ b/relalg.sty @@ -23,7 +23,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % select or restrict operator \newcommand{\RelSelect}{\ensuremath{\sigma}} -\newcommand{\RelRestrict}{\ensuremath{\sigma}} +\newcommand{\RelRestrict}{\RelSelect} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % project operator @@ -59,13 +59,13 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % set intersection operator \newcommand{\RelIntersection}{\ensuremath{\cap}} -\newcommand{\RelIntersect}{\ensuremath{\cap}} +\newcommand{\RelIntersect}{\RelIntersection} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % natural join operator \newcommand{\RelNaturalJoin}{\ensuremath{\Join}} -\newcommand{\RelNatJoin}{\ensuremath{\Join}} -\newcommand{\RelNJoin}{\ensuremath{\Join}} +\newcommand{\RelNatJoin}{\RelNatJoin} +\newcommand{\RelNJoin}{\RelNJoin} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % division operators @@ -85,33 +85,34 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % aggregate functions -\newcommand{\RelSum}[1]{\ensuremath{\mathcal{G}_{\mathbf{\mathrm{sum}}(#1)}}} -\newcommand{\RelAvg}[1]{\ensuremath{\mathcal{G}_{\mathbf{\mathrm{avg}}(#1)}}} -\newcommand{\RelMin}[1]{\ensuremath{\mathcal{G}_{\mathbf{\mathrm{min}}(#1)}}} -\newcommand{\RelMax}[1]{\ensuremath{\mathcal{G}_{\mathbf{\mathrm{max}}(#1)}}} -\newcommand{\RelCount}[1]{\ensuremath{\mathcal{G}_{\mathbf{\mathrm{count}}(#1)}}} +\newcommand{\RelAggregrate}[2]{\ensuremath{\mathcal{G}_{\mathbf{\mathrm{#1}}(#2)}}} +\newcommand{\RelSum}[1]{\RelAggregrate{sum}{#1}} +\newcommand{\RelAvg}[1]{\RelAggregrate{avg}{#1}} +\newcommand{\RelMin}[1]{\RelAggregrate{min}{#1}} +\newcommand{\RelMax}[1]{\RelAggregrate{max}{#1}} +\newcommand{\RelCount}[1]{\RelAggregrate{count}{#1}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % outer join operators % Note: can't use \ensuremath in these because it screws up the spacing. % The $ are OK though because they're used inside hboxes anyway. \newcommand{\RelLeftOuterJoin}{\scalebox{0.5}[1]{$\sqsupset$}\mkern-2.5mu\lower0.1em\hbox{$\Join$}} -\newcommand{\RelleftOuterJoin}{\LeftOuterJoin} -\newcommand{\RelLOuterJoin}{\LeftOuterJoin} -\newcommand{\RelLeftOuter}{\LeftOuterJoin} -\newcommand{\RelLOJ}{\LeftOuterJoin} +\newcommand{\RelleftOuterJoin}{\RelLeftOuterJoin} +\newcommand{\RelLOuterJoin}{\RelLeftOuterJoin} +\newcommand{\RelLeftOuter}{\RelLeftOuterJoin} +\newcommand{\RelLOJ}{\RelLeftOuterJoin} \newcommand{\RelRightOuterJoin}{\lower0.1em\hbox{$\Join$}\mkern-2.5mu\scalebox{0.5}[1]{$\sqsubset$}} -\newcommand{\RelrightOuterJoin}{\RightOuterJoin} -\newcommand{\RelROuterJoin}{\RightOuterJoin} -\newcommand{\RelRightOuter}{\RightOuterJoin} -\newcommand{\RelROJ}{\RightOuterJoin} +\newcommand{\RelrightOuterJoin}{\RelRightOuterJoin} +\newcommand{\RelROuterJoin}{\RelRightOuterJoin} +\newcommand{\RelRightOuter}{\RelRightOuterJoin} +\newcommand{\RelROJ}{\RelRightOuterJoin} \newcommand{\RelFullOuterJoin}{\scalebox{0.5}[1]{$\sqsupset$}\mkern-2.5mu\lower0.1em\hbox{$\Join$}\mkern-2.5mu\scalebox{0.5}[1]{$\sqsubset$}} -\newcommand{\RelfullOuterJoin}{\FullOuterJoin} -\newcommand{\RelFOuterJoin}{\FullOuterJoin} -\newcommand{\RelFullOuter}{\FullOuterJoin} -\newcommand{\RelFOJ}{\FullOuterJoin} +\newcommand{\RelfullOuterJoin}{\RelFullOuterJoin} +\newcommand{\RelFOuterJoin}{\RelFullOuterJoin} +\newcommand{\RelFullOuter}{\RelFullOuterJoin} +\newcommand{\RelFOJ}{\RelFullOuterJoin} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -137,6 +138,9 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % $Log$ +% Revision 1.8 2010/12/12 04:40:39 nstanger +% - Added extend operator. +% % Revision 1.7 2010/12/12 01:25:19 nstanger % - Normalised the logical AND/OR macros. %