-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 08, 2014 at 06:31 PM
-- Server version: 5.5.24-log
-- PHP Version: 5.4.3

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: `jobfair13`
--
CREATE DATABASE `jobfair13` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `jobfair13`;

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

--
-- Table structure for table `student`
--

CREATE TABLE IF NOT EXISTS `student` (
  `username` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `password` 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,
  `email` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `fakultet` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `diplomirao` tinyint(1) NOT NULL,
  `CV` varchar(300) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `student`
--

INSERT INTO `student` (`username`, `password`, `ime`, `prezime`, `email`, `fakultet`, `diplomirao`, `CV`) VALUES
('drasko', 'sifra123', 'Drasko', 'Draskovic', 'dd@student.etf.rs', 'Elektrotehnicki fakultet', 1, 'Znanja: C++, Java, PHP'),
('jasna', 'sifra123', 'Jasna', 'Jasnic', 'jj@student.etf.rs', 'Elektrotehnicki fakultet', 1, 'CCNA polozen'),
('katarina', 'sifra123', 'Katarina', 'Katic', 'kk@student.etf.rs', 'Elektrotehnicki fakultet', 0, 'menadzerske sposobnosti'),
('nemanja', 'sifra123', 'Nemanja', 'Nemanjic', 'nn@student.etf.rs', 'Elektrotehnicki fakultet', 1, 'Volim sve sto vole mladi'),
('petar', 'sifra123', 'Petar', 'Petrovic', 'pp@student.etf.rs', 'Elektrotehnicki fakultet', 1, 'Najbolji roboticar u Srbiji');

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

--
-- Table structure for table `kompanija`
--

CREATE TABLE IF NOT EXISTS `kompanija` (
  `naziv` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `sifra` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `delatnost` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `br_zaposlenih` int(11) NOT NULL,
  `adresa` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `telefon` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`naziv`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `kompanija`
--

INSERT INTO `kompanija` (`naziv`, `sifra`, `delatnost`, `br_zaposlenih`, `adresa`, `telefon`) VALUES
('ericsson', 'pass123', 'telekomunikacije', 50, 'www.ericsson.com', '0112013700'),
('institutpupin', 'pass123', 'robotika', 30, 'www.pupin.rs', '0111234567'),
('microsoft', 'pass123', 'razvoj softvera', 112, 'http://www.microsoft.com/serbia/mdcs/', '0113306600'),
('nordeus', 'pass123', 'razvoj igrica', 108, 'www.nordeus.com', '0111112233'),
('telenor', 'pass123', 'telekomunikacije', 700, 'www.telenor.rs', '0118887766');

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

--
-- Table structure for table `konkurs`
--

CREATE TABLE IF NOT EXISTS `konkurs` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `obrazovni_profil` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `znanja` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `osobine` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `zahtevani_brgodstudija` int(11) NOT NULL,
  `radno_iskustvo` tinyint(1) NOT NULL,
  `broj_otv_pozicija` int(11) NOT NULL,
  `naziv_kompanije` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `naziv` (`naziv_kompanije`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;

--
-- Dumping data for table `konkurs`
--

INSERT INTO `konkurs` (`ID`, `obrazovni_profil`, `znanja`, `osobine`, `zahtevani_brgodstudija`, `radno_iskustvo`, `broj_otv_pozicija`, `naziv_kompanije`) VALUES
(1, 'Inženjer za razvoj softvera', 'poznavanje programiranja u C, C++, Java ili C# ', 'Odlicno znanje eng.jezika', 3, 0, 5, 'microsoft'),
(2, 'Inzenjer telekomunikacija', 'CCNA, CCNP', 'komunikativnost', 4, 0, 3, 'ericsson'),
(3, 'Softverski inženjer za igre', 'Java, C#, Flash', 'spreman za rad u timu', 3, 0, 10, 'nordeus'),
(4, 'Softverski inženjer za mobilne app', 'Android, iOS', 'spremnost za rad u timu, komunikativnost', 3, 0, 7, 'nordeus'),
(5, 'Diplomirani inzenjer elektrotehnike', 'Robotika, robotski sistemi', 'komunikativnost, dobro poznavanje nemackog jezika', 4, 1, 2, 'institutpupin'),
(6, 'Softverski inzenjer', 'IT', 'Super', 4, 1, 3, 'institutpupin');

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

--
-- Table structure for table `prijava`
--

CREATE TABLE IF NOT EXISTS `prijava` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idKonkurs` int(11) NOT NULL,
  `idStudent` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idKompanija` (`idKonkurs`),
  KEY `idStudent` (`idStudent`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;

--
-- Dumping data for table `prijava`
--

INSERT INTO `prijava` (`id`, `idKonkurs`, `idStudent`) VALUES
(1, 1, 'drasko'),
(2, 1, 'nemanja'),
(3, 2, 'jasna'),
(4, 2, 'katarina'),
(5, 3, 'drasko'),
(6, 4, 'nemanja');

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


--
-- Constraints for dumped tables
--

--
-- Constraints for table `konkurs`
--
ALTER TABLE `konkurs`
  ADD CONSTRAINT `konkurs_ibfk_1` FOREIGN KEY (`naziv_kompanije`) REFERENCES `kompanija` (`naziv`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `prijava`
--
ALTER TABLE `prijava`
  ADD CONSTRAINT `prijava_ibfk_1` FOREIGN KEY (`idKonkurs`) REFERENCES `konkurs` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `prijava_ibfk_2` FOREIGN KEY (`idStudent`) REFERENCES `student` (`username`) 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 */;
