Algorithms
and
Data
Structures

Spring 2021
course
site
-->

May 2

This Thursday : I'm getting my 2nd vaccination on Wed, and so may be out of the loop the dafter after ... and so you may get the day off. I'll send out a note Wed night either way.

... start recording.

Questions about anything?

Search projects due today ... how did that go?

Final project thoughts?

SQL

This week I'd like to at least expose you to relational databases and SQL. We aren't going to do much more than see some of the basic ideas, and I want you to be starting to work on your final project ... so the assignment is fairly open ended.

How : B-trees

"height balanced m-way tree"

main points :

Here's a python search & insert code example.

What : SQL implementation models

SQLite

concepts

talking the talk

SQL is not one language - each application (SQLite, MySQL, PostgreSQL, ...) has their own variations, though the basics are the same.

Here are some of the most important commands :

   TABLE    - define a table
   SELECT   - fetch some data
   INSERT   - add a new row of data
   UPDATE   - modify some data

A few quirks :

Combining information from several tables is where the syntax can get tricky. The options are :

There are a number of types of joins (left, right, inner, outer), differing mostly in what to do for data which is in one of the two tables but not the other.

an example - umber (this course management system)

practice

There are some nice lessons at software carpentry ; I think that lesson 1 (selecting), 7 (combining), and 10 (python) look interesting.

To get started with these on jupyter.bennington.college :

   $ wget https://swcarpentry.github.io/sql-novice-survey/files/survey.db
   $ sqlite3 survey.db
   sqlite>

I'll walk us through some what's on the resources page.

For your homework for next Monday, I'd like you to try some of these and describe what you did.

https://cs.bennington.college /courses /spring2021 /algorithms /notes /sql1
last modified Wed November 3 2021 10:46 pm