274/291
\begin{frame}
  \frametitle{Examples}

  \begin{goal}{}
    Violations of BCNF might also be due to the \emph{wrong
    placement of an attribute}.
  \end{goal}

  \begin{exampleblock}{Questionable attribute placement}
    \begin{tcenter}
      \scalebox{.9}{
      \begin{tikzpicture}[every edge/.style={link}]
        \node[entity] (student) {Students};
        \node[entity,xshift=70mm] (course) {Courses};
        
        \node[attribute] [at=(student),shift={(-1cm,1cm)}] {\key{studentId}} edge (student);
        \node[attribute] [at=(course),shift={(1cm,1cm)}] {\key{courseNr}} edge (course);

        \node[relationship] at($(student)!.5!(course)$) (takes) {takes}
          edge node [pos=.7,above] {$0..*$} (student)
          edge node [pos=.7,above] {$0..*$} (course);

        \node[attribute] [at=(takes),shift={(0cm,1.4cm)}] {email} edge (takes);
      \end{tikzpicture}
      }
    \end{tcenter}
    
    \begin{itemize}
    \pause
    \item The relationship is translated into
      \begin{tcenter}
        $
        \sql{Takes(\underline{studentId}, \underline{courseNr}, email)}
        $
      \end{tcenter}
    \pause
    \item Then the FD $\sql{studentId} \to \sql{email}$ violates BCNF.
    \pause
    \item Obviously, email should be an attribute of Students.
    \end{itemize}
  \end{exampleblock}
\end{frame}