knowledge-kitchen

Exam 2 Review - Database Design

Database Design

  1. Overview
  2. MongoDB
  3. Web Apps
  4. Pandas
  5. Conclusions

Overview

Format

The exam will be composed of two parts:

Time

Start anytime and submit anytime within a 24 hour window.

Topics covered

The topics covered on the exam:

Weighting

All topics will be weighted approximately equally in grading.

MongoDB

Key points

Main topics:

CRUD

CRUD is still cruddy

Basic statistics

As with all database systems, MongoDB can easily do some basic statistical operations:

The aggregation pipeline is used to calculate most other statistics…

Basic statistics (continued)

E.g., calculate average of all values in the salary_range_to field with no grouping:

db.collection.aggregate([
  {
    $group: {
      _id: null,
      avg_val: { $avg: "$salary_range_to" },
    },
  },
])

Same, but grouping by agency:

db.collection.aggregate([
  {
    $group: {
      _id: "$agency",
      avg_val: { $avg: "$salary_range_to" },
    },
  },
])

Aggregation pipeline

The aggregation pipeline allows for multi-stage transformations, where the output of each stage becomes the input for the following stage.

Stages may include operations such as:

Web Apps

Key points

Main topics:

HTML, CSS, Javascript

Web browsers can only “understand”/interpret 3 languages: HTML, CSS, Javascript.

All web servers must respond to incoming HTTP requests from a web browser with code in one or more of these types.

flask

flask is a Python web server module to help detect incoming requests and respond to them

pymongo

pymongo is a Python module that helps the server code communicate with a MongoDB databases.

Pandas

Key points

Main topics:

Jupyter Notebooks

A convenient web-based IDE widely-used in the scientific Python community for writing and sharing code.

Conclusions

Thank you. Good luck.