-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Czas generowania: 14 Gru 2021, 10:27
-- Wersja serwera: 10.4.17-MariaDB
-- Wersja PHP: 8.0.2

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

--
-- Baza danych: `workbench`
--

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

--
-- Struktura tabeli dla tabeli `autor`
--

CREATE TABLE `autor` (
  `id` int(11) NOT NULL,
  `imie` char(20) DEFAULT NULL,
  `nazwisko` char(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Zrzut danych tabeli `autor`
--

INSERT INTO `autor` (`id`, `imie`, `nazwisko`) VALUES
(1, 'George', 'Orwell'),
(2, 'Bram', 'Stoker'),
(3, 'Frank', 'Herbert'),
(4, 'Stephen', 'King'),
(5, 'Charles', 'Dickens');

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

--
-- Struktura tabeli dla tabeli `koszyk`
--

CREATE TABLE `koszyk` (
  `zamowienia_id` int(11) DEFAULT NULL,
  `ksiazki_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Zrzut danych tabeli `koszyk`
--

INSERT INTO `koszyk` (`zamowienia_id`, `ksiazki_id`) VALUES
(1, 29),
(1, 29),
(1, 31),
(1, 52),
(2, 61),
(3, 4),
(3, 47),
(3, 60),
(3, 73),
(3, 96),
(3, 99),
(4, 74),
(4, 31),
(5, 17),
(5, 76),
(1, 4),
(1, 47),
(7, 16),
(7, 67),
(7, 93),
(8, 30),
(8, 90),
(9, 49),
(9, 25),
(9, 25),
(11, 87),
(10, 69);

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

--
-- Struktura tabeli dla tabeli `ksiazka`
--

CREATE TABLE `ksiazka` (
  `id` int(11) NOT NULL,
  `tytul` char(20) DEFAULT NULL,
  `rok_wydania` int(4) DEFAULT NULL,
  `autor_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Zrzut danych tabeli `ksiazka`
--

INSERT INTO `ksiazka` (`id`, `tytul`, `rok_wydania`, `autor_id`) VALUES
(1, 'Animal Farm', 1945, 1),
(2, 'Dune', 1965, 3),
(3, 'Dracula', 1897, 2),
(4, 'The Stand', 1990, 4),
(5, '1984', 1949, 1),
(6, 'The Shining', 1977, 4);

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

--
-- Struktura tabeli dla tabeli `ksiazki`
--

CREATE TABLE `ksiazki` (
  `id` int(11) NOT NULL,
  `author` varchar(19) NOT NULL,
  `title` varchar(72) NOT NULL,
  `publication_year` int(11) NOT NULL,
  `ISBN` varchar(10) NOT NULL,
  `rating` varchar(4) NOT NULL,
  `ratings_no` int(11) NOT NULL,
  `reviews_no` int(11) NOT NULL,
  `1_star` int(11) NOT NULL,
  `2_star` int(11) NOT NULL,
  `3_star` int(11) NOT NULL,
  `4_star` int(11) NOT NULL,
  `5_star` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Zrzut danych tabeli `ksiazki`
--

INSERT INTO `ksiazki` (`id`, `author`, `title`, `publication_year`, `ISBN`, `rating`, `ratings_no`, `reviews_no`, `1_star`, `2_star`, `3_star`, `4_star`, `5_star`) VALUES
(1, 'Kathryn Stockett', 'The Help', 2009, '399155341', '4,47', 2040610, 83341, 14091, 31722, 165747, 604217, 1224833),
(2, 'John Green', 'The Fault in Our Stars', 2012, '525478817', '4,22', 3317781, 152710, 73091, 136590, 769162, 951874, 1687064),
(3, 'William Shakespeare', 'An Excellent conceited Tragedie of Romeo and Juliet', 1595, '743477111', '3,74', 1970483, 18454, 69655, 177994, 525794, 609758, 587282),
(4, 'Joanne Rowling', 'Harry Potter and the Half-Blood Prince', 2005, '439785960', '4,57', 2287969, 36347, 9852, 25247, 159495, 554679, 1538696),
(5, 'Jane Austen', 'Pride and Prejudice', 1813, '679783261', '4,26', 2806893, 61688, 71970, 107812, 353090, 768052, 1505969),
(6, 'Lewis Carroll', 'Alice in Wonderland', 1865, '517223627', '4,03', 366869, 5307, 8157, 19353, 74612, 117034, 147713),
(7, 'Lois Lowry', 'The Giver', 1993, '385732554', '4,13', 1674068, 63391, 32553, 72807, 276342, 556544, 735822),
(8, 'Emily Bronte', 'Wuthering Heights', 1847, '393978893', '3,85', 1264907, 34168, 56617, 102322, 265314, 388707, 451947),
(9, 'Gillian Flynn', 'Gone Girl', 2012, '297859382', '4,07', 2181149, 130497, 57133, 101340, 352391, 794463, 875822),
(10, 'Suzanne Collins', 'Catching Fire', 2009, '439023491', '4,29', 2352459, 93590, 14145, 58139, 313051, 810752, 1156372),
(11, 'Ray Bradbury', 'Fahrenheit 451', 1953, '307347974', '3,99', 1565023, 44660, 36888, 84354, 309931, 565154, 568696),
(12, 'Khaled Hosseini', 'The Kite Runner', 2003, '1594480001', '4,29', 2304297, 70333, 38753, 67971, 259321, 747805, 1190447),
(13, 'Stephen King', 'The Stand', 1990, '385199570', '4,34', 580948, 18293, 7454, 16826, 68274, 164275, 324119),
(14, 'Jon Krakauer', 'Into the Wild', 1996, '385486804', '3,98', 836420, 20793, 23152, 42414, 162360, 307915, 300579),
(15, 'Elwyn White', 'Charlotte\'s Web', 1952, '64410935', '4,17', 1341342, 17004, 24662, 49547, 224986, 416285, 625862),
(16, 'John Tolkien', 'The Fellowship of the Ring', 1954, '618346252', '4,36', 2247457, 20753, 45717, 65003, 235889, 591487, 1309361),
(17, 'Jeannette Walls', 'The Glass Castle', 2005, '074324754X', '4,27', 851885, 49812, 10745, 23709, 105616, 295133, 416682),
(18, 'Philip Pullman', 'The Golden Compass', 1995, '679879242', '3,98', 1225785, 20877, 43349, 73584, 234382, 387510, 486960),
(19, 'Louis Sachar', 'Holes', 1998, '439244196', '3,96', 921676, 19554, 18772, 50862, 204416, 320826, 326800),
(20, 'Alice Sebold', 'The Lovely Bones', 2002, '316166685', '3,81', 1936846, 39701, 69274, 145317, 457841, 680597, 583817),
(21, 'John Steinbeck', 'Of Mice and Men', 1937, '142000671', '3,87', 1850459, 32319, 53896, 128264, 419864, 649113, 599322),
(22, 'Markus Zusak', 'The Book Thief', 2005, '375831002', '4,37', 1718502, 108955, 24218, 45801, 175394, 493139, 979950),
(23, 'Nicholas Sparks', 'The Notebook', 1996, '553816713', '4,10', 1264747, 19416, 45747, 70783, 200329, 346869, 602019),
(24, 'Charles Dickens', 'A Tale of Two Cities', 1859, '141439602', '3,84', 780062, 16463, 32056, 61340, 171623, 249569, 265474),
(25, 'George Orwell', 'Animal Farm', 1945, '452284244', '3,93', 2559312, 51324, 80006, 157557, 518938, 897194, 905617),
(26, 'Shel Silverstein', 'Where the Sidewalk Ends', 1974, '60513039', '4,30', 1139622, 10453, 19132, 33734, 149307, 318063, 619386),
(27, 'Mark Haddon', 'The Curious Incident of the Dog in the Night-Time', 2003, '1400032717', '3,88', 1133421, 42737, 25753, 68956, 262014, 437202, 339496),
(28, 'William Golding', 'Lord of the Flies', 1954, '140283331', '3,68', 2155359, 35195, 116084, 197122, 530902, 726508, 584743),
(29, 'Erika Leonard', 'Fifty Shades Darker', 2011, '1612130585', '3,85', 710914, 28856, 44574, 68391, 132874, 170401, 294674),
(30, 'Dmitry Glukhovsky', 'Metro 2033', 2013, '1481845705', '3,99', 37539, 2440, 692, 2240, 7029, 14272, 13306),
(31, 'Erika Leonard', 'Fifty Shades Freed', 2012, '345803507', '3,86', 683390, 26192, 45528, 63796, 125570, 156264, 292232),
(32, 'Veronica Roth', 'Insurgent', 2012, '7442912', '4,04', 1107679, 58133, 14822, 57359, 221099, 393801, 420598),
(33, 'Paulo Coelho', 'O Alquimista', 1988, '61122416', '3,87', 1942685, 74746, 96135, 160781, 385087, 566556, 734126),
(34, 'Jodi Picoult', 'My Sister\'s Keeper', 2004, '743454537', '4,07', 1022824, 32911, 19558, 47555, 183012, 360627, 412072),
(35, 'Cassandra Clare', 'City of Bones', 2007, '1416914285', '4,10', 1537808, 59191, 44160, 82793, 256565, 440526, 713764),
(36, 'Stephenie Meyer', 'Eclipse', 2007, '316160202', '3,69', 1352211, 36400, 95078, 143691, 303362, 352880, 457200),
(37, 'Dan Brown', 'Angels & Demons', 2000, '1416524797', '3,89', 2549101, 28108, 91613, 167318, 538273, 872039, 879858),
(38, 'Roald Dahl', 'Charlie and the Chocolate Factory', 1964, '142403881', '4,13', 620193, 11189, 8907, 21092, 110876, 216761, 262557),
(39, 'Douglas Adams', 'The Hitchhiker\'s Guide to the Galaxy', 1979, '345391802', '4,22', 1344427, 27944, 28528, 53973, 187488, 394658, 679780),
(40, 'Steven Levitt', 'Freakonomics: A Rogue Economist Explores the Hidden Side of Everything', 2005, '61234001', '3,97', 669972, 15770, 17242, 31019, 133940, 259183, 228588),
(41, 'Shel Silverstein', 'The Giving Tree', 1964, '60256656', '4,37', 863180, 16985, 20678, 26234, 90775, 196755, 528738),
(42, 'Mary Shelley', 'Frankenstein', 1818, '141439475', '3,80', 1102313, 30541, 34539, 86045, 275719, 378205, 327805),
(43, 'Stephen King', 'The Shining', 1977, '450040186', '4,22', 1058003, 22438, 21352, 33624, 145281, 345902, 511844),
(44, 'Elizabeth Gilbert', 'Eat, pray, love', 2006, '143038419', '3,55', 1409983, 52907, 109430, 165788, 355522, 391793, 387450),
(45, 'Sara Gruen', 'Water for Elephants', 2006, '1565125606', '4,09', 1323060, 58154, 19494, 57174, 233212, 492867, 520313),
(46, 'Stephenie Meyer', 'Breaking Dawn', 2008, '031606792X', '3,69', 1257319, 45740, 112747, 131384, 247108, 303653, 462427),
(47, 'Joanne Rowling', 'Harry Potter and the Goblet of Fire', 2000, '439139600', '4,56', 2413650, 42484, 9327, 24166, 177662, 603754, 1598741),
(48, 'Francis Fitzgerald', 'The Great Gatsby', 1925, '743273567', '3,92', 3560225, 63760, 106482, 240664, 757025, 1195428, 1260626),
(49, 'George Orwell', '1984', 1949, '451524934', '4,18', 2899352, 64050, 59238, 113544, 424300, 951257, 1351013),
(50, 'Michael Crichton', 'Jurassic Park', 1990, '030734813X', '4,02', 770920, 11483, 16665, 36446, 152008, 272796, 293005),
(51, 'Harper Lee', 'To Kill a Mockingbird', 1960, '61120081', '4,27', 4251252, 86994, 76234, 142880, 546172, 1261267, 2224699),
(52, 'Erika Leonard', 'Fifty Shades of Grey', 2011, '1612130291', '3,66', 1820882, 77850, 213322, 191569, 321278, 371139, 723574),
(53, 'Susan Hinton', 'The Outsiders', 1967, '014038572X', '4,09', 880150, 31596, 13236, 41859, 164547, 290739, 369769),
(54, 'Arthur Golden', 'Memoirs of a Geisha', 1997, '739326228', '4,11', 1653003, 28958, 26097, 64838, 287496, 594946, 679626),
(55, 'Jerome Salinger', 'The Catcher in the Rye', 1951, '316769177', '3,80', 2600257, 54462, 132745, 224130, 551411, 805052, 886919),
(56, 'Paula Hawkins', 'The Girl on the Train', 2015, '1594633665', '3,92', 1939979, 107759, 46300, 114128, 412020, 742005, 625526),
(57, 'Stephen Chbosky', 'The Perks of Being a Wallflower', 1999, '671027344', '4,20', 1185573, 55168, 18473, 48109, 178200, 371069, 569722),
(58, 'Audrey Niffenegger', 'The Time Traveler\'s Wife', 2003, '965818675', '3,97', 1518075, 46480, 49477, 95109, 292608, 494117, 586764),
(59, 'William Goldman', 'The Princess Bride', 1973, '345418263', '4,26', 748834, 19285, 14716, 24574, 99932, 222039, 387573),
(60, 'Joanne Rowling', 'Harry Potter and the Prisoner of Azkaban', 1999, '043965548X', '4,56', 2589065, 50661, 10014, 24721, 193911, 626825, 1733594),
(61, 'Mark Twain', 'The Adventures of Huckleberry Finn', 1884, '142437174', '3,82', 1115115, 14881, 30909, 83208, 280425, 384920, 335653),
(62, 'Veronica Roth', 'Divergent', 2011, '62024035', '4,20', 2760845, 106707, 52126, 114515, 408067, 838414, 1347723),
(63, 'Alex Haley', 'Roots', 1976, '440174643', '4,44', 140440, 3228, 933, 2165, 14025, 40942, 82375),
(64, 'Christopher Paolini', 'Eragon', 2002, '375826696', '3,90', 1371186, 21319, 57413, 102069, 283333, 410912, 517459),
(65, 'Frances Burnett', 'The Secret Garden', 1911, '517189607', '4,13', 841790, 17212, 11018, 30668, 151102, 291201, 357801),
(66, 'Aldous Huxley', 'Brave New World', 1932, '60929871', '3,99', 1358188, 27883, 32487, 73734, 268519, 487803, 495645),
(67, 'John Tolkien', 'The Return of the King', 1955, '261102370', '4,53', 639893, 9107, 3432, 9433, 50282, 159089, 417657),
(68, 'George Martin', 'A Game of Thrones', 1996, '553588486', '4,45', 1903419, 53132, 29501, 38866, 147992, 515087, 1171973),
(69, 'Joanne Rowling', 'Harry Potter and the Deathly Hallows', 2007, '545010225', '4,62', 2648878, 61940, 21722, 32899, 154062, 522915, 1917280),
(70, 'Frank Herbert', 'Dune', 1965, '059309932X', '4,23', 684346, 19111, 15618, 27801, 92232, 199818, 348877),
(71, 'Orson Card', 'Ender\'s Game', 1985, '812550706', '4,30', 1076745, 42358, 18777, 33546, 125777, 323842, 574803),
(72, 'John Tolkien', 'The Hobbit or There and Back Again', 1937, '618260307', '4,27', 2735537, 45595, 56500, 70607, 342380, 811152, 1434898),
(73, 'Joanne Rowling', 'Harry Potter and the Chamber of Secrets', 1998, '439064864', '4,42', 2547100, 48314, 11832, 49212, 287849, 702931, 1495276),
(74, 'Jane Austen', 'Sense and Sensibility', 1811, '141439661', '4,07', 914529, 15193, 21366, 39643, 163323, 318433, 371764),
(75, 'Suzanne Collins', 'The Hunger Games', 2008, '439023483', '4,33', 6071901, 166647, 87585, 163367, 709698, 1830853, 3280398),
(76, 'John Green', 'Looking for Alaska', 2005, '142402516', '4,04', 1052383, 54523, 25384, 62658, 196045, 331869, 436427),
(77, 'Lauren Weisberger', 'The Devil Wears Prada', 2003, '307275558', '3,74', 765920, 8946, 26177, 62254, 208401, 255206, 213882),
(78, 'Kurt Vonnegut', 'Slaughterhouse-Five, or The Children\'s Crusade: A Duty-Dance with Death', 1969, '385333846', '4,08', 1078930, 25505, 28564, 53296, 180183, 363042, 453845),
(79, 'Margaret Mitchell', 'Gone with the Wind', 1936, '446675539', '4,30', 1039175, 19019, 23192, 37588, 129812, 267245, 581338),
(80, 'James Dashner', 'The Maze Runner', 2009, '385737947', '4,02', 976024, 54683, 19748, 54400, 188138, 333399, 380339),
(81, 'Nora Roberts', 'Northern Lights', 1999, '515139742', '4,00', 38593, 1212, 367, 1679, 8900, 14217, 13430),
(82, 'Stephenie Meyer', 'Twilight', 2005, '316015849', '3,59', 4714195, 100498, 529431, 518745, 957692, 1054704, 1653623),
(83, 'Dan Brown', 'The Da Vinci Code', 2003, '307277674', '3,84', 1836400, 45744, 76663, 137764, 384344, 635774, 601855),
(84, 'John Green', 'Paper Towns', 2008, '014241493X', '3,82', 851270, 47519, 22594, 69325, 211542, 283138, 264671),
(85, 'Stephenie Meyer', 'New Moon', 2006, '316160199', '3,53', 1385502, 45769, 116906, 184302, 341177, 333632, 409485),
(86, 'Charlotte Bronte', 'Jane Eyre', 1847, '142437204', '4,12', 1542288, 39293, 41301, 73921, 246212, 476730, 704124),
(87, 'Louisa Alcott', 'Little Women', 1868, '451529308', '4,07', 1588618, 27046, 36512, 79227, 287589, 512128, 673162),
(88, 'Oscar Wilde', 'The Picture of Dorian Gray', 1891, '375751513', '4,08', 896785, 27604, 13413, 39363, 165214, 325712, 353083),
(89, 'Sue Kidd', 'The Secret Life of Bees', 2001, '142001740', '4,05', 1080809, 29575, 18774, 48940, 204651, 398344, 410100),
(90, 'Suzanne Collins', 'Mockingjay', 2010, '439023513', '4,04', 2210713, 100838, 36010, 128149, 436450, 728949, 881155),
(91, 'Bram Stoker', 'Dracula', 1897, '393970124', '3,99', 881765, 23737, 16426, 45788, 187203, 309895, 322453),
(92, 'Khaled Hosseini', 'A Thousand Splendid Suns', 2007, '1594489505', '4,37', 1083177, 51516, 7978, 20911, 115002, 357887, 581399),
(93, 'John Tolkien', 'The Two Towers', 1954, '618346260', '4,44', 672498, 9565, 3982, 12192, 65473, 191281, 399570),
(94, 'Yann Martel', 'Life of Pi', 2001, '770430074', '3,91', 1274918, 46338, 44761, 84450, 253560, 453328, 438819),
(95, 'Clive Lewis', 'The Lion, the Witch and the Wardrobe', 1950, '60764899', '4,21', 2022894, 20246, 25914, 68179, 319300, 641395, 968106),
(96, 'Joanne Rowling', 'Harry Potter and the Sorcerer\'s Stone', 1997, '439554934', '4,47', 6554842, 103318, 107541, 129841, 565727, 1507374, 4244359),
(97, 'John Grisham', 'A Time to Kill', 1989, '385338600', '4,07', 682305, 5038, 12664, 27124, 130479, 243538, 268500),
(98, 'Stephenie Meyer', 'The Host', 2008, '316068047', '3,84', 862713, 41009, 48334, 69480, 173084, 252184, 319631),
(99, 'Joanne Rowling', 'Harry Potter and the Order of the Phoenix', 2003, '439358078', '4,50', 2347062, 38773, 12391, 36906, 211027, 601936, 1484802),
(100, 'Rick Riordan', 'The Lightning Thief', 2005, '786838655', '4,25', 1856227, 56478, 25994, 60676, 274534, 565437, 930586);

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

--
-- Struktura tabeli dla tabeli `uzytkownicy`
--

CREATE TABLE `uzytkownicy` (
  `id` int(11) NOT NULL,
  `imie` varchar(10) DEFAULT NULL,
  `nazwisko` varchar(13) DEFAULT NULL,
  `email` varchar(34) DEFAULT NULL,
  `ulica` varchar(24) DEFAULT NULL,
  `miasto` varchar(16) DEFAULT NULL,
  `kod-pocztowy` varchar(6) DEFAULT NULL,
  `telefon` int(9) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Zrzut danych tabeli `uzytkownicy`
--

INSERT INTO `uzytkownicy` (`id`, `imie`, `nazwisko`, `email`, `ulica`, `miasto`, `kod-pocztowy`, `telefon`) VALUES
(1, 'Jadzia', 'Grabowska', 'JadziaGrabowska@jourrapide.com', 'Objazdowa 40', 'Łódź', '94-025', 605102834),
(2, 'Amadei', 'Kozłowski', 'AmadeiKozlowski@armyspy.com', 'Lisa Kuli Leopolda 114', 'Warszawa', '01-512', 679069619),
(3, 'Gabryś', 'Wysocki', 'GabrysWysocki@jourrapide.com', 'Szkutnicza 3', 'Koszalin', '75-250', 605376929),
(4, 'Tekla', 'Pawlak', 'TeklaPawlak@teleworm.us', 'Mysłowicka 96', 'Łódź', '93-240', 676806993),
(5, 'Kinga', 'Grabowska', 'KingaGrabowska@armyspy.com', 'Dajwór 33', 'Kraków', '31-052', 783999913),
(6, 'Kornelia', 'Kalinowska', 'KorneliaKalinowska@dayrep.com', 'Zakręt 141', 'Kielce', '25-039', 607894338),
(7, 'Lucyna', 'Król', 'LucynaKrol@teleworm.us', 'Żbicza 116', 'Olsztyn', '11-041', 881965851),
(8, 'Marek', 'Wiśniewski', 'MarekWisniewski@armyspy.com', 'Kosmonautów 118/15', 'Łódź', '93-540', 603957799),
(9, 'Weronika', 'Kalinowska', 'WeronikaKalinowska@rhyta.com', 'Wołowa 57', 'Łódź', '93-569', 784371220),
(10, 'Danuta', 'Dudek', 'DanutaDudek@jourrapide.com', 'Dojlidy Górne 134', 'Białystok', '15-581', 518994029),
(11, 'Mikolaj', 'Dąbrowski', 'MikolajDabrowski@armyspy.com', 'Dobra 19/5', 'Racibórz', '47-404', 609974161),
(12, 'Jarosława', 'Wojciechowska', 'JaroslawaWojciechowska@teleworm.us', 'Lutniowa 146', 'Warszawa', '02-388', 726741117),
(13, 'Lidia', 'Czarnecka', 'LidiaCzarnecka@armyspy.com', 'Bociania 148', 'Białystok', '15-533', 602324893),
(14, 'Tymoteusz', 'Kowalczyk', 'TymoteuszKowalczyk@rhyta.com', 'Starokościelna 60', 'Mikołów', '43-190', 677903818),
(15, 'Dariusz', 'Majewski', 'DariuszMajewski@dayrep.com', 'Waryńskiego Ludwika 19', 'Warszawa', '00-636', 789678248),
(16, 'Krzyś', 'Walczak', 'KrzysWalczak@dayrep.com', 'Kruczkowskiego Leona 119', 'Dąbrowa Górnicza', '41-300', 721238875),
(17, 'Kazia', 'Chmielewska', 'KaziaChmielewska@jourrapide.com', 'Paderewskiego 147/62', 'Pruszcz Gdański', '83-004', 537613324),
(18, 'Radzimierz', 'Kalinowski', 'RadzimierzKalinowski@teleworm.us', 'Zorzy 69', 'Warszawa', '04-639', 601731511),
(19, 'Sławomira', 'Kowalska', 'SlawomiraKowalska@teleworm.us', 'Ejsmonda Juliana 101', 'Łódź', '93-249', 519320824),
(20, 'Emeryk', 'Wiśniewski', 'EmerykWisniewski@rhyta.com', 'Jagiellońska 69', 'Kielce', '25-613', 729596098);

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

--
-- Struktura tabeli dla tabeli `zamowienia`
--

CREATE TABLE `zamowienia` (
  `id` int(11) NOT NULL,
  `uzytkownicy_id` int(11) DEFAULT NULL,
  `data_zamowienia` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Zrzut danych tabeli `zamowienia`
--

INSERT INTO `zamowienia` (`id`, `uzytkownicy_id`, `data_zamowienia`) VALUES
(1, 1, '2021-08-22 21:59:20'),
(2, 2, '2021-08-22 22:00:36'),
(3, 5, '2021-08-22 22:00:40'),
(4, 7, '2021-08-22 22:00:41'),
(5, 1, '2021-08-22 22:00:41'),
(6, 3, '2021-08-22 22:00:42'),
(7, 10, '2021-08-22 22:00:42'),
(8, 6, '2021-08-22 22:00:43'),
(9, 20, '2021-08-22 22:00:43'),
(10, 5, '2021-08-22 22:00:43'),
(11, 1, '2021-08-22 22:00:44');

--
-- Indeksy dla zrzutów tabel
--

--
-- Indeksy dla tabeli `autor`
--
ALTER TABLE `autor`
  ADD PRIMARY KEY (`id`);

--
-- Indeksy dla tabeli `koszyk`
--
ALTER TABLE `koszyk`
  ADD KEY `zamowienia_id` (`zamowienia_id`),
  ADD KEY `ksiazki_id` (`ksiazki_id`);

--
-- Indeksy dla tabeli `ksiazka`
--
ALTER TABLE `ksiazka`
  ADD PRIMARY KEY (`id`),
  ADD KEY `autor_id` (`autor_id`);

--
-- Indeksy dla tabeli `ksiazki`
--
ALTER TABLE `ksiazki`
  ADD PRIMARY KEY (`id`);

--
-- Indeksy dla tabeli `uzytkownicy`
--
ALTER TABLE `uzytkownicy`
  ADD PRIMARY KEY (`id`);

--
-- Indeksy dla tabeli `zamowienia`
--
ALTER TABLE `zamowienia`
  ADD PRIMARY KEY (`id`),
  ADD KEY `uzytkownicy_id` (`uzytkownicy_id`);

--
-- AUTO_INCREMENT dla zrzuconych tabel
--

--
-- AUTO_INCREMENT dla tabeli `autor`
--
ALTER TABLE `autor`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT dla tabeli `ksiazka`
--
ALTER TABLE `ksiazka`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT dla tabeli `ksiazki`
--
ALTER TABLE `ksiazki`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=101;

--
-- AUTO_INCREMENT dla tabeli `uzytkownicy`
--
ALTER TABLE `uzytkownicy`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT dla tabeli `zamowienia`
--
ALTER TABLE `zamowienia`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- Ograniczenia dla zrzutów tabel
--

--
-- Ograniczenia dla tabeli `koszyk`
--
ALTER TABLE `koszyk`
  ADD CONSTRAINT `koszyk_ibfk_1` FOREIGN KEY (`zamowienia_id`) REFERENCES `zamowienia` (`id`),
  ADD CONSTRAINT `koszyk_ibfk_2` FOREIGN KEY (`ksiazki_id`) REFERENCES `ksiazki` (`id`);

--
-- Ograniczenia dla tabeli `ksiazka`
--
ALTER TABLE `ksiazka`
  ADD CONSTRAINT `ksiazka_ibfk_1` FOREIGN KEY (`autor_id`) REFERENCES `autor` (`id`);

--
-- Ograniczenia dla tabeli `zamowienia`
--
ALTER TABLE `zamowienia`
  ADD CONSTRAINT `zamowienia_ibfk_1` FOREIGN KEY (`uzytkownicy_id`) REFERENCES `uzytkownicy` (`id`);
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 */;
