-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 29, 2026 at 12:08 AM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

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

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

--
-- Table structure for table `customertable`
--

CREATE TABLE `customertable` (
  `TableNumber` int(11) NOT NULL,
  `CustomerName` varchar(500) DEFAULT NULL,
  `GuestCount` int(11) NOT NULL,
  `Phone` varchar(15) NOT NULL,
  `WaiterName` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `customertable`
--

INSERT INTO `customertable` (`TableNumber`, `CustomerName`, `GuestCount`, `Phone`, `WaiterName`) VALUES
(1, 'Table1', 100, '0785645231', 'UBARUTA Agnes'),
(2, 'UWINEZA Adelphine', 200, '0787654321', 'Tumukunde'),
(3, 'CYUSA Kevin', 3, '0789876534 | Or', 'UBARUTA Agnes'),
(4, 'MUHIRWA ', 2, '6763546467 | Or', 'muhire'),
(5, 'tt *Orders: [Steak & Fries (10000 Rwf)]*', 6, '46564', 'gfhfg');

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

--
-- Table structure for table `menuservices`
--

CREATE TABLE `menuservices` (
  `MenuID` int(11) NOT NULL,
  `ItemName` varchar(100) NOT NULL,
  `ItemPrice` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `menuservices`
--

INSERT INTO `menuservices` (`MenuID`, `ItemName`, `ItemPrice`) VALUES
(1, 'Buffet', 15000.00),
(2, 'Grilled Tilapia', 12000.00),
(3, 'Coffee Specialty', 3500.00),
(4, 'Fresh Juice', 2500.00),
(5, 'Steak & Fries', 10000.00),
(6, 'Akabenzi', 20000.00),
(7, 'umuceri', 200000.00);

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

--
-- Table structure for table `payment`
--

CREATE TABLE `payment` (
  `PaymentID` int(11) NOT NULL,
  `TableNumber` int(11) DEFAULT NULL,
  `AmountPaid` decimal(10,2) NOT NULL,
  `PaymentDate` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payment`
--

INSERT INTO `payment` (`PaymentID`, `TableNumber`, `AmountPaid`, `PaymentDate`) VALUES
(1, 1, 300000.00, '2026-05-28'),
(2, 5, 10000.00, '2026-05-28');

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

--
-- Table structure for table `reservationrecord`
--

CREATE TABLE `reservationrecord` (
  `ReservationID` int(11) NOT NULL,
  `TableNumber` int(11) DEFAULT NULL,
  `VisitDate` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `reservationrecord`
--

INSERT INTO `reservationrecord` (`ReservationID`, `TableNumber`, `VisitDate`) VALUES
(1, 1, '2020-01-23'),
(2, 3, '2026-05-21');

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `username`, `password`) VALUES
(1, 'admin', '$2b$10$EPf9Xp02OFA10nLAmP6vO.kI8oJ.Qk.rG.M03m96Z43AEx87z2MVO'),
(2, 'Agnes', '$2b$10$z923cr/co2X92EgDbD/RaeKtcY6FGenaVU7utlrjm2bImiVNKbQLi');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `customertable`
--
ALTER TABLE `customertable`
  ADD PRIMARY KEY (`TableNumber`);

--
-- Indexes for table `menuservices`
--
ALTER TABLE `menuservices`
  ADD PRIMARY KEY (`MenuID`);

--
-- Indexes for table `payment`
--
ALTER TABLE `payment`
  ADD PRIMARY KEY (`PaymentID`),
  ADD KEY `TableNumber` (`TableNumber`);

--
-- Indexes for table `reservationrecord`
--
ALTER TABLE `reservationrecord`
  ADD PRIMARY KEY (`ReservationID`),
  ADD KEY `TableNumber` (`TableNumber`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `menuservices`
--
ALTER TABLE `menuservices`
  MODIFY `MenuID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `payment`
--
ALTER TABLE `payment`
  MODIFY `PaymentID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `reservationrecord`
--
ALTER TABLE `reservationrecord`
  MODIFY `ReservationID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `payment`
--
ALTER TABLE `payment`
  ADD CONSTRAINT `payment_ibfk_1` FOREIGN KEY (`TableNumber`) REFERENCES `customertable` (`TableNumber`) ON DELETE CASCADE;

--
-- Constraints for table `reservationrecord`
--
ALTER TABLE `reservationrecord`
  ADD CONSTRAINT `reservationrecord_ibfk_1` FOREIGN KEY (`TableNumber`) REFERENCES `customertable` (`TableNumber`) ON DELETE CASCADE;
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 */;
