-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 28, 2016 at 02:36 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `prijemni2016`
--
CREATE DATABASE IF NOT EXISTS `prijemni2016` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `prijemni2016`;

-- --------------------------------------------------------

--
-- Table structure for table `administrator`
--

DROP TABLE IF EXISTS `administrator`;
CREATE TABLE IF NOT EXISTS `administrator` (
  `kime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `lozinka` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `ime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `prezime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`kime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `administrator`
--

INSERT INTO `administrator` (`kime`, `lozinka`, `ime`, `prezime`) VALUES
('admin', 'admin123', 'Admin', 'Adminović'),
('bosko', 'bosko123', 'Boško', 'Nikolić');

-- --------------------------------------------------------

--
-- Table structure for table `korisnik`
--

DROP TABLE IF EXISTS `korisnik`;
CREATE TABLE IF NOT EXISTS `korisnik` (
  `korime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `lozinka` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `ime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `prezime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `srednja` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
  `prvilogin` tinyint(4) NOT NULL,
  PRIMARY KEY (`korime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `korisnik`
--

INSERT INTO `korisnik` (`korime`, `lozinka`, `ime`, `prezime`, `srednja`, `prvilogin`) VALUES
('ana', 'sifra123', 'Aleksandra', 'Marjanović', 'Gimnazija Valjevo', 1),
('drasko', 'sifra123', 'Dražen', 'Drašković', 'Gimnazija Smederevo', 1),
('kandidat1', 'sifra123', 'Kandidat1', 'Kandidatovic', 'Elektrotehnicka skola', 0),
('kandidat2', 'sifra123', 'Kandidat2', 'Kandidatovic', 'Elektrotehnicka skola', 0),
('kandidat3', 'sifra123', 'Kandidat3', 'Kandidatovic', 'Elektrotehnicka skola', 0),
('kandidat4', 'sifra123', 'Kandidat4', 'Kandidatovic', 'Elektrotehnicka skola', 0),
('kandidat5', 'sifra123', 'Kandidat5', 'Kandidatovic', 'Gimnazija Kraljevo', 0),
('kandidat6', 'sifra123', 'Kandidat6', 'Kandidatovic', 'Gimnazija Kruševac', 0),
('krle', 'sifra123', 'Marko', 'Krstić', 'Gimnazija Niš', 1),
('milana', 'sifra123', 'Milana', 'Prodanov', 'Matematicka gimnazija', 0),
('sanja', 'sifra123', 'Sanja', 'Delčev', 'Matematicka gimnazija', 0),
('stefan', 'sifra123', 'Stefan', 'Tubić', 'Gimnazija KG', 1);

-- --------------------------------------------------------

--
-- Table structure for table `uspeh`
--

DROP TABLE IF EXISTS `uspeh`;
CREATE TABLE IF NOT EXISTS `uspeh` (
  `ident` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `prvi` double DEFAULT NULL,
  `drugi` double DEFAULT NULL,
  `treci` double DEFAULT NULL,
  `cetvrti` double DEFAULT NULL,
  `prijemni` double DEFAULT NULL,
  `oznaka` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL,
  `zelim_upis` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`ident`),
  KEY `ident` (`ident`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `uspeh`
--

INSERT INTO `uspeh` (`ident`, `prvi`, `drugi`, `treci`, `cetvrti`, `prijemni`, `oznaka`, `zelim_upis`) VALUES
('ana', 5, 5, 5, 5, NULL, NULL, NULL),
('drasko', 5, 5, 4.88, 5, NULL, NULL, NULL),
('krle', 5, 4.75, 5, 5, NULL, NULL, NULL),
('stefan', 4.8, 4.8, 5, 5, NULL, NULL, NULL);

--
-- Constraints for dumped tables
--

--
-- Constraints for table `uspeh`
--
ALTER TABLE `uspeh`
  ADD CONSTRAINT `uspeh_ibfk_1` FOREIGN KEY (`ident`) REFERENCES `korisnik` (`korime`) ON DELETE CASCADE ON UPDATE CASCADE;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
