You are on page 1of 3

Jupyter Basics

Jupyter instructions are also available in these two videos: How to Use Jupyter
Notebooks and How to Use Your Jupyter Account. Check them out if you have not.

Jupyter is an online interface that allows you to practice MySQL queries online, without having to
download, install and configure MySQL and a database on your own computer. Each learner will
have her or his own private Jupyter folder containing files called "notebooks," each of which
includes a series of exercises in which you can practice various features of MySQL. The
notebooks all allow you to connect to the Dognition database described earlier, so when you run
queries in your Jupyter notebooks, you will be querying that database.

To access a Jupyter notebook, click on one of the MySQL exercise items in this course, such as
"Jupyter Exercise 1: Looking at Your Data," then click the "Open Tool" button to be taken to that
notebook. The notebook is housed on a server outside of Coursera, at Duke University.

A Jupyter notebook includes instructional information (written-out information about MySQL and
how to write MySQL queries) and query boxes (in which you can type and run MySQL queries to
practice what is taught in the written materials). For these instructions, we will use Exercise 1 as
an example.

Here is a screen shot of one portion of Exercise 1 notebook, with the text block instructional
information and query boxes highlighted.

To use the notebook, carefully read the text information and follow the instructions to create and
run queries, to learn the various MySQL functions being taught in the course. There are 12
notebooks with progressively harder content - by the time you have completed all of them you will
be proficient in MySQL!

When you run a query, the output of the query will appear immediately below the query box in
which you typed the query. If you receive an error message because you wrote the query
incorrectly, you may want to clear the error and try again. You may also want to clear the correct
output and try again. To clear the output of a query, place your mouse cursor in the query box of
which you want to clear the output, and choose Cell > Current Output > Clear. Then, adjust your
query and re-run it.

You can save the notebook as you work by choosing File > Save and Checkpoint periodically.
When you return to the notebook, you will return to the last saved version, and you can also
return to any specific "checkpoint" version by choosing File > Revert to Checkpoint and then
select the date/time to which you wish to revert.

Working in the Jupyter home page


Each Jupyter exercise is a "notebook" file, as mentioned. There are 12 notebooks in this course,
and if you go to the home page of your Jupyter account you can see all of them. To go to your
Jupyter home page, click the word "Jupyter" at the top left of any notebook or click on the link to
your home page provided in Lesson 2 of Week 2. A new window will open and you will see a
list of files like this:

If any of your notebooks are currently running, their icon will be green and the word "Running" will
appear to the right. When you are done with a notebook it's always best to shut it down. To do so
you can select it from this list by clicking the checkbox to the left of the notebook, and click
"Shutdown" at the top ("Shutdown" appears as an option when any of the notebooks are
selected).
To open any notebook, click it from this list.

You can duplicate, rename or delete any notebook by selecting the checkbox to the left of its title,
then clicking the appropriate menu item at the top of the page. Duplicating or renaming your
notebooks is something you might want to do if you want to keep clean copies of notebooks
before you begin working on them.

Notice the notebook titled "restore-my-notebook.ipnyb." This notebook contains instructions for
how to re-install clean copies of all 12 of the course notebooks into your Jupyter home directory.
This is something useful to do if you accidentally delete one or more of your notebooks, or alter
them significantly and wish to recover clean, new versions of each notebook. However, restoring
will OVERWRITE all of the existing notebooks with new versions of each (any work you had
saved in the notebook would be lost, if you did not save the notebook with a different name
BEFORE restoring).

You might also like