error handling - #1005 - Can't create table 'workswell_database.skoleni' Novice user with MySQL -
sorry stupid question,but database in mysql , happy,when finished.unfortunately,i had found lot of mistakes in database n when fix bug,so i've another. also,this database , guy boring right now,please write bugs , solution them.i novice programmer , database 4 days !
create table`skoleni` ( `sk_id` int not null unique auto_increment, `cena` mediumint not null, `obsazenost` text not null, `kapacita` datetime not null, `popis` text, `prerekvizity` text, `certifikat` mediumint not null, primary key (`sk_id`), foreign key (`sk_id`) references skoleni_has_termin(`skoleni_sk_id`), foreign key (`sk_id`) references skoleni_has_uzivatel(`skoleni_sk_id`) ); create table `skoleni_has_termin`( `skoleni_sk_id`int not null unique, `termin_ter_id` int not null unique, primary key (`skoleni_sk_id`) ); create table `termin` ( `ter_id` int not null unique auto_increment, `datum_cas` datetime not null, `misto_mo_id` int not null, primary key (`ter_id`), foreign key (`ter_id`) references skoleni_has_termin(`termin_ter_id`) ); create table `misto` ( `mo_id` int not null unique auto_increment, `ulice` mediumint not null, `cislo_popisne` mediumint not null, `lat` float (10,6) not null, `lng` float (10,6) not null, primary key (`mo_id`) )engine = myisam; select table.misto( insert (`ulice`, `cislo_popisne`, `lat`, `lng`), values (`dr_zikmunda_wintra_376_5``16000 praha 6 bubenec``14.407438``50.101049`) ); create table `skoleni_has_uzivatel` ( `skoleni_sk_id` int not null unique, `uzivatel_uziv_id` int not null unique, primary key (`skoleni_sk_id`) ); create table `uzivatel` ( `uziv_id` int not null unique auto_increment, `jmeno` varchar(30) not null, `typ` mediumint unique, `heslo` varchar(32) not null, `potvrzeni` varchar(1) not null, primary key (`uziv_id`), foreign key (`uziv_id`) references skoleni_has_uzivatel(`uzivatel_uziv_id`) ); create table `skoleni_has_lektor` ( `skoleni_sk_id` int not null unique, `lektor_lek_id` int not null unique, primary key (`lektor_lek_id`) ); create table `lektor` ( `lek_id` int not null unique auto_increment, `titul'pred'` varchar(10) not null, `jmeno` varchar(20) not null, `prijmeni` varchar(20) not null, `titul'za'` varchar(10), `firma` varchar(30), `rodne cislo` char(11) not null, `datum narozeni` date not null, primary key (`lek_id`) ); create table `firma` ( `fir_id` int not null unique auto_increment, `e-mail` varchar(15) not null, `telefon` varchar(15) not null, `web` varchar(30), `ic` char(8) not null, `dic` varchar(12) not null, `misto_mo_id` int not null, primary key (`fir_id`), primary key (`misto_mo_id`), foreign key (`misto_mo_id`) references firma(`misto_mo_id`) );
the tables `skoleni_has_termin' , 'skoleni_has_lektor' not needed here. bring dates trainings table , leave lektor_id in skoleni table relation between trainings , lecturers 1:n not m:n (unless 1 training can have more 1 lecturer)
Comments
Post a Comment