From 6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6 Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Thu, 2 Jul 2026 11:55:17 -0700 Subject: Init --- Homework/cs5800/Homeworks/hw-3.org | 64 +++++ Homework/cs5800/Homeworks/hw-3.pdf | Bin 0 -> 100761 bytes Homework/cs5800/Homeworks/hw-3.tex | 114 ++++++++ Homework/cs5800/Homeworks/hw-4.html | 311 +++++++++++++++++++++ Homework/cs5800/Homeworks/hw-4.org | 90 ++++++ Homework/cs5800/Homeworks/hw-4.pdf | Bin 0 -> 53232 bytes Homework/cs5800/Homeworks/hw-4.tex | 131 +++++++++ Homework/cs5800/Homeworks/hw-6.org | 35 +++ Homework/cs5800/Homeworks/hw-6.pdf | Bin 0 -> 122134 bytes Homework/cs5800/Homeworks/hw-6.tex | 69 +++++ .../Homeworks/img/employee-departments-phones.png | Bin 0 -> 13353 bytes Homework/cs5800/Homeworks/img/representatives.png | Bin 0 -> 43705 bytes .../cs5800/Homeworks/img/teaches-course-text.png | Bin 0 -> 10501 bytes 13 files changed, 814 insertions(+) create mode 100644 Homework/cs5800/Homeworks/hw-3.org create mode 100644 Homework/cs5800/Homeworks/hw-3.pdf create mode 100644 Homework/cs5800/Homeworks/hw-3.tex create mode 100644 Homework/cs5800/Homeworks/hw-4.html create mode 100644 Homework/cs5800/Homeworks/hw-4.org create mode 100644 Homework/cs5800/Homeworks/hw-4.pdf create mode 100644 Homework/cs5800/Homeworks/hw-4.tex create mode 100644 Homework/cs5800/Homeworks/hw-6.org create mode 100644 Homework/cs5800/Homeworks/hw-6.pdf create mode 100644 Homework/cs5800/Homeworks/hw-6.tex create mode 100644 Homework/cs5800/Homeworks/img/employee-departments-phones.png create mode 100644 Homework/cs5800/Homeworks/img/representatives.png create mode 100644 Homework/cs5800/Homeworks/img/teaches-course-text.png (limited to 'Homework/cs5800/Homeworks') 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 Binary files /dev/null and b/Homework/cs5800/Homeworks/hw-3.pdf 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 @@ + + + + + + + +Homework 4 + + + + + +
+

Homework 4

+ + +
+

1. Question One

+
+

+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: +

+ +
    +
  1. (clientId)
  2. +
  3. (clientId, name)
  4. +
  5. (clientId, phone)
  6. +
  7. (clientId, address)
  8. +
  9. (clientId, name, phone)
  10. +
  11. (clientId, name, address)
  12. +
  13. (clientId, phone, address)
  14. +
  15. (clientId, name, phone, address)
  16. +
+ +

+Therefore there are eight super keys. +

+
+
+ +
+

2. Question Two

+
+

+There is only one primary key which is the collection of (clientId, empId, packageId). +

+
+
+ +
+

3. 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 (and also in this design, the primary key!). +

+
+
+ +
+

4. Question Four

+
+
+
select clientId, name, phone, address from Client where name="Peter Smith";
+
+
+
+
+ +
+

5. Question Five

+
+
+
select videoCode from Video where videoLength < 2;
+
+
+
+
+ +
+

6. Question Six

+
+

+Making the assumption that all addresses are formatted as "<street no> <street address>". For example "12345 John Blvd": +

+ +
+
select siteCode, type, address, phone from Site where right(address, locate(' ', address)-1) = "University Dr";
+
+
+
+
+ +
+

7. Question Seven

+
+

+Assuming a siteCode of one: +

+ +
+
select administrator.empId, administrator.name, administrator.gender from administers join administrator on administrator.empId=administers.empId where siteCode=1;
+
+
+
+
+
+
+

Author: Logan Hunt

+

Created: 2022-10-08 Sat 18:41

+

Validate

+
+ + 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 " ". 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 Binary files /dev/null and b/Homework/cs5800/Homeworks/hw-4.pdf 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 " ". 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 Binary files /dev/null and b/Homework/cs5800/Homeworks/hw-6.pdf 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 Binary files /dev/null and b/Homework/cs5800/Homeworks/img/employee-departments-phones.png differ diff --git a/Homework/cs5800/Homeworks/img/representatives.png b/Homework/cs5800/Homeworks/img/representatives.png new file mode 100644 index 0000000..8aac241 Binary files /dev/null and b/Homework/cs5800/Homeworks/img/representatives.png 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 Binary files /dev/null and b/Homework/cs5800/Homeworks/img/teaches-course-text.png differ -- cgit v1.3