Hi there ...
I am just getting to know this MySQL - Finally understanding that frequently used database systems cannot rely 'entirely' upon flatfiles.
Anyway, I managed to create my first few tables and I am currently working on understanding the concept of Primary Keys:
Imagine this:
The grocer has in his database a list of fruits:
Table - Fruits (id = primary key using "not null auto_increment")
Type | id
-------+---
Orange | 1
Apple | 2
Tomato | 3
Banana | 4
One day the grocer realises, that he doesn't need apples anymore, so he logs on to the database and deletes the value known as 'Apples' from the 'Fruits' table. Now the database looks like this:
Type | id
-------+---
Orange | 1
Tomato | 3
Banana | 4
One week after that he's got melons in the house - so again he logs on:
Type | id
-------+---
Orange | 1
Tomato | 3
Banana | 4
Melon | 5
This is where the database structure becomes unlogic for me. I would like MySQL to think: "The old man wants another record, and id-number 2 isn't used, so Ill just grap that instead of 1+<last id submitted>"
Could you help me with the commands, that would construct a database where this becomes reality or tell me why not?
NB. If you know any good place to gain knowledge about MySQL, then please add it as a note.
I am just getting to know this MySQL - Finally understanding that frequently used database systems cannot rely 'entirely' upon flatfiles.
Anyway, I managed to create my first few tables and I am currently working on understanding the concept of Primary Keys:
Imagine this:
The grocer has in his database a list of fruits:
Table - Fruits (id = primary key using "not null auto_increment")
Type | id
-------+---
Orange | 1
Apple | 2
Tomato | 3
Banana | 4
One day the grocer realises, that he doesn't need apples anymore, so he logs on to the database and deletes the value known as 'Apples' from the 'Fruits' table. Now the database looks like this:
Type | id
-------+---
Orange | 1
Tomato | 3
Banana | 4
One week after that he's got melons in the house - so again he logs on:
Type | id
-------+---
Orange | 1
Tomato | 3
Banana | 4
Melon | 5
This is where the database structure becomes unlogic for me. I would like MySQL to think: "The old man wants another record, and id-number 2 isn't used, so Ill just grap that instead of 1+<last id submitted>"
Could you help me with the commands, that would construct a database where this becomes reality or tell me why not?

NB. If you know any good place to gain knowledge about MySQL, then please add it as a note.