diff --git a/semester4/dmdb/data-modelling-databases-summary.pdf b/semester4/dmdb/data-modelling-databases-summary.pdf index 5767819..30f66c3 100644 Binary files a/semester4/dmdb/data-modelling-databases-summary.pdf and b/semester4/dmdb/data-modelling-databases-summary.pdf differ diff --git a/semester4/dmdb/parts/01_sql/02_dml.tex b/semester4/dmdb/parts/01_sql/02_dml.tex index 202d75c..7e19ab8 100644 --- a/semester4/dmdb/parts/01_sql/02_dml.tex +++ b/semester4/dmdb/parts/01_sql/02_dml.tex @@ -1,4 +1,3 @@ -\newpage \subsection{Data Manipulation Language (DML)} The DML is used to insert, update and delete data from the database. diff --git a/semester4/dmdb/parts/01_sql/03_query-language/00_intro.tex b/semester4/dmdb/parts/01_sql/03_query-language/00_intro.tex index 941076e..0bf6ae8 100644 --- a/semester4/dmdb/parts/01_sql/03_query-language/00_intro.tex +++ b/semester4/dmdb/parts/01_sql/03_query-language/00_intro.tex @@ -1,4 +1,6 @@ +\newpage \subsection{Query Language} +\label{sec:sql-query-language} The basic structure of a \sql\ statement is \texttt{SELECT I FROM T WHERE C}, which corresponds to $\Pi_{\texttt{I}}(\sigma_{\texttt{C}} \texttt{T})$. @@ -38,5 +40,6 @@ To get just the year from an existing date object (or string), use \texttt{YEAR} The current date, time, year, etc is provided using \texttt{current\_date} (etc). -There are also conditional statements, namely \texttt{CASE WHEN condition1 THEN result1 WHEN condition2 THEN result2 ELSE else END}, or of course, more conditions. -This can even be used inside aggregations, etc! +There are also conditional statements, namely +\mint{sql}{CASE WHEN condition1 THEN result1 WHEN condition2 THEN result2 ELSE else END} +or of course, more conditions. This can even be used inside aggregations, etc! diff --git a/semester4/dmdb/parts/01_sql/03_query-language/01_basic-operators.tex b/semester4/dmdb/parts/01_sql/03_query-language/01_basic-operators.tex index 57a6f48..85cd3ad 100644 --- a/semester4/dmdb/parts/01_sql/03_query-language/01_basic-operators.tex +++ b/semester4/dmdb/parts/01_sql/03_query-language/01_basic-operators.tex @@ -25,7 +25,7 @@ The following \sql\ logical operators are available (may not be exhaustive for a \shade{gray}{Arithmetic Operators} $+, -, *, /, \%$ are defined as usual. This also means that we can use \acrshort{sql} as a calculator, for example:: -\mint{sql}|SELECT a * b| +\mint{sql}|SELECT a * b;| We can use the arithmetic operators like this: \mint{sql}|SELECT Value * 1.1 FROM Data;| diff --git a/semester4/dmdb/parts/08_quick-overview/04_checklist.tex b/semester4/dmdb/parts/08_quick-overview/04_checklist.tex index 5594aef..407386d 100644 --- a/semester4/dmdb/parts/08_quick-overview/04_checklist.tex +++ b/semester4/dmdb/parts/08_quick-overview/04_checklist.tex @@ -2,7 +2,7 @@ \subsection{Checklist} The following things are typically important to know very well (not exhaustive) \begin{todolist} - \item SQL (syntax, some concepts, such as using \texttt{WITH} statements often to make the task more approachable), see Section~\ref{sec:sql-basic-ops} + \item SQL (syntax, some concepts, such as using \texttt{WITH} statements often to make the task more approachable), see Section~\ref{sec:sql-query-language} \item Relational Algebra notation, see Section~\ref{sec:relational-model-logic-algebra} \item Functional Dependencies (including Candidate Keys, Super Keys, Closures and minimal covers), see Section~\ref{sec:functional-dependency} \item Normal Forms (and their Decomposition / Synthesis Algorithms), see Section~\ref{sec:normal-forms}