Peeter Joot's (OLD) Blog.

Math, physics, perl, and programming obscurity.

some rudimentary SQL

Posted by peeterjoot on October 28, 2009

Ironically, despite 10 years of working on a database, my work has been so far in the guts that I rarely have to do any SQL myself.  At one point when I’d been drafted for some some project management related work I did some fancy stuff with it making forms with python to compare regression results, but I’ve already forgotten all that.  Here’s a couple notes to myself of the very simplest stuff.

— create a table.  Note the backwards “prototype” compared to a C function;)

create table b (x int)

— how many rows?

select count(*) from b

— double table size

insert into b select * from b

–touch the whole thing to force IO and general activity in the database engine

update b set x = (x+1)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: