Database Maintenance: 2.d.iii. Update Queries, by Rae Kennedy

17th March 2013

ALTER TABLE my_family
ADD weight_at_birth varchar;

INSERT INTO my_family (forename, surname)
VALUES (‘Catherine’, ‘Robinson’);

UPDATE my_family
SET known_as=’Katie Robinson’, date_of_birth=’2013-03-17′, place_of_birth=’Swindon’, mother=’Patricia Robinson’, father=’Gerry Robinson’, relationship_to_me=’Niece’, address=’High Beech, The West Street, Swindon’, weight_at_birth=’7lb 4oz’
WHERE forename=’Catherine’
AND surname=’Robinson’;

– – ask Nan about our birth weights

19th March 2013

ALTER TABLE my_family
ADD (favourite_colour varchar, disposition varchar);

UPDATE my_family
SET favourite_colour=’Early stages but testing indicates green’, disposition=’Smiley’
WHERE known_as=’Katie Robinson’;

– – find more favourite colours. Send out Google form?

20th March 2013

SELECT email
FROM my_family
WHERE favourite_colour IS NULL;

– – Google form sent

24th March 2013

ALTER TABLE my_family
ADD additional_relationship_to_me varchar;

UPDATE my_family
SET additional_relationship_to_me=’Goddaughter’ — !!!!
WHERE known_as LIKE ‘Katie%’;

UPDATE my_family
SET favourite_colour=’Blue’
WHERE known_as LIKE ‘Gerry%’;

UPDATE my_family
SET favourite_colour=’The green of a dewy leaf in spring’
WHERE known_as LIKE ‘Patricia%’;

22nd February 2014

ALTER TABLE my_family
ADD bio_father varchar;

UPDATE my_family
SET bio_father=’Richard Goldberg’
WHERE known_as LIKE ‘Katie%’;

– – note to self: when bio_father=father bio_father is null

8th March 2014

UPDATE my_family
SET marital_status=’separated’
WHERE surname=’Robinson’
AND (forename=’Patricia’ OR forename=’Gerrard’);

20th March 2014

INSERT INTO my_family (forename, surname)
VALUES (‘Richard’, ‘Goldberg’);

UPDATE my_family
SET known_as=’Richard Goldberg’, date_of_birth=’1988-01-02′, email=’r.goldberg88@gmail.com’, place_of_birth=’Swindon’, mother=’Lydia Goldberg’, father=’David Goldberg’, address=’18c Manswell House, Carston Road, Swindon’, favourite_colour=’I dunno, Blue’, weight_at_birth=’Who is this creep?’, disposition=’Why is he asking all these stupid fucking questions?’
WHERE forename=’Richard’
AND surname=’Goldberg’;

30th April 2014

ALTER TABLE
ADD (date_of_death date, cause_of_death varchar, status varchar, charge varchar;

UPDATE my_family
SET date_of_death=’2014-04-21′, cause_of_death=’multiple stab wounds’
WHERE known_as LIKE ‘Patricia%’
AND relationship_to_me=’sister-in-law’;

UPDATE my_family
SET (status=’in prison’, charge=’voluntary manslaughter’)
WHERE forename=’Gerrard’
AND surname=’Robinson’;

12th May 2014

ALTER TABLE my_family
ADD (guardian varchar, development varchar, first_words varchar);

UPDATE my_family
SET guardian=’Richard Goldberg’, surname=’Goldberg’, known_as=’Katie Goldberg’, development=’almost walking’, first_words=’Mummy, Mummy’
WHERE forename=’Catherine’;

15th June 2014

ALTER TABLE my_family
ADD injury_status varchar;

UPDATE my_family
SET status=’in hospital’, injury_status=’large head wound’
WHERE known_as LIKE ‘Katie%’;

20th June 2014

UPDATE my_family
SET phone_number=’stay the FUCK away from us, creep’
WHERE known_as LIKE ‘Richard%’;

UPDATE my_family
SET status=’Unknown’
WHERE known_as LIKE ‘Katie%’;

UPDATE my_family
SET address=’Unknown’
WHERE known_as LIKE ‘%Goldberg’;

30th July 2014

ALTER TABLE my_family
ADD location_of_body varchar;

UPDATE my_family
SET date_of_death=’2014-07-29′, cause_of_death=’not letting me see my Goddaughter’, location_of_body=’nobody knows so it’s another of my stupid fucking questions ISN’T IT RICHARD’
WHERE forename=’Richard’
AND surname=’Goldberg’;

UPDATE my_family
SET surname=’Robinson’, known_as=’Katie Robinson’, status=’safe’
WHERE forename=’Catherine’;

UPDATE my_family
SET address=’TBD, maybe Spain’
WHERE relationship_to_me=’Me’ OR relationship_to_me=’Niece’;

UPDATE my_family
SET guardian=’Me’, favourite_colour=’purple’, injury_status=’almost completely healed, small scar’
WHERE known_as=’Katie Robinson’;

4th August 2014

DELETE FROM my_family
WHERE known_as IN (Richard Goldberg, Gerry Robinson);

7th August 2014

DROP TABLE my_family;


Rae Kennedy works for a Sixth Form College in Hampshire, England. Her hobbies include sitting in libraries pretending to write and eating avocado sandwiches. She hates slugs.


<– Back to v1

Advertisements

One thought on “Database Maintenance: 2.d.iii. Update Queries, by Rae Kennedy

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