DA4310 Tutorial 3 – MongoDB
Index No: 19#####
Consider the following relational schema and answer the questions. Write the answers in this sheet in
the given slots and upload as pdf file with your index number. Eg: [Link]
Relational Schema:
employees
code name phone address_street address_city address_state project
101 Tom 415-983-9223 1367 Locust Drive San Jose California SN20
102 Shana 214-289-1316 683 Fancher st Dallas Texas BN4
110 Lars 970-481-8746 3035 Shobe Lane Denver Colorado BN4
projects
codenam
name budget started ended
e
SN20 Starship SN20 100,000,000 2021
2,000,000,00
BN4 Super Heavy BN4 2021
0
BFR Big Falcon Rocket 50,000,000 2017 2018
Questions:
1. Write the MongoDB commands to represent above relational data as documents and collections in
MongoDB. (Decide how you represent the relationships considering the next questions as well.)
## Your MongoDB expressions
2. Write a MongoDB command to fetch the employee with code 110
## Your MongoDB expressions
3. Write a MongoDB command to find the project employee 101 working on.
## Your MongoDB expressions
4. Write a MongoDB command to find the average budget of projects.
Department of Decision Science
DA4310 Tutorial 3 – MongoDB
## Your MongoDB expressions
Department of Decision Science