-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 12, 2017 at 04:55 PM
-- 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: `doktoranti2017`
--
CREATE DATABASE IF NOT EXISTS `doktoranti2017` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `doktoranti2017`;

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

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

CREATE TABLE IF NOT EXISTS `korisnik` (
  `korisnickoime` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `lozinka` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `ime` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `prezime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `je_nastavnik` tinyint(1) NOT NULL,
  `zvanje` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
  `brojindeksa` varchar(9) COLLATE utf8_unicode_ci DEFAULT NULL,
  `brojispita` int(11) DEFAULT NULL,
  PRIMARY KEY (`korisnickoime`),
  UNIQUE KEY `brojindeksa` (`brojindeksa`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `korisnik` (`korisnickoime`, `lozinka`, `ime`, `prezime`, `je_nastavnik`, `zvanje`, `brojindeksa`, `brojispita`) VALUES
('cmilos', 'nastavnik123', 'Milos', 'Cvetanovic', 1, 'docent', NULL, NULL),
('dm', 'nastavnik123', 'Dragan', 'Milicev', 1, 'redovni prof.', NULL, NULL),
('drasko', 'sifra123', 'Drazen', 'Draskovic', 0, NULL, '2011/5001', 10),
('jeca', 'nastavnik123', 'Jelica', 'Protic', 1, 'vanredni prof.', NULL, NULL),
('markovic', 'sifra123', 'Marko', 'Markovic', 0, NULL, '2010/5050', 9),
('misic', 'sifra123', 'Marko', 'Misic', 0, NULL, '2010/5100', 10),
('mvt', 'nastavnik123', 'Milo', 'Tomasevic', 1, 'redovni prof.', NULL, NULL),
('nbosko', 'nastavnik123', 'Bosko', 'Nikolic', 1, 'redovni prof.', NULL, NULL),
('nemanja', 'sifra123', 'Nemanja', 'Kojic', 0, NULL, '2011/5123', 10),
('petar', 'sifra123', 'Petar', 'Petrovic', 0, NULL, '2011/5005', 7),
('vm', 'nastavnik123', 'Veljko', 'Milutinovic', 1, 'redovni prof. u penziji', NULL, NULL),
('vuk', 'sifra123', 'Vuk', 'Vukovic', 0, NULL, '2012/5001', 10),
('zaki', 'nastavnik123', 'Zaki', 'Radivojevic', 1, 'docent', NULL, NULL);

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

--
-- Table structure for table `naucnirad`
--

CREATE TABLE IF NOT EXISTS `naucnirad` (
  `ident` int(11) NOT NULL AUTO_INCREMENT,
  `naslov_rada` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `naziv` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `objava` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ident`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=17 ;

--
-- Dumping data for table `naucnirad`
--

INSERT INTO `naucnirad` (`ident`, `naslov_rada`, `naziv`, `objava`) VALUES
(1, 'A Survey and Evaluation of\nSimulators Suitable for Teaching Courses in Computer Architecture', 'IEEE TRANSACTIONS ON EDUCATION', '11/2009'),
(2, 'A Classification of Mutational Approaches for Genetic Search', 'IEEE ICIT', '05/2012'),
(3, 'A Survey of Intelligent Question Routing Systems', 'IEEE IS', '12/2012'),
(4, 'A Memory System for Education', 'Computer Journal', '11/2005'),
(5, 'Intelligent Systems for finance and stocks', 'YU Info 2017', '03/2017'),
(6, 'Software System for learning AI', 'Africon 2015', '09/2015'),
(7, 'Hardware Approaches to Cache Coherence in Shared-Memory Multiprocessors,\r\nPart 1', 'IEEE Micro', '10/1994'),
(8, 'Hardware Approaches to Cache Coherence in Shared-Memory Multiprocessors,\r\nPart 2', 'IEEE micro', '12/1994'),
(9, 'USPI - R&D in software project management', 'IPSI conference', '05/2005'),
(10, 'WHO TO WRITE PHD - GOOD METHOD', 'Advance in computers', '07/2017'),
(11, 'Sistem za detekciju plagijarizama', 'YU info 2015', '05/2015'),
(12, 'Analiza sistema za plagijate', 'ETRAN 2016', '06/2016'),
(13, 'Paralelizacija algoritma za plagijate', 'Journal of CE education', '10/2016'),
(14, 'Znacaj prepisivanja na Programiranju 1 i 2 po unapredjenje nastave', 'Trend Zlatibor', '02/2017'),
(15, 'Modelovanje sistema velikih razmera primenjeno u praksi: razvoj složenih poslovnih\naplikacija', 'Info M Journal', '12/2012'),
(16, 'A Classification and Comparison of Data Mining Algorithms\nfor Wireless Sensor Networks', 'IEEE ICIT', '05/2013');


-- --------------------------------------------------------
--
-- Table structure for table `autorirada`
--

CREATE TABLE IF NOT EXISTS `autorirada` (
  `id_rad` int(11) NOT NULL,
  `id_autor` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_rad`,`id_autor`),
  KEY `id_autor` (`id_autor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `autorirada`
--

INSERT INTO `autorirada` (`id_rad`, `id_autor`) VALUES
(15, 'dm'),
(16, 'dm'),
(2, 'drasko'),
(5, 'drasko'),
(6, 'drasko'),
(10, 'drasko'),
(9, 'jeca'),
(11, 'jeca'),
(12, 'jeca'),
(13, 'jeca'),
(14, 'jeca'),
(10, 'misic'),
(11, 'misic'),
(12, 'misic'),
(13, 'misic'),
(14, 'misic'),
(4, 'mvt'),
(7, 'mvt'),
(8, 'mvt'),
(11, 'mvt'),
(12, 'mvt'),
(13, 'mvt'),
(1, 'nbosko'),
(2, 'nbosko'),
(3, 'nbosko'),
(4, 'nbosko'),
(5, 'nbosko'),
(6, 'nbosko'),
(6, 'nemanja'),
(10, 'nemanja'),
(15, 'nemanja'),
(16, 'nemanja'),
(3, 'vm'),
(7, 'vm'),
(8, 'vm'),
(9, 'vm'),
(10, 'vm'),
(16, 'vm'),
(10, 'vuk'),
(1, 'zaki'),
(4, 'zaki');

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

--
-- Table structure for table `doktorat`
--

CREATE TABLE IF NOT EXISTS `doktorat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `doktorant` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `tema` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `datumprijave` date NOT NULL,
  `idmentor1` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `idmentor2` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idmentor1` (`idmentor1`),
  KEY `idmentor2` (`idmentor2`),
  KEY `doktorant` (`doktorant`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

--
-- Dumping data for table `doktorat`
--

INSERT INTO `doktorat` (`id`, `doktorant`, `tema`, `datumprijave`, `idmentor1`, `idmentor2`) VALUES
(1, 'vuk', 'Obrada prirodnog jezika na analizi tekstova sa veb portala paralelizovana za Maxeler', '2017-03-01', 'vm', NULL),
(2, 'misic', 'Unapredjenje sistema za obradu plagijarzima kod studentskih radova', '2017-04-04', 'mvt', 'jeca');


--
-- Constraints for dumped tables
--

--
-- Constraints for table `autorirada`
--
ALTER TABLE `autorirada`
  ADD CONSTRAINT `autorirada_ibfk_2` FOREIGN KEY (`id_autor`) REFERENCES `korisnik` (`korisnickoime`),
  ADD CONSTRAINT `autorirada_ibfk_1` FOREIGN KEY (`id_rad`) REFERENCES `naucnirad` (`ident`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `doktorat`
--
ALTER TABLE `doktorat`
  ADD CONSTRAINT `doktorat_ibfk_1` FOREIGN KEY (`doktorant`) REFERENCES `korisnik` (`korisnickoime`),
  ADD CONSTRAINT `doktorat_ibfk_2` FOREIGN KEY (`idmentor1`) REFERENCES `korisnik` (`korisnickoime`),
  ADD CONSTRAINT `doktorat_ibfk_3` FOREIGN KEY (`idmentor2`) REFERENCES `korisnik` (`korisnickoime`);

/*!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 */;
