/*
Created		5. 1. 2005
Modified		6. 1. 2005
Project		
Model		
Company		
Author		
Version		
Database		mySQL 4.1 
*/








Create table os_udaje (
	rod_cislo Varchar(10) NOT NULL,
	meno Varchar(50) NOT NULL,
	priezvisko Varchar(50) NOT NULL,
	ulica Varchar(50),
	obec Varchar(50),
	psc Varchar(6),
 Primary Key (rod_cislo)) ENGINE = MyISAM
ROW_FORMAT = Default;

Create table student (
	os_cislo Serial NOT NULL,
	rod_cislo Varchar(10) NOT NULL,
	st_odbor Int NOT NULL,
	st_zameranie Int NOT NULL,
	rocnik Tinyint,
	st_skupina Varchar(5),
	opakovanie Char(1),
	prerusenie Char(1),
	forma Char(1),
	ukoncenie Date,
	stav Char(1),
	dat_prv_zap Date,
 Primary Key (os_cislo)) ENGINE = MyISAM
ROW_FORMAT = Default;

Create table predmet (
	cis_predm Varchar(4) NOT NULL,
	gestor Varchar(5) NOT NULL,
	nazov Varchar(50),
	kredit Smallint,
 Primary Key (cis_predm)) ENGINE = MyISAM
ROW_FORMAT = Default;

Create table st_odbory (
	st_odbor Int NOT NULL,
	st_zameranie Int NOT NULL,
	popis_odbory Varchar(200) NOT NULL,
	popis_zameranie Varchar(200),
 Primary Key (st_odbor,st_zameranie)) ENGINE = MyISAM
ROW_FORMAT = Default;

Create table ucitel (
	os_cislo Varchar(5) NOT NULL,
	meno Varchar(50),
	priezvisko Varchar(50) NOT NULL,
	katedra Varchar(50),
 Primary Key (os_cislo)) ENGINE = MyISAM
ROW_FORMAT = Default;

Create table zap_predmety (
	os_cislo Bigint UNSIGNED NOT NULL,
	cis_predm Varchar(4) NOT NULL,
	skrok Int NOT NULL,
	prednasajuci Varchar(5) NOT NULL,
	vysledok Varchar(20),
	datum_sk Date,
	termin Tinyint,
	zapocet Date,
	kredity Int,
 Primary Key (os_cislo,cis_predm,skrok)) ENGINE = MyISAM
ROW_FORMAT = Default;



