\begin{frame} \frametitle{Other Constraints} \begin{exampleblock}{Solution 1} We could have separate tables for correct and wrong answers: \begin{itemize} \item CorrectAnswers(\key{question}, answer, text) \item WrongAnswers(\key{question, answer}, text) \end{itemize} Observe that the key in CorrectAnswers ensures that there is only one correct answer per question. \pause\smallskip However, requires a new inter-relational constraint: the same question with the same answer may not appear in both tables. \end{exampleblock} \pause \begin{exampleblock}{Solution 2} We could have separate tables for correct and wrong answers: \begin{itemize} \item Questions((\key{question}, correctAnswer) $\to$ Answers, text) \item Answers(\key{question} $\to$ Questions, \key{\vphantom{q}answer}, text) \end{itemize} Here the correct answer is indicated via a foreign key in Questions referencing the Answers table. \end{exampleblock} \end{frame}