185/291
\begin{frame}
  \frametitle{Splitting Relations}
  
  \begin{goal}{}
    If a table $R$ is not in BCNF, we can \emph{split} it into two tables. 
  \end{goal}
  \pause
  
  The violating FD determines how to split:
  \begin{goal}{Table Decomposition}
    If the FD $A_1, \dots, A_n \to B_1, \dots B_m$ violates BCNF:
    \begin{itemize}
      \item create a new relation $S (\underline{A_1}, \dots, \underline{A_n}, B_1, \dots, B_m)$ and 
      \item remove $B_1, \dots, B_m$ from the original relation $R$.
    \end{itemize}
  \end{goal}
  \pause
    
  \begin{exampleblock}{}
    The table
    \begin{tcenter}
      $\sql{Courses(\underline{courseNr}, title, instructor, phone)}$
    \end{tcenter}
    violates BCNF because of $\sql{instructor} \to \sql{phone}$. 
    \pause\medskip
    
    We split into:
    \pause
    \begin{tcenter}
      $
      \begin{array}{c}
        \sql{Courses(\underline{courseNr}, title, instructor)} \\
        \sql{Instructors(\underline{instructor}, phone)}%
      \end{array}
      $
    \end{tcenter}    
  \end{exampleblock}
\end{frame}