10/72
\begin{frame}
  \frametitle{Representing Relationship Sets}

  \begin{goal}{}
    A many-to-many \emph{relationship set} becomes a table with
    \begin{itemize}
      \item columns for the attributes of the relationship, and
      \item for the primary keys of the participating entity sets.
    \end{itemize}
  \end{goal}
  \medskip
  \pause
  
  \begin{center}
    \scalebox{.92}{
    \begin{tikzpicture}[every edge/.style={link}]
      \node[entity] (customer) {customer};
      \node[attribute] (id) [above left of=customer,node distance=1.7cm,shift={(-2mm,-3mm)}] {\key{id}} edge (customer);
      \node[attribute] (name) [above of=customer,node distance=1.3cm] {name} edge (customer);
      \node[attribute] (street) [left of=customer,node distance=2.1cm] {street} edge (customer);
      \node[attribute] (city) [below left of=customer,node distance=1.7cm] {city} edge (customer);

      \node[entity,right of=customer, node distance=6cm] (loan) {loan};
      \node[attribute] (loan-number) [above of=loan,node distance=1.2cm] {\key{loan-number}} edge (loan);
      \node[attribute] (amount) [below right of=loan,node distance=1.7cm,xshift=-5mm] {amount} edge (loan);

      \node[relationship] (does) at ($(customer)!.5!(loan)$) {borrower} 
        edge node [above,pos=.6] {1\sldots N} (customer) 
        edge node [above,pos=.6] {0\sldots M} (loan);
    \end{tikzpicture}}
  \end{center}

  \centering{\small\ttfamily
    \colorbox{rellight}{%
      \begin{tabular}[t]{|r|r|}
        \multicolumn{2}{c}{borrower}        \\ \hline
        \hd{\key{id}} & \hd{\key{loan-number}} \\ \hline 
        12-0202 & L-11 \\
        01-1823 & L-14 \\
        22-7361 & L-17 \\
        05-1912 & L-20 \\
        \hline
      \end{tabular}%
    }}
\end{frame}