-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Feb 19, 2026 at 01:30 AM
-- Server version: 8.0.21
-- PHP Version: 7.4.9

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `zdravlje2026`
--
DROP DATABASE IF EXISTS `zdravlje2026`;
CREATE DATABASE IF NOT EXISTS `zdravlje2026` DEFAULT CHARACTER SET utf16 COLLATE utf16_bin;
USE `zdravlje2026`;

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

--
-- Table structure for table `korisnici`
--

DROP TABLE IF EXISTS `korisnici`;
CREATE TABLE IF NOT EXISTS `korisnici` (
  `kor_ime` varchar(45) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL,
  `lozinka` varchar(45) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL,
  `ime` varchar(45) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL,
  `prezime` varchar(45) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL,
  `mejl` varchar(45) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL,
  `tip` varchar(45) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL,
  PRIMARY KEY (`kor_ime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_bin;

--
-- Dumping data for table `korisnici`
--

INSERT INTO `korisnici` (`kor_ime`, `lozinka`, `ime`, `prezime`, `mejl`, `tip`) VALUES
('jeca', 'jeca123', 'Jelena', 'Jelic', 'jeca@gmail.com', 'kupac'),
('jova', 'jova123', 'Jovan', 'Jovanovic', 'jova@gmail.com', 'kupac'),
('maja', 'maja123', 'Maja', 'Majic', 'maja@gmail.com', 'radnik'),
('pera', 'pera123', 'Petar', 'Petrovic', 'pera@gmail.com', 'kupac');

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

--
-- Table structure for table `narudzbine`
--

DROP TABLE IF EXISTS `narudzbine`;
CREATE TABLE IF NOT EXISTS `narudzbine` (
  `idN` int NOT NULL AUTO_INCREMENT,
  `kupac` varchar(45) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL,
  `proizvod` int NOT NULL,
  `kolicina` int NOT NULL,
  `ocena` tinyint DEFAULT NULL,
  PRIMARY KEY (`idN`),
  KEY `kupac` (`kupac`),
  KEY `proizvod` (`proizvod`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf16 COLLATE=utf16_bin;

--
-- Dumping data for table `narudzbine`
--

INSERT INTO `narudzbine` (`idN`, `kupac`, `proizvod`, `kolicina`, `ocena`) VALUES
(1, 'pera', 1, 2, 5),
(2, 'jova', 2, 5, 4),
(3, 'pera', 3, 1, 4),
(4, 'jova', 3, 1, 5),
(5, 'jeca', 1, 2, 4),
(6, 'jeca', 2, 1, 5),
(7, 'jeca', 4, 3, NULL),
(8, 'maja', 2, 1, 5),
(9, 'maja', 1, 2, 4),
(10, 'maja', 4, 2, NULL);

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

--
-- Table structure for table `proizvodi`
--

DROP TABLE IF EXISTS `proizvodi`;
CREATE TABLE IF NOT EXISTS `proizvodi` (
  `idP` int NOT NULL AUTO_INCREMENT,
  `naziv` varchar(45) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL,
  `namena` varchar(45) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL,
  `podrucje` varchar(45) CHARACTER SET utf16 COLLATE utf16_bin NOT NULL,
  PRIMARY KEY (`idP`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf16 COLLATE=utf16_bin;

--
-- Dumping data for table `proizvodi`
--

INSERT INTO `proizvodi` (`idP`, `naziv`, `namena`, `podrucje`) VALUES
(1, 'Matičnjak', 'za opuštanje', 'Rtanj'),
(2, 'Majčina dušica', 'antiseptik i jacanje imuniteta', 'Ozren'),
(3, 'Nana', 'za stomačne probleme', 'Tara'),
(4, 'Hajdučka trava', 'za zalečenje rana', 'Tara'),
(5, 'Rtanjski', 'za imunitet i za nadutost', 'Rtanj'),
(6, 'Hibiskus', 'za krvni pritisak, holesterol i mršavljenje', 'Deliblatska peščara'),
(7, 'Šipurak', 'Za zdravlje bubrega, bešike i kože', 'Kopaonik, Fruška Gora');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `narudzbine`
--
ALTER TABLE `narudzbine`
  ADD CONSTRAINT `narudzbine_ibfk_1` FOREIGN KEY (`kupac`) REFERENCES `korisnici` (`kor_ime`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  ADD CONSTRAINT `narudzbine_ibfk_2` FOREIGN KEY (`proizvod`) REFERENCES `proizvodi` (`idP`) ON DELETE RESTRICT ON UPDATE RESTRICT;
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 */;
