In my spare time, if I’m not working on data, blogging about data, or thinking about data, I take ballet lessons. Dance makes my brain work in different ways, it’s challenging, and who wouldn’t like to dance like a ballerina?
As I was having a hard time switching off from work this week, I thought: a ballet lesson would be a great way to discuss database concepts.
Here’s what I mean.
The barre
If you’ve never attended a ballet class, it generally begins with a warm-up at the barre.
Keys
Our teacher is a PRIMARY KEY. She identifies all ‘rows’ in the class and is NOT NULL. We rely on her for entity integrity. A teacher from the Jazz class usually visits our class and she is the FOREIGN KEY. Our referential integrity is maintained by her.
Indexes
Each person lines up at the barre in order. Everyone prefers their own spot, so this is the same order every time. We have a clustered index.
Normal Form
Then we begin our exercises at the barre. After completing the first position, we move on to the second and third. By the time we get to third position, we are prepared to move onto more challenging exercises. Our data is considered ‘normalised’ once it reaches the third normal form.
As with the data normalisation procedures, these exercises are built upon each other, are based on formal rules, and form the foundation of the art.
The Centre
SELECT
After barre, everyone goes to the centre. We work in groups where everyone takes turns working through exercises. For our solo performances, DISTINCT, we come out one at a time.
JOINS
We get an INNER JOIN when we begin to practice our combinations with a partner from the class next door.
The rehearsal
The final part of the class is the rehearsal for the next performance. In the BEGIN TRANSACTION stage, we debate ideas around music and what might look good.
We COMMIT if we’re happy with what we’ve come up with, and if not, we ROLLBACK.
The curtsy
Our class ends with a curtsy and then a TRUNCATE. We’ll be back next time to INSERT, UPDATE, and SELECT with all our jargon.
Photo by Jansel Ferma from Pexels
Comments are closed, but trackbacks and pingbacks are open.