It's (just?) Data

Zvi Boshernitzan

Robocommerce, LLC

Simple Data Structures are Powerful.

[any material that should appear in print but not on the slide]

Pet Peeve: Sequences vs Dictionaries

(A) Creating and Altering Data

The 'where' spec.

(A) Creating and Altering Data

create table authors (
   id        integer primary key auto_increment,
   last_name varchar(200) not null unique
);
create table books (
   id        integer primary key auto_increment,
   author_id integer not null references authors,
   title     varchar(200) not null unique
);

So lets insert some data..

$author_id = db::insert('authors',array('last_name' => 'Rosenthal'));
db::update('authors', array('last_name' => 'Boshernitzan'), $id);

$books = array('title1','title2');
foreach ($books as $title) {
  db::insert('books', compact('author_id','title'));
}

(B) Queries: What do you want?

Queries with no columns

Queries with no columns: Examples

Queries with one column

Queries with one column: examples

Queries with one column: examples

Queries with more than one column

Queries with more than one column: examples