-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Nov 23, 2018 at 01:10 AM
-- Server version: 5.7.21
-- PHP Version: 7.2.4

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
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 utf8mb4 */;

--
-- Database: `koncerti2018`
--
DROP DATABASE IF EXISTS `koncerti2018`;
CREATE DATABASE IF NOT EXISTS `koncerti2018` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `koncerti2018`;

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

--
-- Table structure for table `koncert`
--

DROP TABLE IF EXISTS `koncert`;
CREATE TABLE IF NOT EXISTS `koncert` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `izvodjac` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `mesto` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `datum` date NOT NULL,
  `vreme` time NOT NULL,
  `cena` double NOT NULL,
  `brojProdatih` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FK_organizator_naziv` (`mesto`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `koncert`
--

INSERT INTO `koncert` (`id`, `izvodjac`, `mesto`, `datum`, `vreme`, `cena`, `brojProdatih`) VALUES
(1, 'Djavoli i Neno Belan', 'Dom omladine', '2018-11-22', '21:00:00', 1400, 3280),
(2, 'Balkanopolis', 'Sava centar', '2018-11-24', '20:00:00', 2300, 2748),
(3, 'Kaliopi', 'Sava centar', '2018-11-25', '20:00:00', 2500, 2750),
(5, 'Bajaga i instruktori', 'Arena Beograd', '2018-12-01', '21:00:00', 3000, 22000),
(6, 'Zeljko Joksimovic', 'Sava centar', '2018-12-03', '18:00:00', 3500, 50),
(7, 'Djordje Balasevic', 'Dvorana Doma Sindikata', '2018-12-03', '20:00:00', 4000, 2198),
(8, 'Djordje Balasevic', 'Dvorana Doma Sindikata', '2018-12-04', '20:00:00', 4000, 2100),
(9, 'Vlado Georgiev', 'Hala sportova Ranko Žeravica', '2018-12-13', '20:00:00', 3200, 500),
(10, 'Miroslav Ilic', 'Sava centar', '2018-12-13', '20:00:00', 1500, 333),
(11, 'Goran Bregovic', 'Arena Beograd', '2018-12-15', '21:00:00', 5000, 2),
(12, 'Zabranjeno pusenje', 'Dom omladine', '2018-12-15', '22:00:00', 1200, 0),
(13, 'Korni grupa', 'Sava centar', '2018-12-16', '21:00:00', 1000, 0),
(14, 'Gipsy Kings', 'Hala sportova Ranko Žeravica', '2018-12-16', '22:00:00', 1450, 0),
(15, 'Zeljko Joksimovic', 'Sava centar', '2018-12-18', '20:00:00', 4500, 0),
(16, 'Bisera Veletanic i Gabi Novak', 'Dvorana Doma Sindikata', '2018-12-18', '19:30:00', 1900, 0),
(17, 'Haris Dzinovic', 'Arena Beograd', '2018-12-18', '21:00:00', 2600, 0),
(18, 'Dragan Kojic', 'Hala sportova Ranko Žeravica', '2018-12-18', '20:00:00', 1700, 0),
(19, 'Vlado Georgiev', 'Sava centar', '2018-12-15', '21:00:00', 3300, 0);

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

--
-- Table structure for table `organizator`
--

DROP TABLE IF EXISTS `organizator`;
CREATE TABLE IF NOT EXISTS `organizator` (
  `username` bigint(20) NOT NULL COMMENT 'Poreski ident. broj',
  `password` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `adresa` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `max_broj_poseta` int(11) NOT NULL,
  PRIMARY KEY (`username`),
  UNIQUE KEY `UNIQUE_name` (`name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `organizator`
--

INSERT INTO `organizator` (`username`, `password`, `name`, `adresa`, `max_broj_poseta`) VALUES
(111222333, 'Organizator123', 'Arena Beograd', 'Bulevar Arsenija Čarnojevica 58', 22500),
(222333444, 'Organizator123', 'Sava centar', 'Milentija Popovića 9', 2750),
(333444555, 'Organizator123', 'Dvorana Doma Sindikata', 'Trg Nikole Pašića', 2200),
(444555666, 'Organizator123', 'Dom omladine', 'Makedonska 22', 3300),
(555666777, 'Organizator123', 'Hala sportova Ranko Žeravica', 'Pariske komune 20', 5000);

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

--
-- Table structure for table `posetilac`
--

DROP TABLE IF EXISTS `posetilac`;
CREATE TABLE IF NOT EXISTS `posetilac` (
  `korime` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `lozinka` 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,
  `godinarodj` int(11) NOT NULL,
  `banka_racun` double NOT NULL,
  PRIMARY KEY (`korime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `posetilac`
--

INSERT INTO `posetilac` (`korime`, `lozinka`, `ime`, `prezime`, `godinarodj`, `banka_racun`) VALUES
('bosko', 'Sifra123', 'Bosko', 'Nikolic', 1975, 24500),
('drasko', 'Sifra123', 'Drazen', 'Draskovic', 1988, 13000),
('jelica', 'Sifra1234', 'Jelica', 'Cincović', 2001, 19500),
('sanja', 'Sifra1234', 'Sanja', 'Delčev', 2000, 21200);

--
-- Constraints for dumped tables
--

--
-- Constraints for table `koncert`
--
ALTER TABLE `koncert`
  ADD CONSTRAINT `fk_organizator` FOREIGN KEY (`mesto`) REFERENCES `organizator` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

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