Introduction to Databases

These notes are based on the intro to databases that Matthew Eric Bassett delivered at S2DS 2014.

Database Management System (DBMS)

  • simplest example is a file system
  • needs to provide an interface between stored files and what we call …?
  • manages file storage and user permissions (security)
  • records access patterns (to time requests)
  • ACID compliance:
    • Atomicity: all or nothing communication, no partial data updates
    • Consistency: all defined rules are always upheld
    • Isolation: no crosstalk between users and their actions
    • Durability: data are backed up etc.

Database Models

  • relational, based on relations (i.e. tables)
  • object-oriented databases
  • graph databases
  • key/value: e.g. memcache, Redis
  • SQLite: file-based

Relational Model

  • “schema” and “database” are used interchangeably here
  • a schema is a set of tables
  • “data types” are understood in the sense of C, Java, etc. data types
  • attributes are columns in a table
  • tuples are rows in a table
  • relations are tables / are encoded in tables
  • primary key (unique) or keys (?)
    • primary keys are unique identifiers of tuples in a table
    • can consist of one or multiple attributes
    • are usually an artificial integer attribute “ID” that is not related to the real world modeled by your schema
  • side note: NoSQL databases oftentimes are about not predefining a schema but rather hoping that one emerges over time and with experience

Subqueries and Joins

Random Notes

comments powered by Disqus