Projekt bazy w MySQL

This commit is contained in:
s426231 2018-10-20 15:40:11 +02:00
parent 4880277ab3
commit 329f79765e

138
baza/bloggero.sql Normal file
View File

@ -0,0 +1,138 @@
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Czas generowania: 20 Paź 2018, 15:38
-- Wersja serwera: 10.1.31-MariaDB
-- Wersja PHP: 7.2.3
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 */;
--
-- Baza danych: `bloggero`
--
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `blog`
--
CREATE TABLE `blog` (
`blog_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`nazwa_bloga` varchar(250) NOT NULL,
`opis` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `comments`
--
CREATE TABLE `comments` (
`comment_id` int(11) NOT NULL,
`post_id` int(11) NOT NULL,
`tekst` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `post`
--
CREATE TABLE `post` (
`post_id` int(10) NOT NULL,
`blog_id` int(10) NOT NULL,
`tytul` varchar(250) NOT NULL,
`opis` text NOT NULL,
`tekst` int(11) NOT NULL,
`data_dodania` date NOT NULL,
`data_modyfikacji` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `user`
--
CREATE TABLE `user` (
`user_id` int(11) NOT NULL,
`login` int(11) NOT NULL,
`haslo` varchar(20) NOT NULL,
`nazwa` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indeksy dla zrzutów tabel
--
--
-- Indeksy dla tabeli `blog`
--
ALTER TABLE `blog`
ADD PRIMARY KEY (`blog_id`);
--
-- Indeksy dla tabeli `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`comment_id`);
--
-- Indeksy dla tabeli `post`
--
ALTER TABLE `post`
ADD PRIMARY KEY (`post_id`);
--
-- Indeksy dla tabeli `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`user_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT dla tabeli `blog`
--
ALTER TABLE `blog`
MODIFY `blog_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT dla tabeli `comments`
--
ALTER TABLE `comments`
MODIFY `comment_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT dla tabeli `post`
--
ALTER TABLE `post`
MODIFY `post_id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT dla tabeli `user`
--
ALTER TABLE `user`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT;
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 */;