-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 15, 2025 at 05:27 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 5.6.39

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: `izlozba_pasa`
--

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

--
-- Table structure for table `boja`
--

CREATE TABLE `boja` (
  `BojaID` int(11) NOT NULL,
  `Boja` varchar(25) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `boja`
--

INSERT INTO `boja` (`BojaID`, `Boja`) VALUES
(1, 'Bela'),
(2, 'crna'),
(3, 'braon'),
(4, 'siva'),
(5, 'zuta'),
(6, 'crno-bela'),
(7, 'braon-bela');

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

--
-- Table structure for table `duzina_dlake`
--

CREATE TABLE `duzina_dlake` (
  `DDID` int(11) NOT NULL,
  `Duzina` varchar(25) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `duzina_dlake`
--

INSERT INTO `duzina_dlake` (`DDID`, `Duzina`) VALUES
(1, 'kratka'),
(2, 'srednja'),
(3, 'duga');

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

--
-- Table structure for table `izlozba`
--

CREATE TABLE `izlozba` (
  `IzlozbaID` char(9) NOT NULL,
  `Mesto` varchar(25) DEFAULT NULL,
  `Datum` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `izlozba`
--

INSERT INTO `izlozba` (`IzlozbaID`, `Mesto`, `Datum`) VALUES
('BEO032021', 'Beograd', '2021-03-09'),
('BEO042021', 'Beograd', '2021-04-14'),
('JAG022020', 'Jagodina', '2020-02-02'),
('JAG032021', 'Jagodina', '2021-03-03'),
('NOV032021', 'Novi Sad', '2021-03-20'),
('ZRE012021', 'Zrenjanin', '2021-01-10'),
('ZRE122020', 'Zrenjanin', '2020-12-12');

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

--
-- Table structure for table `kategorija`
--

CREATE TABLE `kategorija` (
  `KategorijaID` int(11) NOT NULL,
  `Naziv` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `kategorija`
--

INSERT INTO `kategorija` (`KategorijaID`, `Naziv`) VALUES
(1, 'Najmladji'),
(2, 'Mladi'),
(3, 'Srednji'),
(4, 'Stariji'),
(5, 'CACIB'),
(6, 'Sampion mladih');

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

--
-- Table structure for table `pas`
--

CREATE TABLE `pas` (
  `PasID` int(11) NOT NULL,
  `Ime` varchar(25) DEFAULT NULL,
  `Tezina` decimal(5,2) DEFAULT NULL,
  `DDID` int(11) DEFAULT NULL,
  `BojaID` int(11) DEFAULT NULL,
  `RasaID` int(11) DEFAULT NULL,
  `Ostenjen` varchar(25) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `pas`
--

INSERT INTO `pas` (`PasID`, `Ime`, `Tezina`, `DDID`, `BojaID`, `RasaID`, `Ostenjen`) VALUES
(1, 'Alice', '2.23', 3, 1, 2, NULL),
(2, 'Betty', '23.35', 1, 6, 1, NULL),
(3, 'Ginna', '45.45', 2, 2, 3, NULL),
(4, 'Teuta', '15.15', 3, 3, 5, NULL),
(5, 'Silvester', '50.05', 2, 7, 6, NULL),
(6, 'Reks', '40.20', 1, 1, 4, NULL),
(7, 'Maza', '7.70', 3, 1, 2, NULL),
(8, 'Lunja', '25.20', 2, 3, 6, NULL);

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

--
-- Table structure for table `rasa`
--

CREATE TABLE `rasa` (
  `RasaID` int(11) NOT NULL,
  `NazivRase` varchar(25) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `rasa`
--

INSERT INTO `rasa` (`RasaID`, `NazivRase`) VALUES
(1, 'Dalmatinac'),
(2, 'Pudlica'),
(3, 'Staford'),
(4, 'Pit Bul'),
(5, 'Doberman'),
(6, 'mesanac');

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

--
-- Table structure for table `rezultat`
--

CREATE TABLE `rezultat` (
  `IzlozbaID` char(9) NOT NULL,
  `KategorijaID` int(11) NOT NULL,
  `PasID` int(11) NOT NULL,
  `Rezultat` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `rezultat`
--

INSERT INTO `rezultat` (`IzlozbaID`, `KategorijaID`, `PasID`, `Rezultat`) VALUES
('BEO032021', 1, 2, 3),
('BEO032021', 2, 1, 1),
('BEO032021', 2, 3, 2),
('BEO032021', 2, 8, 2),
('BEO042021', 1, 1, 2),
('JAG022020', 2, 1, 3),
('JAG032021', 2, 1, 4),
('JAG032021', 5, 2, 1),
('NOV032021', 4, 5, 1),
('NOV032021', 4, 6, 5);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `boja`
--
ALTER TABLE `boja`
  ADD PRIMARY KEY (`BojaID`);

--
-- Indexes for table `duzina_dlake`
--
ALTER TABLE `duzina_dlake`
  ADD PRIMARY KEY (`DDID`);

--
-- Indexes for table `izlozba`
--
ALTER TABLE `izlozba`
  ADD PRIMARY KEY (`IzlozbaID`);

--
-- Indexes for table `kategorija`
--
ALTER TABLE `kategorija`
  ADD PRIMARY KEY (`KategorijaID`);

--
-- Indexes for table `pas`
--
ALTER TABLE `pas`
  ADD PRIMARY KEY (`PasID`),
  ADD KEY `fk_Pas_Dlaka` (`DDID`),
  ADD KEY `fk_Pas_Boja` (`BojaID`),
  ADD KEY `fk_Pas_Rasa` (`RasaID`);

--
-- Indexes for table `rasa`
--
ALTER TABLE `rasa`
  ADD PRIMARY KEY (`RasaID`);

--
-- Indexes for table `rezultat`
--
ALTER TABLE `rezultat`
  ADD PRIMARY KEY (`IzlozbaID`,`KategorijaID`,`PasID`),
  ADD KEY `fkRezultat_Kategorija` (`KategorijaID`),
  ADD KEY `fk_Rezultat_Pas` (`PasID`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `boja`
--
ALTER TABLE `boja`
  MODIFY `BojaID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `duzina_dlake`
--
ALTER TABLE `duzina_dlake`
  MODIFY `DDID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `kategorija`
--
ALTER TABLE `kategorija`
  MODIFY `KategorijaID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `pas`
--
ALTER TABLE `pas`
  MODIFY `PasID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `rasa`
--
ALTER TABLE `rasa`
  MODIFY `RasaID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `pas`
--
ALTER TABLE `pas`
  ADD CONSTRAINT `fk_Pas_Boja` FOREIGN KEY (`BojaID`) REFERENCES `boja` (`BojaID`),
  ADD CONSTRAINT `fk_Pas_Dlaka` FOREIGN KEY (`DDID`) REFERENCES `duzina_dlake` (`DDID`),
  ADD CONSTRAINT `fk_Pas_Rasa` FOREIGN KEY (`RasaID`) REFERENCES `rasa` (`RasaID`);

--
-- Constraints for table `rezultat`
--
ALTER TABLE `rezultat`
  ADD CONSTRAINT `fkRezultat_Kategorija` FOREIGN KEY (`KategorijaID`) REFERENCES `kategorija` (`KategorijaID`),
  ADD CONSTRAINT `fk_Izlozba_rezultat` FOREIGN KEY (`IzlozbaID`) REFERENCES `izlozba` (`IzlozbaID`),
  ADD CONSTRAINT `fk_Rezultat_Pas` FOREIGN KEY (`PasID`) REFERENCES `pas` (`PasID`);
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 */;
