CREATE DATABASE  IF NOT EXISTS `rasadnik` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `rasadnik`;
-- MySQL dump 10.13  Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1    Database: rasadnik
-- ------------------------------------------------------
-- Server version	5.7.20-log

/*!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 utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

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

DROP TABLE IF EXISTS `korisnici`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `korisnici` (
  `ime` varchar(45) DEFAULT NULL,
  `prezime` varchar(45) DEFAULT NULL,
  `korisnickoime` varchar(45) NOT NULL,
  `lozinka` varchar(45) DEFAULT NULL,
  `mejl` varchar(45) DEFAULT NULL,
  `tip` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`korisnickoime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

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

LOCK TABLES `korisnici` WRITE;
/*!40000 ALTER TABLE `korisnici` DISABLE KEYS */;
INSERT INTO `korisnici` VALUES ('kupac','kupac','kupac','kupac123','kupac@gmail.com','kupac'),('Marko','Markovic','mare','mare123','markovic@gmail.com','radnik'),('Nikola','Nikolic','nikola','nikola123','nikolic@gmail.com','radnik'),('Petar','Petrovic','pera','pera123','petrovic@gmail.com','radnik');
/*!40000 ALTER TABLE `korisnici` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `sadnice`
--

DROP TABLE IF EXISTS `sadnice`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sadnice` (
  `korisnik` varchar(45) NOT NULL,
  `sadnica` varchar(45) NOT NULL,
  `podvrsta` varchar(45) NOT NULL,
  `rezervisano` int(11) DEFAULT NULL,
  `kupljeno` int(11) DEFAULT NULL,
  PRIMARY KEY (`korisnik`,`sadnica`,`podvrsta`),
  CONSTRAINT `korisnik` FOREIGN KEY (`korisnik`) REFERENCES `korisnici` (`korisnickoime`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `sadnice`
--

LOCK TABLES `sadnice` WRITE;
/*!40000 ALTER TABLE `sadnice` DISABLE KEYS */;
INSERT INTO `sadnice` VALUES ('mare','cetinari','jela',5,7),('mare','cetinari','tuja',5,7),('mare','liscari','ginko',6,1),('mare','liscari','kesten',5,8),('nikola','cetinari','kleka',5,7),('nikola','cetinari','tuja',5,7),('nikola','liscari','jorgovan',6,1),('nikola','liscari','vrba',5,8),('pera','trajnice','ehinacea',4,2),('pera','trajnice','lavanda',0,5),('pera','voce','breskva',5,0),('pera','voce','kajsija',0,7);
/*!40000 ALTER TABLE `sadnice` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2019-01-24 11:28:57
