(i)SQL – Cheat Sheet

Informix never forget 😉

Creation/Manipulation of tables:

CREATE TABLE tabelle (nummer int, text char(10), time datetime, date date);
DROP table tabelle;
ALTER TABLE table_name MODIFY (name char(100));
ALTER TABLE table_name ADD column_name column-definition;

can be positioned with AFTER/BEFORE

Unloading tables:

unload to '/home/content.csv'
delimiter ';'
SELECT * FROM content

Transactional Stuff:

BEGIN WORK;
ROLLBACK WORK;

Query Time:

SELECT |ALL|DISTINCT|UNIQUE|FIRST 
FROM table (WHERE)
GROUP BY columnname
HAVING COUNT(**)>1
ORDER BY columnname (ASC|DESC), ....
INTO TEMP tablename

WHERE-Clause:

bla (NOT) BETWEEN bla AND 
bla (NOT) IN (List, of, bla)
bla (NOT) LIKE "bla"
bla (NOT) EXISTS 
bla IS (NOT) NULL

to combine multiple selects

UNION

TO_CHAR transformation for query:

SELECT nr FROM numbers WHERE nr MATCHES "38*"
Error 219: Wildcard matching may not be used with non-character types.

SELECT nr FROM numbers WHERE TO_CHAR(nr) MATCHES "38*"
0

Eyebolts FTW!

Several years ago I decided to buy a big couch.  As they are expensive  (> 1000 €) I checked out several couches from several furniture houses.  Finally i bought this one and i liked it. The price was about 900 €.

img_20121203_171548

Afterwards i understood why picking a light color is not a good idea…

But what i did not understand is why the fuck choosing plastic for fixing the steel springs(forks/nibs)?

polen_couch

The logic consequence of this EPIC design error was that nearly all of the plastic fixations broke and the couch began to hang…

polen_couch2

So i decided to make it better, i bought eyebolts made of steel and replaced the broken plastic. A wood drill was necessary (just drilled a small hole, so that I was able to screw the eyebolts)

mgcvc7vhqazbhih-reuluhq

I still have to find out the producers name and mail this story to them. I just want to know how many money they think they saved using plastic crap.

0