Finalizing Part 1, excluding report
This commit is contained in:
parent
e388349752
commit
da34e2b6b5
@ -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}
|
||||
|
||||
|
||||
BIN
images/demand_count.png
Normal file
BIN
images/demand_count.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
BIN
images/gt_four.png
Normal file
BIN
images/gt_four.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
BIN
images/high_demand.png
Normal file
BIN
images/high_demand.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 100 KiB |
Loading…
x
Reference in New Issue
Block a user