problems with my first base
hi guys.
i'm having problems with my first base. could someone please help me?
(shift is almost dead on my laptot so sorry in advance for small letters in code)
i'm trying to execute next code
========================
use newbase;
drop table regions;
create table regions (
id int AUTO_INCREMENT,
name varchar(255) not null unique,
active boolean not null default false,
primary key (id)
);
drop table cities;
create table cities(
id int AUTO_INCREMENT,
name varchar(255) not null unique,
regions_id int not null,
active boolean not null default false,
primary key (id),
foreign key (regions_id) references regions(id)
);
========================
problem 1 - error 1217 (23000) 'cannot delete or update a parent row; a foreign key constraint fails'
problem 2 - error 1050 (42s01) 'table regions already exists'
but i dropped it before, why7
problem 3 - autoincremeting works quite bad. i want it to create id like 1,2,3,4... but sometimes after inserting something in my table it looks like 2,3,5,7...
thanks in advance for your help with these questions.