summaryrefslogtreecommitdiff
path: root/Homework/cs5800/Homeworks
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2026-07-02 11:55:17 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2026-07-02 11:55:17 -0700
commit6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6 (patch)
treeed97e39ec77c5231ffd2c394493e68d00ddac5a4 /Homework/cs5800/Homeworks
downloadmisc-undergrad-6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6.tar.gz
misc-undergrad-6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6.zip
Diffstat (limited to 'Homework/cs5800/Homeworks')
-rw-r--r--Homework/cs5800/Homeworks/hw-3.org64
-rw-r--r--Homework/cs5800/Homeworks/hw-3.pdfbin0 -> 100761 bytes
-rw-r--r--Homework/cs5800/Homeworks/hw-3.tex114
-rw-r--r--Homework/cs5800/Homeworks/hw-4.html311
-rw-r--r--Homework/cs5800/Homeworks/hw-4.org90
-rw-r--r--Homework/cs5800/Homeworks/hw-4.pdfbin0 -> 53232 bytes
-rw-r--r--Homework/cs5800/Homeworks/hw-4.tex131
-rw-r--r--Homework/cs5800/Homeworks/hw-6.org35
-rw-r--r--Homework/cs5800/Homeworks/hw-6.pdfbin0 -> 122134 bytes
-rw-r--r--Homework/cs5800/Homeworks/hw-6.tex69
-rw-r--r--Homework/cs5800/Homeworks/img/employee-departments-phones.pngbin0 -> 13353 bytes
-rw-r--r--Homework/cs5800/Homeworks/img/representatives.pngbin0 -> 43705 bytes
-rw-r--r--Homework/cs5800/Homeworks/img/teaches-course-text.pngbin0 -> 10501 bytes
13 files changed, 814 insertions, 0 deletions
diff --git a/Homework/cs5800/Homeworks/hw-3.org b/Homework/cs5800/Homeworks/hw-3.org
new file mode 100644
index 0000000..acd377e
--- /dev/null
+++ b/Homework/cs5800/Homeworks/hw-3.org
@@ -0,0 +1,64 @@
+#+TITLE: Homework 3
+#+AUTHOR: Logan Hunt
+#+STARTUP: fold inlineimages
+#+OPTIONS: toc:nil
+#+LATEX_HEADER: \usepackage{amsfonts} \usepackage{amssymb} \usepackage{mathtools} \usepackage{ upgreek } \usepackage{ textcomp }
+
+* Question 1 (3.21)
+[[./img/representatives.png]]
+
+The state and congress_person entities are just what was given in the requirements.
+
+The relation between them - represent - describes which congress people are representatives in a certain state. The homework assumptions include the fact that a state has at most 53 representative congress people, and at minimum one. On the other side of the relationship, a congress person can only be a representative in one state.
+
+Additionally, the bill entity was constructed from the requirements, and the relation "vote" describes, in addition with its own property "decision" which keeps the vote type from the congress person, the votes of each congress person.
+As there are $m$ bills, each congress person is required to have $m$ votes, and each bill must have 435 votes from congress people.
+
+Finally, a congress person sponsors either none or all of the bills ($m$), and each bill needs at least 1 sponsor and a maximum of 435.
+* Question 2 (3.23)
+** a) Strong Entities
++ Bank
++ Loan
++ Account
++ Customer
+
+** b) Weak Entities
++ Bank branch
+ - Partial key: Branch Number
+ - Identifying relationship: "Branches"
+
+** c) Constraints
++ The participation of Bank-Branch in Branches is a total participation.
++ Cardinality ratio from bank to branches is 1:N.
+
+** d) Relationships
++ Bank (1,n) <=Branches=> (1,1) Bank-Branch. A bank has at least one branch and a branch is only of one bank, hence the (1,1).
++ Bank-Branch (0,n) <=Accts=> (1,1) Account. A bank branch can have none or any number of accounts opened in it, but an account can only opened in one branch.
++ Acccount (1,n) <=A-C=> (0,m) Customer. An account can be owned by at least one customer (a joint account for married individuals is an example of more than one), and a customer can own either none or any number of accounts.
++ Bank-Branch (0,n) <=Loans=> (1,1) Loan. A bank branch can have none or any number of loans taken out in it, but a loan can only be taken out in one branch.
++ Loan (1,n) <=L-C=> (0,m) Customer.
+
+** e) Requirements
+A bank is an entity with a unique code, a name, and address. A bank must have one or more branches at some address. Together with the bank's code and branch number, a branch can be uniquely identified.
+
+Branches have the ability to create accounts of any account type, and also have a tracking balance and unique account number. Any number of customers can participate in owning the account, but it must be at least one customer. However some customers may end up with no accounts.
+
+Customers also have the ability to take out any number of loans, with an amount lent and type of loan included with a unique loan number, including zero. However, any loan that is taken out must have at least one customer owning it.
+
+** f) Further Restrictions
+To support only letting a customer take out two loans at a time, the relation L-C should be updated: Loan (1,n) <=L-C=> (0,2) Customer.
+
+To support only letting a branch take out a maximum of 1000 loans at a time, the relation Loans should be updated: Bank-Branch (0,1000) <=Loans=> (1,1) Loan.
+
+* Question 3 (3.24)
+[[./img/employee-departments-phones.png]]
+
+If each of every employee's has-phone relationship is fully contained in the employee's departments then the two relationships has-phone and contains are redundant because one could query all the departments an employee works for to get that employee's "phones".
+
+* Question 4 (3.25)
+
+[[./img/teaches-course-text.png]]
+
+A ternary relationship would not fit because a text can only be used in one course and a course can only be instructed by one instructor.
+
+Adopts would have the following cardinality constraint: Instructor (0, 20) <=Adopt=> (1,1) Text - as an instructor can teach two to four courses and each course can have 0 to 5 texts, an instructor can end up adopting 0 texts, or 5 unique texts for all 4 of their courses. But, as a text can only have one course, and a course can only be taught by one teacher, a text must be adopted by one and only one teacher.
diff --git a/Homework/cs5800/Homeworks/hw-3.pdf b/Homework/cs5800/Homeworks/hw-3.pdf
new file mode 100644
index 0000000..e8df7c2
--- /dev/null
+++ b/Homework/cs5800/Homeworks/hw-3.pdf
Binary files differ
diff --git a/Homework/cs5800/Homeworks/hw-3.tex b/Homework/cs5800/Homeworks/hw-3.tex
new file mode 100644
index 0000000..184506f
--- /dev/null
+++ b/Homework/cs5800/Homeworks/hw-3.tex
@@ -0,0 +1,114 @@
+% Created 2022-09-28 Wed 22:36
+% Intended LaTeX compiler: pdflatex
+\documentclass[11pt]{article}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{graphicx}
+\usepackage{longtable}
+\usepackage{wrapfig}
+\usepackage{rotating}
+\usepackage[normalem]{ulem}
+\usepackage{amsmath}
+\usepackage{amssymb}
+\usepackage{capt-of}
+\usepackage{hyperref}
+\usepackage{amsfonts} \usepackage{amssymb} \usepackage{mathtools} \usepackage{ upgreek } \usepackage{ textcomp }
+\author{Logan Hunt}
+\date{\today}
+\title{Homework 3}
+\hypersetup{
+ pdfauthor={Logan Hunt},
+ pdftitle={Homework 3},
+ pdfkeywords={},
+ pdfsubject={},
+ pdfcreator={Emacs 28.2 (Org mode 9.5.5)},
+ pdflang={English}}
+\begin{document}
+
+\maketitle
+
+\section{Question 1 (3.21)}
+\label{sec:orge5708f1}
+\begin{center}
+\includegraphics[width=.9\linewidth]{./img/representatives.png}
+\end{center}
+
+The state and congress\textsubscript{person} entities are just what was given in the requirements.
+
+The relation between them - represent - describes which congress people are representatives in a certain state. The homework assumptions include the fact that a state has at most 53 representative congress people, and at minimum one. On the other side of the relationship, a congress person can only be a representative in one state.
+
+Additionally, the bill entity was constructed from the requirements, and the relation "vote" describes, in addition with its own property "decision" which keeps the vote type from the congress person, the votes of each congress person.
+As there are \(m\) bills, each congress person is required to have \(m\) votes, and each bill must have 435 votes from congress people.
+
+Finally, a congress person sponsors either none or all of the bills (\(m\)), and each bill needs at least 1 sponsor and a maximum of 435.
+\section{Question 2 (3.23)}
+\label{sec:orgb0cbc0f}
+\subsection{a) Strong Entities}
+\label{sec:orge85bbf3}
+\begin{itemize}
+\item Bank
+\item Loan
+\item Account
+\item Customer
+\end{itemize}
+
+\subsection{b) Weak Entities}
+\label{sec:org5ae462d}
+\begin{itemize}
+\item Bank branch
+\begin{itemize}
+\item Partial key: Branch Number
+\item Identifying relationship: "Branches"
+\end{itemize}
+\end{itemize}
+
+\subsection{c) Constraints}
+\label{sec:org7162d84}
+\begin{itemize}
+\item The participation of Bank-Branch in Branches is a total participation.
+\item Cardinality ratio from bank to branches is 1:N.
+\end{itemize}
+
+\subsection{d) Relationships}
+\label{sec:org5fbbd4e}
+\begin{itemize}
+\item Bank (1,n) <=Branches=> (1,1) Bank-Branch. A bank has at least one branch and a branch is only of one bank, hence the (1,1).
+\item Bank-Branch (0,n) <=Accts=> (1,1) Account. A bank branch can have none or any number of accounts opened in it, but an account can only opened in one branch.
+\item Acccount (1,n) <=A-C=> (0,m) Customer. An account can be owned by at least one customer (a joint account for married individuals is an example of more than one), and a customer can own either none or any number of accounts.
+\item Bank-Branch (0,n) <=Loans=> (1,1) Loan. A bank branch can have none or any number of loans taken out in it, but a loan can only be taken out in one branch.
+\item Loan (1,n) <=L-C=> (0,m) Customer.
+\end{itemize}
+
+\subsection{e) Requirements}
+\label{sec:org0cce2c4}
+A bank is an entity with a unique code, a name, and address. A bank must have one or more branches at some address. Together with the bank's code and branch number, a branch can be uniquely identified.
+
+Branches have the ability to create accounts of any account type, and also have a tracking balance and unique account number. Any number of customers can participate in owning the account, but it must be at least one customer. However some customers may end up with no accounts.
+
+Customers also have the ability to take out any number of loans, with an amount lent and type of loan included with a unique loan number, including zero. However, any loan that is taken out must have at least one customer owning it.
+
+\subsection{f) Further Restrictions}
+\label{sec:orgc3396fe}
+To support only letting a customer take out two loans at a time, the relation L-C should be updated: Loan (1,n) <=L-C=> (0,2) Customer.
+
+To support only letting a branch take out a maximum of 1000 loans at a time, the relation Loans should be updated: Bank-Branch (0,1000) <=Loans=> (1,1) Loan.
+
+\section{Question 3 (3.24)}
+\label{sec:org4cdca4d}
+\begin{center}
+\includegraphics[width=.9\linewidth]{./img/employee-departments-phones.png}
+\end{center}
+
+If each of every employee's has-phone relationship is fully contained in the employee's departments then the two relationships has-phone and contains are redundant because one could query all the departments an employee works for to get that employee's "phones".
+
+\section{Question 4 (3.25)}
+\label{sec:org8a15543}
+
+\begin{center}
+\includegraphics[width=.9\linewidth]{./img/teaches-course-text.png}
+\end{center}
+
+A ternary relationship would not fit because a text can only be used in one course and a course can only be instructed by one instructor.
+
+Adopts would have the following cardinality constraint: Instructor (0, 20) <=Adopt=> (1,1) Text - as an instructor can teach two to four courses and each course can have 0 to 5 texts, an instructor can end up adopting 0 texts, or 5 unique texts for all 4 of their courses. But, as a text can only have one course, and a course can only be taught by one teacher, a text must be adopted by one and only one teacher.
+\end{document} \ No newline at end of file
diff --git a/Homework/cs5800/Homeworks/hw-4.html b/Homework/cs5800/Homeworks/hw-4.html
new file mode 100644
index 0000000..b89d2b8
--- /dev/null
+++ b/Homework/cs5800/Homeworks/hw-4.html
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<!-- 2022-10-08 Sat 18:41 -->
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Homework 4</title>
+<meta name="author" content="Logan Hunt" />
+<meta name="generator" content="Org Mode" />
+<style>
+ #content { max-width: 60em; margin: auto; }
+ .title { text-align: center;
+ margin-bottom: .2em; }
+ .subtitle { text-align: center;
+ font-size: medium;
+ font-weight: bold;
+ margin-top:0; }
+ .todo { font-family: monospace; color: red; }
+ .done { font-family: monospace; color: green; }
+ .priority { font-family: monospace; color: orange; }
+ .tag { background-color: #eee; font-family: monospace;
+ padding: 2px; font-size: 80%; font-weight: normal; }
+ .timestamp { color: #bebebe; }
+ .timestamp-kwd { color: #5f9ea0; }
+ .org-right { margin-left: auto; margin-right: 0px; text-align: right; }
+ .org-left { margin-left: 0px; margin-right: auto; text-align: left; }
+ .org-center { margin-left: auto; margin-right: auto; text-align: center; }
+ .underline { text-decoration: underline; }
+ #postamble p, #preamble p { font-size: 90%; margin: .2em; }
+ p.verse { margin-left: 3%; }
+ pre {
+ border: 1px solid #e6e6e6;
+ border-radius: 3px;
+ background-color: #f2f2f2;
+ padding: 8pt;
+ font-family: monospace;
+ overflow: auto;
+ margin: 1.2em;
+ }
+ pre.src {
+ position: relative;
+ overflow: auto;
+ }
+ pre.src:before {
+ display: none;
+ position: absolute;
+ top: -8px;
+ right: 12px;
+ padding: 3px;
+ color: #555;
+ background-color: #f2f2f299;
+ }
+ pre.src:hover:before { display: inline; margin-top: 14px;}
+ /* Languages per Org manual */
+ pre.src-asymptote:before { content: 'Asymptote'; }
+ pre.src-awk:before { content: 'Awk'; }
+ pre.src-authinfo::before { content: 'Authinfo'; }
+ pre.src-C:before { content: 'C'; }
+ /* pre.src-C++ doesn't work in CSS */
+ pre.src-clojure:before { content: 'Clojure'; }
+ pre.src-css:before { content: 'CSS'; }
+ pre.src-D:before { content: 'D'; }
+ pre.src-ditaa:before { content: 'ditaa'; }
+ pre.src-dot:before { content: 'Graphviz'; }
+ pre.src-calc:before { content: 'Emacs Calc'; }
+ pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
+ pre.src-fortran:before { content: 'Fortran'; }
+ pre.src-gnuplot:before { content: 'gnuplot'; }
+ pre.src-haskell:before { content: 'Haskell'; }
+ pre.src-hledger:before { content: 'hledger'; }
+ pre.src-java:before { content: 'Java'; }
+ pre.src-js:before { content: 'Javascript'; }
+ pre.src-latex:before { content: 'LaTeX'; }
+ pre.src-ledger:before { content: 'Ledger'; }
+ pre.src-lisp:before { content: 'Lisp'; }
+ pre.src-lilypond:before { content: 'Lilypond'; }
+ pre.src-lua:before { content: 'Lua'; }
+ pre.src-matlab:before { content: 'MATLAB'; }
+ pre.src-mscgen:before { content: 'Mscgen'; }
+ pre.src-ocaml:before { content: 'Objective Caml'; }
+ pre.src-octave:before { content: 'Octave'; }
+ pre.src-org:before { content: 'Org mode'; }
+ pre.src-oz:before { content: 'OZ'; }
+ pre.src-plantuml:before { content: 'Plantuml'; }
+ pre.src-processing:before { content: 'Processing.js'; }
+ pre.src-python:before { content: 'Python'; }
+ pre.src-R:before { content: 'R'; }
+ pre.src-ruby:before { content: 'Ruby'; }
+ pre.src-sass:before { content: 'Sass'; }
+ pre.src-scheme:before { content: 'Scheme'; }
+ pre.src-screen:before { content: 'Gnu Screen'; }
+ pre.src-sed:before { content: 'Sed'; }
+ pre.src-sh:before { content: 'shell'; }
+ pre.src-sql:before { content: 'SQL'; }
+ pre.src-sqlite:before { content: 'SQLite'; }
+ /* additional languages in org.el's org-babel-load-languages alist */
+ pre.src-forth:before { content: 'Forth'; }
+ pre.src-io:before { content: 'IO'; }
+ pre.src-J:before { content: 'J'; }
+ pre.src-makefile:before { content: 'Makefile'; }
+ pre.src-maxima:before { content: 'Maxima'; }
+ pre.src-perl:before { content: 'Perl'; }
+ pre.src-picolisp:before { content: 'Pico Lisp'; }
+ pre.src-scala:before { content: 'Scala'; }
+ pre.src-shell:before { content: 'Shell Script'; }
+ pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
+ /* additional language identifiers per "defun org-babel-execute"
+ in ob-*.el */
+ pre.src-cpp:before { content: 'C++'; }
+ pre.src-abc:before { content: 'ABC'; }
+ pre.src-coq:before { content: 'Coq'; }
+ pre.src-groovy:before { content: 'Groovy'; }
+ /* additional language identifiers from org-babel-shell-names in
+ ob-shell.el: ob-shell is the only babel language using a lambda to put
+ the execution function name together. */
+ pre.src-bash:before { content: 'bash'; }
+ pre.src-csh:before { content: 'csh'; }
+ pre.src-ash:before { content: 'ash'; }
+ pre.src-dash:before { content: 'dash'; }
+ pre.src-ksh:before { content: 'ksh'; }
+ pre.src-mksh:before { content: 'mksh'; }
+ pre.src-posh:before { content: 'posh'; }
+ /* Additional Emacs modes also supported by the LaTeX listings package */
+ pre.src-ada:before { content: 'Ada'; }
+ pre.src-asm:before { content: 'Assembler'; }
+ pre.src-caml:before { content: 'Caml'; }
+ pre.src-delphi:before { content: 'Delphi'; }
+ pre.src-html:before { content: 'HTML'; }
+ pre.src-idl:before { content: 'IDL'; }
+ pre.src-mercury:before { content: 'Mercury'; }
+ pre.src-metapost:before { content: 'MetaPost'; }
+ pre.src-modula-2:before { content: 'Modula-2'; }
+ pre.src-pascal:before { content: 'Pascal'; }
+ pre.src-ps:before { content: 'PostScript'; }
+ pre.src-prolog:before { content: 'Prolog'; }
+ pre.src-simula:before { content: 'Simula'; }
+ pre.src-tcl:before { content: 'tcl'; }
+ pre.src-tex:before { content: 'TeX'; }
+ pre.src-plain-tex:before { content: 'Plain TeX'; }
+ pre.src-verilog:before { content: 'Verilog'; }
+ pre.src-vhdl:before { content: 'VHDL'; }
+ pre.src-xml:before { content: 'XML'; }
+ pre.src-nxml:before { content: 'XML'; }
+ /* add a generic configuration mode; LaTeX export needs an additional
+ (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
+ pre.src-conf:before { content: 'Configuration File'; }
+
+ table { border-collapse:collapse; }
+ caption.t-above { caption-side: top; }
+ caption.t-bottom { caption-side: bottom; }
+ td, th { vertical-align:top; }
+ th.org-right { text-align: center; }
+ th.org-left { text-align: center; }
+ th.org-center { text-align: center; }
+ td.org-right { text-align: right; }
+ td.org-left { text-align: left; }
+ td.org-center { text-align: center; }
+ dt { font-weight: bold; }
+ .footpara { display: inline; }
+ .footdef { margin-bottom: 1em; }
+ .figure { padding: 1em; }
+ .figure p { text-align: center; }
+ .equation-container {
+ display: table;
+ text-align: center;
+ width: 100%;
+ }
+ .equation {
+ vertical-align: middle;
+ }
+ .equation-label {
+ display: table-cell;
+ text-align: right;
+ vertical-align: middle;
+ }
+ .inlinetask {
+ padding: 10px;
+ border: 2px solid gray;
+ margin: 10px;
+ background: #ffffcc;
+ }
+ #org-div-home-and-up
+ { text-align: right; font-size: 70%; white-space: nowrap; }
+ textarea { overflow-x: auto; }
+ .linenr { font-size: smaller }
+ .code-highlighted { background-color: #ffff00; }
+ .org-info-js_info-navigation { border-style: none; }
+ #org-info-js_console-label
+ { font-size: 10px; font-weight: bold; white-space: nowrap; }
+ .org-info-js_search-highlight
+ { background-color: #ffff00; color: #000000; font-weight: bold; }
+ .org-svg { }
+</style>
+</head>
+<body>
+<div id="content" class="content">
+<h1 class="title">Homework 4</h1>
+<div id="table-of-contents" role="doc-toc">
+<h2>Table of Contents</h2>
+<div id="text-table-of-contents" role="doc-toc">
+<ul>
+<li><a href="#org9064b3f">1. Question One</a></li>
+<li><a href="#orgb7b028b">2. Question Two</a></li>
+<li><a href="#org9ad8b30">3. Question Three</a></li>
+<li><a href="#org0b8ba7c">4. Question Four</a></li>
+<li><a href="#orgc06dbaa">5. Question Five</a></li>
+<li><a href="#org1205c21">6. Question Six</a></li>
+<li><a href="#org01c7e07">7. Question Seven</a></li>
+</ul>
+</div>
+</div>
+
+<div id="outline-container-org9064b3f" class="outline-2">
+<h2 id="org9064b3f"><span class="section-number-2">1.</span> Question One</h2>
+<div class="outline-text-2" id="text-1">
+<p>
+The number of super keys here is the cardinality of the set of all sets of attributes that contain at least the clientId. In this case, that's:
+</p>
+
+<ol class="org-ol">
+<li>(clientId)</li>
+<li>(clientId, name)</li>
+<li>(clientId, phone)</li>
+<li>(clientId, address)</li>
+<li>(clientId, name, phone)</li>
+<li>(clientId, name, address)</li>
+<li>(clientId, phone, address)</li>
+<li>(clientId, name, phone, address)</li>
+</ol>
+
+<p>
+Therefore there are eight super keys.
+</p>
+</div>
+</div>
+
+<div id="outline-container-orgb7b028b" class="outline-2">
+<h2 id="orgb7b028b"><span class="section-number-2">2.</span> Question Two</h2>
+<div class="outline-text-2" id="text-2">
+<p>
+There is only one primary key which is the collection of (clientId, empId, packageId).
+</p>
+</div>
+</div>
+
+<div id="outline-container-org9ad8b30" class="outline-2">
+<h2 id="org9ad8b30"><span class="section-number-2">3.</span> Question Three</h2>
+<div class="outline-text-2" id="text-3">
+<p>
+Salesman has two candidate keys empId and name, if we assume that each salesperson has a unique name. If not, then empId is the only candidate key (and also in this design, the primary key!).
+</p>
+</div>
+</div>
+
+<div id="outline-container-org0b8ba7c" class="outline-2">
+<h2 id="org0b8ba7c"><span class="section-number-2">4.</span> Question Four</h2>
+<div class="outline-text-2" id="text-4">
+<div class="org-src-container">
+<pre class="src src-sql">select clientId, name, phone, address from Client where name="Peter Smith";
+</pre>
+</div>
+</div>
+</div>
+
+<div id="outline-container-orgc06dbaa" class="outline-2">
+<h2 id="orgc06dbaa"><span class="section-number-2">5.</span> Question Five</h2>
+<div class="outline-text-2" id="text-5">
+<div class="org-src-container">
+<pre class="src src-sql">select videoCode from Video where videoLength &lt; 2;
+</pre>
+</div>
+</div>
+</div>
+
+<div id="outline-container-org1205c21" class="outline-2">
+<h2 id="org1205c21"><span class="section-number-2">6.</span> Question Six</h2>
+<div class="outline-text-2" id="text-6">
+<p>
+Making the assumption that all addresses are formatted as "&lt;street no&gt; &lt;street address&gt;". For example "12345 John Blvd":
+</p>
+
+<div class="org-src-container">
+<pre class="src src-sql">select siteCode, type, address, phone from Site where right(address, locate(' ', address)-1) = "University Dr";
+</pre>
+</div>
+</div>
+</div>
+
+<div id="outline-container-org01c7e07" class="outline-2">
+<h2 id="org01c7e07"><span class="section-number-2">7.</span> Question Seven</h2>
+<div class="outline-text-2" id="text-7">
+<p>
+Assuming a siteCode of one:
+</p>
+
+<div class="org-src-container">
+<pre class="src src-sql">select administrator.empId, administrator.name, administrator.gender from administers join administrator on administrator.empId=administers.empId where siteCode=1;
+</pre>
+</div>
+</div>
+</div>
+</div>
+<div id="postamble" class="status">
+<p class="author">Author: Logan Hunt</p>
+<p class="date">Created: 2022-10-08 Sat 18:41</p>
+<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
+</div>
+</body>
+</html>
diff --git a/Homework/cs5800/Homeworks/hw-4.org b/Homework/cs5800/Homeworks/hw-4.org
new file mode 100644
index 0000000..3c6f8ba
--- /dev/null
+++ b/Homework/cs5800/Homeworks/hw-4.org
@@ -0,0 +1,90 @@
+#+TITLE: Homework 4
+#+AUTHOR: Logan Hunt
+#+DATE: October 8, 20222
+
+* Question One
+The number of super keys is the cardinality of the set of tuples of attributes that contain at least the clientId. In this case, that is:
+
+1. ~(clientId)~
+2. ~(clientId, name)~
+3. ~(clientId, phone)~
+4. ~(clientId, address)~
+5. ~(clientId, name, phone)~
+6. ~(clientId, name, address)~
+7. ~(clientId, phone, address)~
+8. ~(clientId, name, phone, address)~
+
+Therefore there are eight super keys.
+
+* Question Two
+There is only one primary key which is ~(clientId, empId, packageId)~.
+
+* Question Three
+Salesman has two candidate keys empId and name, if we assume that each salesperson has a unique name. If not, then empId is the only candidate key (therefore, the primary key!).
+
+* Question Four
+#+BEGIN_SRC sql
+select clientId, name, phone, address from Client where name="Peter Smith";
+#+END_SRC
+
+* Question Five
+#+BEGIN_SRC sql
+select videoCode from Video where videoLength < 2;
+#+END_SRC
+
+* Question Six
+Making the assumption that all addresses are formatted as "<street no> <street address>". For example "12345 John Blvd":
+
+#+BEGIN_SRC sql
+select siteCode, type, address, phone from Site
+ where right(address, locate(' ', address)-1) = "University Dr";
+#+END_SRC
+
+* Question Seven
+#+BEGIN_SRC sql
+select administrator.empId, administrator.name, administrator.gender from administers
+ join administrator on administrator.empId=administers.empId
+ where siteCode=111;
+#+END_SRC
+
+* Question Eight
+#+BEGIN_SRC sql
+select salesman.empId, client.clientId, client.name, client.phone from client
+ join purchases on purchases.clientId = client.clientId
+ join salesman on salesman.empId = purchases.empId
+ where salesman.name="John";
+#+END_SRC
+
+* Question Nine
+#+BEGIN_SRC sql
+select digital_display.serialNo from digital_display
+ join locates on locates.serialNo=digital_display.serialNo
+ join site on site.siteCode=locates.siteCode
+ where site.siteCode = 112;
+#+END_SRC
+
+* Question Ten
+#+BEGIN_SRC sql
+select distinct(digital_display.schedulerSystem) from digital_display
+ join locates on locates.serialNo=digital_display.serialNo
+ join site on site.siteCode=locates.siteCode
+ where site.siteCode = 112;
+#+END_SRC
+
+* Question Eleven
+#+BEGIN_SRC sql
+select * from model where screenSize > 10 and weight < 3
+#+END_SRC
+
+* Question Twelve
+#+BEGIN_SRC sql
+select digital_display.serialNo, digitial_display.modelNo, digitial_display.schedulerSystem from digitial_display
+ join locates on locates.serialNo=digital_display.serialNo
+ join site on site.siteCode=locates.siteCode
+ where site.type="bar";
+#+END_SRC
+
+* Question Thirteen
+#+BEGIN_SRC sql
+select empId, day from adm_work_hours where hours > 8;
+#+END_SRC sql
diff --git a/Homework/cs5800/Homeworks/hw-4.pdf b/Homework/cs5800/Homeworks/hw-4.pdf
new file mode 100644
index 0000000..d89c162
--- /dev/null
+++ b/Homework/cs5800/Homeworks/hw-4.pdf
Binary files differ
diff --git a/Homework/cs5800/Homeworks/hw-4.tex b/Homework/cs5800/Homeworks/hw-4.tex
new file mode 100644
index 0000000..c832828
--- /dev/null
+++ b/Homework/cs5800/Homeworks/hw-4.tex
@@ -0,0 +1,131 @@
+% Created 2022-10-31 Mon 14:58
+% Intended LaTeX compiler: pdflatex
+\documentclass[11pt]{article}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{graphicx}
+\usepackage{longtable}
+\usepackage{wrapfig}
+\usepackage{rotating}
+\usepackage[normalem]{ulem}
+\usepackage{amsmath}
+\usepackage{amssymb}
+\usepackage{capt-of}
+\usepackage{hyperref}
+\author{Logan Hunt}
+\date{\today}
+\title{Homework 4}
+\hypersetup{
+ pdfauthor={Logan Hunt},
+ pdftitle={Homework 4},
+ pdfkeywords={},
+ pdfsubject={},
+ pdfcreator={Emacs 28.2.50 (Org mode 9.5.5)},
+ pdflang={English}}
+\begin{document}
+
+\maketitle
+\tableofcontents
+
+
+\section{Question One}
+\label{sec:org7142899}
+The number of super keys is the cardinality of the set of tuples of attributes that contain at least the clientId. In this case, that is:
+
+\begin{enumerate}
+\item \texttt{(clientId)}
+\item \texttt{(clientId, name)}
+\item \texttt{(clientId, phone)}
+\item \texttt{(clientId, address)}
+\item \texttt{(clientId, name, phone)}
+\item \texttt{(clientId, name, address)}
+\item \texttt{(clientId, phone, address)}
+\item \texttt{(clientId, name, phone, address)}
+\end{enumerate}
+
+Therefore there are eight super keys.
+
+\section{Question Two}
+\label{sec:org808ee68}
+There is only one primary key which is \texttt{(clientId, empId, packageId)}.
+
+\section{Question Three}
+\label{sec:orgdde212d}
+Salesman has two candidate keys empId and name, if we assume that each salesperson has a unique name. If not, then empId is the only candidate key (therefore, the primary key!).
+
+\section{Question Four}
+\label{sec:org9bc5fbb}
+\begin{verbatim}
+select clientId, name, phone, address from Client where name="Peter Smith";
+\end{verbatim}
+
+\section{Question Five}
+\label{sec:orgaaa81c5}
+\begin{verbatim}
+select videoCode from Video where videoLength < 2;
+\end{verbatim}
+
+\section{Question Six}
+\label{sec:org55e6ae2}
+Making the assumption that all addresses are formatted as "<street no> <street address>". For example "12345 John Blvd":
+
+\begin{verbatim}
+select siteCode, type, address, phone from Site where right(address, locate(' ', address)-1) = "University Dr";
+\end{verbatim}
+
+\section{Question Seven}
+\label{sec:orgd1dc577}
+\begin{verbatim}
+select administrator.empId, administrator.name, administrator.gender from administers
+ join administrator on administrator.empId=administers.empId
+ where siteCode=111;
+\end{verbatim}
+
+\section{Question Eight}
+\label{sec:orgbaea177}
+\begin{verbatim}
+select salesman.empId, client.clientId, client.name, client.phone from client
+ join purchases on purchases.clientId = client.clientId
+ join salesman on salesman.empId = purchases.empId
+ where salesman.name="John";
+\end{verbatim}
+
+\section{Question Nine}
+\label{sec:org67a8ee6}
+\begin{verbatim}
+select digital_display.serialNo from digital_display
+ join locates on locates.serialNo=digital_display.serialNo
+ join site on site.siteCode=locates.siteCode
+ where site.siteCode = 112;
+\end{verbatim}
+
+\section{Question Ten}
+\label{sec:org3aed2a8}
+\begin{verbatim}
+select distinct(digital_display.schedulerSystem) from digital_display
+ join locates on locates.serialNo=digital_display.serialNo
+ join site on site.siteCode=locates.siteCode
+ where site.siteCode = 112;
+\end{verbatim}
+
+\section{Question Eleven}
+\label{sec:org8771b4d}
+\begin{verbatim}
+select * from model where screenSize > 10 and weight < 3
+\end{verbatim}
+
+\section{Question Twelve}
+\label{sec:org90164e0}
+\begin{verbatim}
+select digital_display.serialNo, digitial_display.modelNo, digitial_display.schedulerSystem from digitial_display
+ join locates on locates.serialNo=digital_display.serialNo
+ join site on site.siteCode=locates.siteCode
+ where site.type="bar";
+\end{verbatim}
+
+\section{Question Thirteen}
+\label{sec:org522e64a}
+\#+BEGIN\textsubscript{SRC} sql
+select empId, day from adm\textsubscript{work}\textsubscript{hours} where hours > 8;
+\#+END\textsubscript{SRC} sql
+\end{document} \ No newline at end of file
diff --git a/Homework/cs5800/Homeworks/hw-6.org b/Homework/cs5800/Homeworks/hw-6.org
new file mode 100644
index 0000000..0383c3f
--- /dev/null
+++ b/Homework/cs5800/Homeworks/hw-6.org
@@ -0,0 +1,35 @@
+#+TITLE: Homework 6
+#+AUTHOR: Logan Hunt
+#+LATEX_HEADER: \usepackage{amsfonts} \usepackage{amssymb} \usepackage{mathtools} \usepackage{ upgreek } \usepackage{ textcomp }
+#+OPTIONS: tex:t toc:nil inlineimages fold
+
+* Question One
+\sigma_(name='Peter Smith')(Client)
+
+* Question Two
+\sigma_(frequency > 5)(AirtimePackage)
+
+* Question Three
+\pi_(videoCode)(\sigma_(siteCode='S345')(Broadcasts))
+
+* Question Four
+\pi_(serialNo)(\sigma_(type='restaurant')(DigitalDisplay \bowtie_(serialNo=serialNo) Locates \bowtie_(siteCode=siteCode) Site))
+
+* Question Five
+\pi_(empId, name)(\sigma_(modelNo='M456781')(Specializes \bowtie_(empId=empId) TechnicalSupport))
+
+* Question Six
+\pi_(modelNo)(\sigma_(name='Peter')(Specializes \bowtie_(empId=empId) TechnicalSupport))
+
+* Question Seven
+\pi_(videoCode, videoLength)(Video \bowtie_(videoCode=videoCode)(\pi_(videoCode)(\sigma_(siteCode=111)(Broadcasts)) \minus \pi_(videoCode)(\sigma_(siteCode=112)(Broadcasts)))
+
+* Question Eight
+\pi_(name)(TechnicalSupport) \cup \pi_(name)(Administrator) \cup \pi_(name)(Salesman)
+
+* Question Nine
+\pi_(empId, name)(\sigma_(modelNo='MO1' AND siteCode=111)TechnicalSupport \bowtie_(empId=empId)(Specializes) \bowtie_(modelNo=modelNo)(DigitalDisplay) \bowtie_(serialNo=serialNo)(Locates))
+
+* Question Ten
+\pi_(empId, name)(SalesMan \minus \pi_(empId)(SalesMan \bowtie_(empId=empId) (Purchases)))
+
diff --git a/Homework/cs5800/Homeworks/hw-6.pdf b/Homework/cs5800/Homeworks/hw-6.pdf
new file mode 100644
index 0000000..6320399
--- /dev/null
+++ b/Homework/cs5800/Homeworks/hw-6.pdf
Binary files differ
diff --git a/Homework/cs5800/Homeworks/hw-6.tex b/Homework/cs5800/Homeworks/hw-6.tex
new file mode 100644
index 0000000..eec3bfe
--- /dev/null
+++ b/Homework/cs5800/Homeworks/hw-6.tex
@@ -0,0 +1,69 @@
+% Created 2022-11-26 Sat 14:04
+% Intended LaTeX compiler: pdflatex
+\documentclass[11pt]{article}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{graphicx}
+\usepackage{longtable}
+\usepackage{wrapfig}
+\usepackage{rotating}
+\usepackage[normalem]{ulem}
+\usepackage{amsmath}
+\usepackage{amssymb}
+\usepackage{capt-of}
+\usepackage{hyperref}
+\usepackage{amsfonts} \usepackage{amssymb} \usepackage{mathtools} \usepackage{ upgreek } \usepackage{ textcomp }
+\author{Logan Hunt}
+\date{\today}
+\title{Homework 6}
+\hypersetup{
+ pdfauthor={Logan Hunt},
+ pdftitle={Homework 6},
+ pdfkeywords={},
+ pdfsubject={},
+ pdfcreator={Emacs 28.2 (Org mode 9.5.5)},
+ pdflang={English}}
+\begin{document}
+
+\maketitle
+
+\section{Question One}
+\label{sec:orgd978739}
+\(\sigma\)\textsubscript{(name='Peter Smith')}(Client)
+
+\section{Question Two}
+\label{sec:org8b645e7}
+\(\sigma\)\textsubscript{(frequency > 5)}(AirtimePackage)
+
+\section{Question Three}
+\label{sec:orgcc5745b}
+\(\pi\)\textsubscript{(videoCode)}(\(\sigma\)\textsubscript{(siteCode='S345')}(Broadcasts))
+
+\section{Question Four}
+\label{sec:org6ac4047}
+\(\pi\)\textsubscript{(serialNo)}(\(\sigma\)\textsubscript{(type='restaurant')}(DigitalDisplay \bowtie\textsubscript{(serialNo=serialNo)} Locates \bowtie\textsubscript{(siteCode=siteCode)} Site))
+
+\section{Question Five}
+\label{sec:orged1f22e}
+\(\pi\)\textsubscript{(empId, name)}(\(\sigma\)\textsubscript{(modelNo='M456781')}(Specializes \bowtie\textsubscript{(empId=empId)} TechnicalSupport))
+
+\section{Question Six}
+\label{sec:org779aa40}
+\(\pi\)\textsubscript{(modelNo)}(\(\sigma\)\textsubscript{(name='Peter')}(Specializes \bowtie\textsubscript{(empId=empId)} TechnicalSupport))
+
+\section{Question Seven}
+\label{sec:org1283914}
+\(\pi\)\textsubscript{(videoCode, videoLength)}(Video \bowtie\textsubscript{(videoCode=videoCode)}(\(\pi\)\textsubscript{(videoCode)}(\(\sigma\)\textsubscript{(siteCode=111)}(Broadcasts)) \(-\) \(\pi\)\textsubscript{(videoCode)}(\(\sigma\)\textsubscript{(siteCode=112)}(Broadcasts)))
+
+\section{Question Eight}
+\label{sec:org98cb969}
+\(\pi\)\textsubscript{(name)}(TechnicalSupport) \(\cup\) \(\pi\)\textsubscript{(name)}(Administrator) \(\cup\) \(\pi\)\textsubscript{(name)}(Salesman)
+
+\section{Question Nine}
+\label{sec:org1b1a92e}
+\(\pi\)\textsubscript{(empId, name)}(\(\sigma\)\textsubscript{(modelNo='MO1' AND siteCode=111)}TechnicalSupport \bowtie\textsubscript{(empId=empId)}(Specializes) \bowtie\textsubscript{(modelNo=modelNo)}(DigitalDisplay) \bowtie\textsubscript{(serialNo=serialNo)}(Locates))
+
+\section{Question Ten}
+\label{sec:orgd665945}
+\(\pi\)\textsubscript{(empId, name)}(SalesMan \(-\) \(\pi\)\textsubscript{(empId)}(SalesMan \bowtie\textsubscript{(empId=empId)} (Purchases)))
+\end{document} \ No newline at end of file
diff --git a/Homework/cs5800/Homeworks/img/employee-departments-phones.png b/Homework/cs5800/Homeworks/img/employee-departments-phones.png
new file mode 100644
index 0000000..74ef791
--- /dev/null
+++ b/Homework/cs5800/Homeworks/img/employee-departments-phones.png
Binary files differ
diff --git a/Homework/cs5800/Homeworks/img/representatives.png b/Homework/cs5800/Homeworks/img/representatives.png
new file mode 100644
index 0000000..8aac241
--- /dev/null
+++ b/Homework/cs5800/Homeworks/img/representatives.png
Binary files differ
diff --git a/Homework/cs5800/Homeworks/img/teaches-course-text.png b/Homework/cs5800/Homeworks/img/teaches-course-text.png
new file mode 100644
index 0000000..258477a
--- /dev/null
+++ b/Homework/cs5800/Homeworks/img/teaches-course-text.png
Binary files differ