-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jan 10, 2026 at 10:57 AM
-- Server version: 8.2.0
-- PHP Version: 8.2.13

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: `bozic2026`
--
CREATE DATABASE IF NOT EXISTS `bozic2026` DEFAULT CHARACTER SET utf16 COLLATE utf16_bin;
USE `bozic2026`;

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

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

DROP TABLE IF EXISTS `korisnici`;
CREATE TABLE IF NOT EXISTS `korisnici` (
  `kor_ime` varchar(45) COLLATE utf16_bin NOT NULL,
  `lozinka` varchar(45) COLLATE utf16_bin NOT NULL,
  `tip` varchar(45) 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`, `tip`) VALUES
('ana', 'ana123', 'prodavac'),
('jova', 'jova123', 'kupac'),
('maja', 'maja123', 'kupac'),
('pera', 'pera123', '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) COLLATE utf16_bin NOT NULL,
  `proizvodi` varchar(45) COLLATE utf16_bin NOT NULL,
  `racun` int NOT NULL,
  `datum` date NOT NULL,
  PRIMARY KEY (`idN`),
  KEY `kupac` (`kupac`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf16 COLLATE=utf16_bin;

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

INSERT INTO `narudzbine` (`idN`, `kupac`, `proizvodi`, `racun`, `datum`) VALUES
(1, 'pera', 'carape,termos', 2500, '2026-01-09'),
(2, 'jova', 'bombonjera,notes,slusalice', 6750, '2026-01-10'),
(3, 'jova', 'spa dan', 11000, '2026-01-11'),
(4, 'pera', 'carape,mindjuse', 5500, '2026-01-11');

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

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

DROP TABLE IF EXISTS `proizvodi`;
CREATE TABLE IF NOT EXISTS `proizvodi` (
  `naziv` varchar(45) COLLATE utf16_bin NOT NULL,
  `opis` varchar(45) COLLATE utf16_bin NOT NULL,
  `cena` int NOT NULL,
  PRIMARY KEY (`naziv`)
) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_bin;

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

INSERT INTO `proizvodi` (`naziv`, `opis`, `cena`) VALUES
('ajvar', 'tegla 1kg', 1500),
('bombonjera', 'crna cokolada i malina', 1000),
('carape', 'vunene', 500),
('mindjuse', 'srebrne zvezdice', 5000),
('notes', 'sa kalendarom', 1500),
('pisi-brisi olovka', 'irvas', 320),
('rukavice', 'kozne', 1500),
('slusalice', 'bezicne', 5000),
('spa dan', 'west65 spa dan i masaza', 11000),
('termos', '600ml', 2000);

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