-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 31, 2020 at 05:40 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7

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: `TAXI`
--

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

--
-- Table structure for table `FUVAR`
--

CREATE TABLE `FUVAR` (
  `rendszam` varchar(6) COLLATE utf8_hungarian_ci NOT NULL,
  `indulasiido` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `indulasicim` varchar(60) COLLATE utf8_hungarian_ci DEFAULT NULL,
  `megtettkm` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;

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

--
-- Table structure for table `GEPKOCSI`
--

CREATE TABLE `GEPKOCSI` (
  `rendszam` varchar(6) COLLATE utf8_hungarian_ci NOT NULL,
  `tipus` varchar(60) COLLATE utf8_hungarian_ci NOT NULL,
  `forgalmilejar` date NOT NULL,
  `telefonszam` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;

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

--
-- Table structure for table `SOFOR`
--

CREATE TABLE `SOFOR` (
  `telefonszam` int(10) NOT NULL,
  `nev` varchar(30) COLLATE utf8_hungarian_ci NOT NULL,
  `lakcim` varchar(60) COLLATE utf8_hungarian_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `FUVAR`
--
ALTER TABLE `FUVAR`
  ADD PRIMARY KEY (`rendszam`,`indulasiido`);

--
-- Indexes for table `GEPKOCSI`
--
ALTER TABLE `GEPKOCSI`
  ADD PRIMARY KEY (`rendszam`),
  ADD KEY `telefonszam` (`telefonszam`);

--
-- Indexes for table `SOFOR`
--
ALTER TABLE `SOFOR`
  ADD PRIMARY KEY (`telefonszam`);

--
-- Constraints for dumped tables
--

--
-- Constraints for table `FUVAR`
--
ALTER TABLE `FUVAR`
  ADD CONSTRAINT `FUVAR_ibfk_1` FOREIGN KEY (`rendszam`) REFERENCES `GEPKOCSI` (`rendszam`);

--
-- Constraints for table `GEPKOCSI`
--
ALTER TABLE `GEPKOCSI`
  ADD CONSTRAINT `GEPKOCSI_ibfk_1` FOREIGN KEY (`telefonszam`) REFERENCES `SOFOR` (`telefonszam`);
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 */;
