Welcome to Chez SQL. I will be your SQL server (ha ha)!
May I have your name for the reservation? Thank you. Let’s see… actually, the reservation list is quite large and it’s taking a while to scan for your name – would you happen to know the ID number for your reservation? I should be able to seek it quicker that way – clustered indexes, you understand.
Brilliant, there we are. If you would like to follow me, I will show you to your table. Is this your first time at Chez SQL? We are the only restaurant to operate a Relational Restaurant Management System – patent pending – so things may be a little different to what you’re used to. Your table is just there in the corner, by the fireplace. Mind those logs – somebody really should have cleared those down.
Is something the matter? Oh, there is already food and drink at your table? How strange, let me see… ah, yes, these look to be the orders for a customer who sat here yesterday. This a temporal table, you see. Not all restaurants support them, but they have their uses. Let me just clean this up for you.
Ah, you would like a menu? Yes, sorry, but you may have to wait a while. You see, one of the customers already has the food menu but has requested a drinks menu, while another customer, who has the drinks menu, has requested the food menu. They’re both caught in a bit of a deadlock, as it were. Not ideal, but these things usually sort themselves out eventually. It’s why we recommend customers all go through the menus in the same order – often helps to avoid these issues.
Here you are, sorry about the wait – one of the customers was chosen as the deadlock victim. Poor guy. He’ll have to restart his restaurant experience from the beginning, but that’s what happens when you contain everything in a single transaction! Anyway, I’ll leave you to browse. You’ll see under the Specials section that this week we have some fine dishes by Ola Hallengren – he doesn’t work here, but everybody uses his recipes – and a lovely fried Codd and chips.
Hello again, how have you been getting on? You’re still waiting for your food? It’s been three hours?! Well, that’s no good at all. I could pop my head into the kitchen to see how things are coming along, but it’s very busy in there. Lots of things happening at once, lots of concurrency, so it’d be hard to tell exactly what’s going on. Everything is much more orderly in the mornings – the breakfast bar is cerealizable, you see.
You’ve come at a busy time for production – food production, I mean – so this can mean long waits, I’m afraid. We operate twenty-four-by-seven, so you’re welcome to come in when the workload is lighter if you’d like your meal to be prioritised – Sunday at 1am, perhaps? There are a handful of people that come in then, maintenance workers and such, but on the whole it’s much quieter.
Don’t panic, everyone, don’t panic! Yes, the lights have gone out, there is an eerie beeping noise emanating from somewhere, and your food has exploded spontaneously, but this is no cause for alarm! The restaurant has simply crashed. If you would all like to follow me, we can go over to the secondary restaurant across the street, where perfectly edible replicas of your meals are already waiting for you!
Right, let me just unlock this door. Now, which key is the right one? This one’s a foreign key, not sure why that’s there… these are all alternate keys… aha, here we are, the primary key. Just through here, everyone. Everything looks identical, you see? Just mind the mirrors – we really should have removed those by now, but old habits and all.
Well, I hope you’ve enjoyed your meal and your relational experience here at Chez SQL. Here is the bill – are you ready to commit your transaction? Now, we’re always trying to improve our Food-as-a-Service offerings – new versions being released all the time – so I’ve included a feedback form if you’d like to write down any thoughts. We’d prefer that you ended any statements with a semi-colon but, to be honest, we can still read it even if you don’t.
Would you like to set up a recurring schedule for future dining experiences? No? Well, you’re always welcome to come back anytime, ad hoc! See you soon! v