-- phpMyAdmin SQL Dump
-- version 3.4.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 10, 2012 at 05:37 PM
-- Server version: 5.1.49
-- PHP Version: 5.2.5

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

--
-- Database: `tos2012`
--

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

--
-- Table structure for table `grupa`
--

CREATE TABLE `grupa` (
  `id_grupe` int(11) NOT NULL AUTO_INCREMENT,
  `naziv` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
  `opis` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id_grupe`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=9 ;

--
-- Dumping data for table `grupa`
--

INSERT INTO `grupa` (`id_grupe`, `naziv`, `opis`) VALUES
(1, 'Bajaga i instruktori', 'rok grupa'),
(2, 'Riblja Corba', 'rok grupa'),
(3, 'Plavi orkestar', 'ex yu'),
(4, 'Jelena Rozga - Magazin', 'ex yu'),
(5, 'Zdravko Colic', 'pop'),
(6, 'Neverne bebe', 'rok grupa'),
(7, 'KUD Krsmanac', 'najstariji kud u srbiji'),
(8, 'Kolo', 'ansambl');

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

--
-- Table structure for table `manifestacija`
--

CREATE TABLE `manifestacija` (
  `id_manif` int(11) NOT NULL AUTO_INCREMENT,
  `naziv` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `mesto` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
  `datum_od` date NOT NULL,
  `datum_do` date NOT NULL,
  PRIMARY KEY (`id_manif`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;

--
-- Dumping data for table `manifestacija`
--

INSERT INTO `manifestacija` (`id_manif`, `naziv`, `mesto`, `datum_od`, `datum_do`) VALUES
(1, 'Velikogospojinski dani', 'Novi Becej', '2012-08-23', '2012-08-27'),
(2, 'Ljubicevske konjicke igre', 'Pozarevac', '2012-08-31', '2012-09-02'),
(3, 'Smederevska jesen', 'Smederevo', '2012-09-03', '2012-09-09'),
(4, 'Dani grozdja', 'Vrsac', '2012-09-14', '2012-09-16');

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

--
-- Table structure for table `ucesce`
--

CREATE TABLE `ucesce` (
  `id_ucesce` int(11) NOT NULL AUTO_INCREMENT,
  `id_manif` int(11) NOT NULL,
  `id_grupe` int(11) NOT NULL,
  `datum` date NOT NULL,
  `vreme` time NOT NULL,
  `trajanje` int(11) NOT NULL,
  PRIMARY KEY (`id_ucesce`),
  KEY `id_manif` (`id_manif`),
  KEY `id_grupe` (`id_grupe`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ;

--
-- Dumping data for table `ucesce`
--

INSERT INTO `ucesce` (`id_ucesce`, `id_manif`, `id_grupe`, `datum`, `vreme`, `trajanje`) VALUES
(1, 1, 5, '2012-08-26', '20:00:00', 3),
(2, 1, 4, '2012-08-25', '20:30:00', 2),
(3, 3, 1, '2012-09-07', '20:00:00', 2),
(4, 3, 2, '2012-09-08', '20:30:00', 3),
(5, 3, 8, '2012-09-09', '19:45:00', 2),
(6, 4, 3, '2012-09-15', '20:30:00', 3),
(7, 2, 6, '2012-09-01', '20:15:00', 2);

--
-- Constraints for dumped tables
--

--
-- Constraints for table `ucesce`
--
ALTER TABLE `ucesce`
  ADD CONSTRAINT `ucesce_ibfk_2` FOREIGN KEY (`id_grupe`) REFERENCES `grupa` (`id_grupe`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `ucesce_ibfk_1` FOREIGN KEY (`id_manif`) REFERENCES `manifestacija` (`id_manif`) ON DELETE CASCADE ON UPDATE CASCADE;
