diff --git a/Report/Schrick-Noah_QM-7093_Final.tex b/Report/Schrick-Noah_QM-7093_Final.tex index 71aae8c..3fb3aff 100644 --- a/Report/Schrick-Noah_QM-7093_Final.tex +++ b/Report/Schrick-Noah_QM-7093_Final.tex @@ -88,11 +88,37 @@ db.Project_Data.updateMany({"CustomerID" : ""}, { $unset : {"CustomerID" : 1 } } \label{fig:after_ci_drop} \end{figure} +Adding "HighDemand": +\begin{spverbatim} +db.Project_Data.aggregate([ + { + $addFields: { + HighDemand: { + $cond: [ + { $gt: [ "$Quantity", 11 ] }, + "Yes", + "$$REMOVE" + ] + } + } + }, + { + $out: "Project_Data" + } + ]).pretty() +\end{spverbatim} \subsection{Queries} \textbf{Question 1:} How many records have the column “HighDemand”? (Must have a code to answer this, one way to answer this is to have a code that displays all the records except those with the column HighDemand and then subtract the number from total number of records) +\begin{spverbatim} + db.Project_Data.count({"HighDemand": "Yes"}) +\end{spverbatim} + \textbf{Question 2:} Display the records with price more than 4 (4 excluded) +\begin{spverbatim} + db.Project_Data.find({"Price": {"$gt": 4}}).pretty() +\end{spverbatim} \section{Metadata} diff --git a/texput.log b/Report/texput.log similarity index 100% rename from texput.log rename to Report/texput.log diff --git a/images/demand_count.png b/images/demand_count.png new file mode 100644 index 0000000..d55e14c Binary files /dev/null and b/images/demand_count.png differ diff --git a/images/gt_four.png b/images/gt_four.png new file mode 100644 index 0000000..73dbfcc Binary files /dev/null and b/images/gt_four.png differ diff --git a/images/high_demand.png b/images/high_demand.png new file mode 100644 index 0000000..5d17b9f Binary files /dev/null and b/images/high_demand.png differ