-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 10, 2014 at 12:32 AM
-- 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: `primer_fudbal`
--
CREATE DATABASE `primer_fudbal` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `primer_fudbal`;

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

--
-- Table structure for table `grad`
--

CREATE TABLE IF NOT EXISTS `grad` (
  `idgrad` int(11) NOT NULL AUTO_INCREMENT,
  `ime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `ime_zemlje` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`idgrad`),
  KEY `ime_zemlje` (`ime_zemlje`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=15 ;

--
-- Dumping data for table `grad`
--

INSERT INTO `grad` (`idgrad`, `ime`, `ime_zemlje`) VALUES
(1, 'Beograd', 'Srbija'),
(2, 'Novi Sad', 'Srbija'),
(3, 'Madrid', 'Spanija'),
(4, 'Barselona', 'Spanija'),
(5, 'London', 'Engleska'),
(6, 'Mancester', 'Engleska'),
(7, 'Liverpul', 'Engleska'),
(8, 'Pariz', 'Francuska'),
(9, 'Minhen', 'Nemacka'),
(10, 'Dortmund', 'Nemacka'),
(11, 'Rim', 'Italija'),
(12, 'Milano', 'Italija'),
(13, 'Torino', 'Italija'),
(14, 'Napulj', 'Italija');

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

--
-- Table structure for table `klub`
--

CREATE TABLE IF NOT EXISTS `klub` (
  `idklub` int(11) NOT NULL AUTO_INCREMENT,
  `ime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `idgrad` int(11) NOT NULL,
  `stadion` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `godina_osnivanja` int(11) NOT NULL,
  `nadimak` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`idklub`),
  KEY `idgrad` (`idgrad`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=22 ;

--
-- Dumping data for table `klub`
--

INSERT INTO `klub` (`idklub`, `ime`, `idgrad`, `stadion`, `godina_osnivanja`, `nadimak`) VALUES
(1, 'Crvena Zvezda', 1, 'Marakana', 1946, 'Delije'),
(2, 'Partizan', 1, 'JNA', 1945, 'Grobari'),
(3, 'Real Madrid', 3, 'Santjago Bernabeu', 1902, 'Galaktikosi'),
(4, 'Atletiko Madrid', 3, 'Vinsente Kalderon', 1903, 'Jorgandzije'),
(5, 'Rajo Valjekano', 3, 'Kampo de fudbol de Valjekas', 1924, 'Franjijoros'),
(6, 'Barselona', 4, 'Kamp Nou', 1899, 'Blaugrana'),
(7, 'Espanjol', 4, 'Kornelja El Plat', 1900, 'Blanquiazules'),
(8, 'Arsenal', 5, 'Emirates', 1886, 'The Gunners'),
(9, 'Chelsea', 5, 'Stamford Bridge', 1905, 'The Pensioners'),
(10, 'Fulam', 5, 'Krejven Kotidz', 1879, 'The Cottagers'),
(11, 'Tottenham', 5, 'Vart Hart Lejn', 1882, 'The Spurs'),
(12, 'Manchester UTD', 6, 'Old Traford', 1878, 'Crveni djavoli'),
(13, 'Manchester City', 6, 'Gradski', 1880, 'Gradjani'),
(14, 'Roma', 11, 'Olimpiko', 1927, 'Giallorossi'),
(15, 'Lazio', 11, 'Olimpiko', 1900, 'Biancocelesti'),
(16, 'Inter', 12, 'Djuzepe Meaca', 1908, 'Nerazzurri'),
(17, 'AC Milan', 12, 'San Siro', 1899, 'Rosoneri'),
(18, 'Juventus', 13, 'Juventus', 1897, 'Stara dama'),
(19, 'Napoli', 14, 'Sao Paulo', 1926, 'Partenopei'),
(20, 'Bajern', 9, 'Allianz Arena', 1900, 'Bavarci'),
(21, 'Borusija', 10, 'Westfalenstadion', 1909, 'Crno-zuti');

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

--
-- Table structure for table `zemlja`
--

CREATE TABLE IF NOT EXISTS `zemlja` (
  `ime_zemlje` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`ime_zemlje`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `zemlja`
--

INSERT INTO `zemlja` (`ime_zemlje`) VALUES
('Engleska'),
('Francuska'),
('Italija'),
('Nemacka'),
('Spanija'),
('Srbija');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `grad`
--
ALTER TABLE `grad`
  ADD CONSTRAINT `grad_ibfk_1` FOREIGN KEY (`ime_zemlje`) REFERENCES `zemlja` (`ime_zemlje`) 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 */;
