SHARE
TWEET

Untitled

a guest Dec 6th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. DROP DATABASE IF EXISTS fakultet_novi;
  3. CREATE DATABASE fakultet_novi;
  4. DROP USER IF EXISTS 'fakultet_novi'@'localhost';
  5. CREATE USER 'fakultet_novi'@'localhost' IDENTIFIED BY 'fakultet_novi';
  6. GRANT ALL ON fakultet_novi.* TO 'fakultet_novi'@'localhost';
  7. USE fakultet_novi;
  8.  
  9. DROP TABLE IF EXISTS `mjesto`;
  10. CREATE TABLE IF NOT EXISTS `mjesto` (
  11.   `id` int(11) NOT NULL,
  12.   `pbr` int(11) NOT NULL,
  13.   `nazMjesto` char(40) NOT NULL,
  14.   `sifZupanija` smallint(6) DEFAULT NULL,
  15.   PRIMARY KEY (`id`),
  16.   CONSTRAINT ibfk_mjesto UNIQUE (`pbr`)  
  17. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  18.  
  19.  
  20. DROP TABLE IF EXISTS `stud`;
  21. CREATE TABLE IF NOT EXISTS `stud` (
  22.   `id` int(11) NOT NULL,
  23.   `mbrStud` int(11) NOT NULL,
  24.   `imeStud` char(25) NOT NULL,
  25.   `prezStud` char(25) NOT NULL,
  26.   `pbrRod` int(11) DEFAULT NULL,
  27.   `pbrStan` int(11) NOT NULL,
  28.   `datRodStud` datetime DEFAULT NULL,
  29.   `jmbgStud` char(13) DEFAULT NULL,  
  30.   FOREIGN KEY(`pbrRod`) REFERENCES `mjesto`(`id`),
  31.   FOREIGN KEY(`pbrStan`) REFERENCES `mjesto`(`id`),
  32.   PRIMARY KEY (`id`)
  33. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  34.  
  35. DROP TABLE IF EXISTS `ispit`;
  36. CREATE TABLE IF NOT EXISTS `ispit` (
  37.   `id` int(11) NOT NULL,
  38.   `mbrStud` int(11) NOT NULL,
  39.   `sifPred` int(11) NOT NULL,
  40.   `sifNastavnik` int(11) NOT NULL,
  41.   `datIspit` datetime NOT NULL,
  42.   `ocjena` smallint(6) NOT NULL DEFAULT '1',  
  43.   FOREIGN KEY(`mbrStud`) REFERENCES `stud`(`id`),  
  44.   PRIMARY KEY (`id`)
  45. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top