-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 11, 2014 at 06:46 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: `spanija14`
--
CREATE DATABASE `spanija14` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `spanija14`;

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

--
-- 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,
  `osoba` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `godine` int(11) NOT NULL,
  `is_admin` tinyint(4) NOT NULL,
  `glasao` tinyint(4) NOT NULL,
  PRIMARY KEY (`korisnickoime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

INSERT INTO `korisnik` (`korisnickoime`, `lozinka`, `osoba`, `godine`, `is_admin`, `glasao`) VALUES
('aca', 'sifra123', 'Aca Stojanovic', 36, 0, 0),
('admin', 'sifra123', 'Admin Adminovic', 30, 1, 0),
('boban', 'sifra123', 'Slobodan Sarenac', 43, 0, 0),
('dusko', 'sifra123', 'Dusko Korac', 49, 0, 0),
('milojko', 'sifra123', 'Milojko Pantic', 56, 0, 0),
('nebojsa', 'sifra123', 'Nebojsa Viskovic', 38, 0, 0),
('pedja', 'sifra123', 'Predrag Strajnic', 42, 0, 1);

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

--
-- Table structure for table `kosarkas`
--

CREATE TABLE IF NOT EXISTS `kosarkas` (
  `ime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `tim` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
  `pozicija` varchar(1) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `kosarkas`
--

INSERT INTO `kosarkas` (`ime`, `tim`, `pozicija`) VALUES
('Batum', 'FRA', 'K'),
('Bjelica N', 'SRB', 'K'),
('Bogdanovic B', 'SRB', 'B'),
('Curry S', 'USA', 'B'),
('Davis A', 'USA', 'C'),
('Diaw B', 'FRA', 'K'),
('Gasol P', 'ESP', 'C'),
('Kalinic N', 'SRB', 'K'),
('Krstic N', 'SRB', 'C'),
('Lauvregne', 'FRA', 'C'),
('Navarro J', 'ESP', 'B'),
('Raduljica M', 'SRB', 'C'),
('Teodosic M', 'SRB', 'B'),
('Varejao A', 'BRA', 'K');

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

--
-- Table structure for table `statistika`
--

CREATE TABLE IF NOT EXISTS `statistika` (
  `idzapis` int(11) NOT NULL AUTO_INCREMENT,
  `min` int(11) NOT NULL,
  `poe` int(11) NOT NULL,
  `sko` int(11) NOT NULL,
  `asi` int(11) NOT NULL,
  `ukr` int(11) NOT NULL,
  `blo` int(11) NOT NULL,
  `kosarkas` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`idzapis`),
  KEY `kosarkas` (`kosarkas`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=24 ;

--
-- Dumping data for table `statistika`
--

INSERT INTO `statistika` (`idzapis`, `min`, `poe`, `sko`, `asi`, `ukr`, `blo`, `kosarkas`) VALUES
(1, 28, 23, 3, 4, 1, 0, 'Teodosic M'),
(2, 26, 12, 6, 2, 0, 2, 'Bogdanovic B'),
(3, 29, 8, 8, 5, 0, 1, 'Bjelica N'),
(4, 22, 5, 2, 1, 1, 1, 'Kalinic N'),
(5, 20, 10, 4, 1, 0, 0, 'Raduljica M'),
(6, 16, 10, 1, 2, 0, 1, 'Krstic N'),
(7, 26, 12, 9, 0, 1, 1, 'Varejao A'),
(8, 31, 17, 8, 1, 1, 3, 'Gasol P'),
(9, 29, 15, 5, 3, 1, 0, 'Diaw B'),
(10, 26, 10, 1, 1, 0, 0, 'Navarro J'),
(11, 32, 13, 2, 2, 1, 0, 'Teodosic M'),
(12, 27, 21, 1, 2, 0, 0, 'Bogdanovic B'),
(13, 21, 12, 4, 2, 1, 0, 'Kalinic N'),
(14, 24, 16, 6, 1, 0, 0, 'Raduljica M'),
(15, 14, 10, 0, 1, 0, 0, 'Krstic N'),
(16, 31, 8, 10, 2, 2, 0, 'Bjelica N'),
(17, 24, 17, 5, 1, 0, 3, 'Gasol P'),
(18, 23, 4, 1, 1, 0, 0, 'Navarro J'),
(19, 27, 3, 5, 5, 0, 1, 'Diaw B'),
(20, 18, 8, 2, 1, 0, 0, 'Lauvregne'),
(21, 31, 14, 2, 1, 4, 1, 'Batum'),
(22, 17, 6, 1, 2, 1, 0, 'Curry S'),
(23, 20, 13, 11, 1, 0, 3, 'Davis A');

--
-- Table structure for table `glas`
--

CREATE TABLE IF NOT EXISTS `glas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `novinar` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
  `kosarkas` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `novinar` (`novinar`),
  KEY `kosarkas` (`kosarkas`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ;

--
-- Dumping data for table `glas`
--

INSERT INTO `glas` (`id`, `novinar`, `kosarkas`) VALUES
(1, 'pedja', 'Teodosic M'),
(2, 'pedja', 'Bogdanovic B'),
(3, 'pedja', 'Bjelica N'),
(4, 'pedja', 'Batum'),
(5, 'pedja', 'Raduljica M');

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


--
-- Constraints for dumped tables
--

--
-- Constraints for table `glas`
--
ALTER TABLE `glas`
  ADD CONSTRAINT `glas_ibfk_2` FOREIGN KEY (`kosarkas`) REFERENCES `kosarkas` (`ime`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `glas_ibfk_1` FOREIGN KEY (`novinar`) REFERENCES `korisnik` (`korisnickoime`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `statistika`
--
ALTER TABLE `statistika`
  ADD CONSTRAINT `statistika_ibfk_1` FOREIGN KEY (`kosarkas`) REFERENCES `kosarkas` (`ime`) 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 */;
