-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 23, 2024 at 08:56 AM
-- Server version: 10.6.17-MariaDB
-- PHP Version: 8.1.27

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

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

--
-- Table structure for table `account_owner`
--

CREATE TABLE `account_owner` (
  `owner_id` varchar(15) NOT NULL,
  `own_regno` char(14) NOT NULL,
  `no_md5` varchar(85) NOT NULL,
  `fname` varchar(15) NOT NULL,
  `mname` varchar(15) NOT NULL,
  `lname` varchar(15) NOT NULL,
  `gender` varchar(7) NOT NULL,
  `occupation` varchar(75) NOT NULL,
  `phoneno` varchar(15) NOT NULL,
  `postAddress` varchar(25) NOT NULL,
  `password` varchar(75) NOT NULL,
  `district` varchar(75) NOT NULL,
  `ward` varchar(75) NOT NULL,
  `street` varchar(75) NOT NULL,
  `email` varchar(30) NOT NULL,
  `city` varchar(75) NOT NULL,
  `country` varchar(75) NOT NULL,
  `dob` date NOT NULL,
  `regdate` date NOT NULL,
  `accStatus` varchar(15) NOT NULL DEFAULT 'In active',
  `lastLogin` date NOT NULL,
  `lastlogTime` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `account_owner`
--

INSERT INTO `account_owner` (`owner_id`, `own_regno`, `no_md5`, `fname`, `mname`, `lname`, `gender`, `occupation`, `phoneno`, `postAddress`, `password`, `district`, `ward`, `street`, `email`, `city`, `country`, `dob`, `regdate`, `accStatus`, `lastLogin`, `lastlogTime`) VALUES
('0758912113', '01905051237', '4a42ee68b51c11824fd3e2e199edf076', 'Hassan', 'Jeremiah', 'Aikoh', 'Male', 'Computer Scientist', '0758912113', '2422 Mwanza', '845838210a77ea38b9a662d6f28fd7f3', 'Ilemela', 'Buzuruga', 'Ustawi', 'hjeremiah24@gmail.com', 'Mwanza ', 'Tanzania', '1989-12-12', '2019-05-05', 'Active', '2023-07-04', '12:36:52am'),
('255788489885', '01905131058', 'eebba648de8aeef1c310309c1b2dca45', 'Maporo', 'Issa', 'Abubakari', 'Male', 'Manager', '255788489885', '11401 mwanza', '5f78e3b5614fbde43ba7881c1245f7bf', 'Nyamagana', 'Pamba', 'Rumumba', 'ndenza89@gmail.com', 'Mwanza', 'Tanzania', '1994-01-24', '2019-05-13', 'In active', '2019-05-13', '01:22:13pm'),
('255764350175', '01906131022', 'dc52ebcfad7962d7d14c221adb3597b6', 'Rena', 'Pharmacy', 'Pharmacy', 'Male', 'Pharmaceutical', '255764350175', '', 'd27eaaa95a81ada2583303d62506a82f', 'Ilemela', 'Igoma', 'Igoma', 'renapharmacy@gmail.com', 'Mwanza', 'Tanzania', '2019-06-13', '2019-06-13', 'Active', '2019-06-13', '10:25:50am'),
('0767463787', '01906220456', '640a6c46bc5b11d51792aced906d2d7b', 'Abulfayaadh', 'Jumanne', 'Omary', 'Male', 'Pharmacist', '0767463787', '', '57cee0d563c43fcc3def6ac4373ac928', 'Nyamagana', 'Mkuyuni', 'Shede', 'abulfayaadhjumanne@gmail.com', 'Mwanza', 'Tanzania', '2019-06-10', '2019-06-22', 'In active', '2019-08-09', '12:02:33am'),
('0757762932', '01907310143', '019fa56a878a1af8152f14825a10e9d7', 'Makoye', 'Kacheyekele', 'Sahani', 'Male', 'Pharmacist', '0757762932', '', '05485fe58b67b5310bc94613475b0c9f', 'Magu', 'Isadura', 'Magu', 'makoyesahani19@gmail.com', 'Mwanza', 'Tanzania', '1992-02-27', '2019-07-31', 'In active', '2019-07-31', '01:43:16pm'),
('0689749960', '01907311251', '929ece8df62d0c6fdb91bd4063df920a', 'Malaki', 'Nguka', 'Yeremia', 'Male', 'Enterprenuer', '0689749960', '92 Masonga', '30c0ede49a7c0c519bc5b3ddc0f35f02', 'Rorya', 'Tai', 'Masonga', 'hjeremiah24@gmail.com', 'Mara', 'Tanzania', '1997-10-20', '2019-07-31', 'In active', '2019-09-01', '07:11:37am'),
('0742704802', '01908011033', 'a03704ee7c5f0c4b215efa6785d3407e', 'Gemsa', 'Zacharia', 'Kisiroti', 'Male', 'Student', '0742704802', '', 'cbd1a4e960e48ca4e194d99a99fd1b12', 'Serengeti', 'Kyambahi', 'Bokore', 'gemsaxacharia@gmail.com', 'Mara', 'Tanzania', '1994-06-04', '2019-08-01', 'In active', '2019-08-09', '08:30:24am'),
('255767322972', '01908011201', 'd027480b33b0acf630803ca5cde0249a', 'Jonathan', 'Jagi', 'Mbanduji', 'Male', 'Pharmacist', '255767322972', 'P. o. Box 10357 Mwanza', 'b5dd221758a7eefa74f3d33c1d7102f9', 'Sengerema', 'Ibisabageni', 'Geita road', 'jgmpanduji@gmail.com', 'Mwanza', 'Tanzanian', '1961-03-25', '2019-08-01', 'In active', '2019-08-02', '05:29:43pm'),
('2552590110', '01908020626', '22dd9b35d3f5f80cfd21e95ff8104a96', 'Mabimbi', 'Zenze', 'Joseph', 'Male', 'Farmer', '2552590110', '', '5a1fdb017187d791e7a6a63f6c6125d4', 'Sengerema', 'Ibisabageni', 'Nyamasugo road', 'zenze@gmail.com', 'Mwanza', 'Tanzanian', '1938-07-07', '2019-08-02', 'In active', '2019-08-02', '06:26:36am'),
('255686511467', '01909020608', '427eb4e051adeb572d895bbc5ace45f3', 'James', 'Mwita', 'Mahamba', 'Male', 'Business', '255686511467', 'Dar es salaam', '53c28a348d681f75cb33cc4ccc89333a', 'Ilala', 'Gongolamboto', 'Bumila', 'jamesmahamba@gmail.com', 'Dar es Salaam', 'Tanzania', '1988-08-08', '2019-09-02', 'In active', '2019-09-02', '06:17:29pm'),
('6464007658', '02003040812', '6e2d7a78c938b4752654741d5c9d15e5', 'Miguel', 'juma', 'Martin', 'Male', 'SCIENTIST', '6464007658', '19067', '5f52449d1b531dc0bf0f93f8efb2a316', 'Dodoma', 'Area a', 'mlachani', 'redhatsec360@gmail.com', 'Dodoma', 'Tanzania', '1991-03-03', '2020-03-04', 'In active', '2020-03-04', '08:13:48am'),
('0756642408', '02004071240', '05667edd292ba08e9a20bd0ccc618b4b', 'ADRIANO', 'Ezekiel', 'NDALE', 'Male', 'Business', '0756642408', '', '1e0ad884886d39db24f20187fea431cc', 'dsm', 'kariakoo', 'swahili nyamwezi', 'adrianondale7@gmail.com', 'dsm', 'tanzania', '1970-12-25', '2020-04-07', 'In active', '2020-04-07', '01:11:07pm'),
('0765656578', '02203160235', '2631d22e3ad5f05a7de5d29e430069c3', 'SABINA', 'JOSEPH', 'NYAMANGE', 'Female', 'ENTERPRENEURS', '0765656578', '', '202cb962ac59075b964b07152d234b70', 'ILEMELA', 'BUSWELU', 'BUSWELU', 'sabina22@gmail.com', 'MWANZA', 'TANZANIA', '2010-01-16', '2022-03-16', 'In active', '2023-01-06', '03:56:41am');

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

--
-- Table structure for table `advertisement`
--

CREATE TABLE `advertisement` (
  `advert_id` int(11) NOT NULL,
  `hotel_id` char(14) NOT NULL,
  `title` varchar(185) NOT NULL,
  `content` text NOT NULL,
  `timePosted` timestamp NOT NULL DEFAULT current_timestamp(),
  `directory` varchar(120) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `advertisement`
--

INSERT INTO `advertisement` (`advert_id`, `hotel_id`, `title`, `content`, `timePosted`, `directory`) VALUES
(22, '20190801121636', 'DRINK', 'We offer various drinks from soft o hard once including  soda, juice,  water, Kant etc', '2019-08-01 19:15:41', NULL);

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

--
-- Table structure for table `customer`
--

CREATE TABLE `customer` (
  `receipNo` varchar(14) NOT NULL,
  `cust_id` char(14) NOT NULL,
  `hotel_id` char(14) NOT NULL,
  `roomID` varchar(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `expenses`
--

CREATE TABLE `expenses` (
  `expenses_id` char(14) NOT NULL,
  `hotel_id` varchar(14) NOT NULL,
  `amount` double NOT NULL,
  `exp_date` date NOT NULL,
  `exp_purpose` varchar(35) NOT NULL,
  `clerk_sign` varchar(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `hotel`
--

CREATE TABLE `hotel` (
  `hotel_id` char(14) NOT NULL,
  `owner_id` char(14) NOT NULL,
  `hname` varchar(135) NOT NULL,
  `category` varchar(85) NOT NULL,
  `description` text DEFAULT NULL,
  `country` varchar(120) NOT NULL,
  `city` varchar(120) NOT NULL,
  `ltown_city` varchar(155) NOT NULL,
  `lstreet_vil` varchar(155) NOT NULL,
  `phoneno` varchar(13) NOT NULL,
  `paddress` varchar(85) NOT NULL,
  `email` varchar(155) NOT NULL,
  `reg_date` datetime NOT NULL DEFAULT current_timestamp(),
  `popularDistination` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `hotel`
--

INSERT INTO `hotel` (`hotel_id`, `owner_id`, `hname`, `category`, `description`, `country`, `city`, `ltown_city`, `lstreet_vil`, `phoneno`, `paddress`, `email`, `reg_date`, `popularDistination`) VALUES
('20190513110450', '01905131058', 'CF MY HOTEL', 'Hotel', NULL, 'Tanzania', 'Mwanza', 'Nyamagana', 'Rumumba', '255763263347', '11401 mwanza', 'info@cfmyhotel.com', '2019-05-13 14:04:50', 'Rumumba'),
('20190801121636', '01908011201', 'JANESCOM LODGE', 'Lodge', NULL, 'Tanzania', 'Mwanza', 'Sengerema', 'Geita road', '255767322972', 'P.o.box 10357 Mwanza', 'jgmpanduji@gmail.com', '2019-08-01 15:16:36', 'Near Sengerema stand very close  main to Geita'),
('20190802063607', '01908020626', 'MID TOWN GUEST', 'Guest', NULL, 'Tanzania', 'Mwanza', 'Sengerema', 'NYAKATI road', '255758912113', '', 'nzenze@gmail.com', '2019-08-02 09:36:07', 'Located along the road to Nyamasugo');

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

--
-- Table structure for table `hotelasssevices`
--

CREATE TABLE `hotelasssevices` (
  `serviceId` varchar(6) NOT NULL,
  `hotelid` varchar(14) NOT NULL,
  `service` varchar(200) NOT NULL,
  `charge` varchar(185) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `hotelasssevices`
--

INSERT INTO `hotelasssevices` (`serviceId`, `hotelid`, `service`, `charge`) VALUES
('Drinks', '20190801121636', 'Soft drinks like soda, juice, water etc', 'Numeric depend on type of drink');

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

--
-- Table structure for table `hotelincome`
--

CREATE TABLE `hotelincome` (
  `incomeId` varchar(14) NOT NULL,
  `hotelid` varchar(14) NOT NULL,
  `incomeSource` varchar(65) NOT NULL,
  `incomeAmount` double NOT NULL,
  `dateearned` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `hotelworkers`
--

CREATE TABLE `hotelworkers` (
  `hotelid` varchar(14) NOT NULL,
  `accountId` varchar(14) NOT NULL,
  `jobtitle` varchar(155) NOT NULL,
  `salary` decimal(10,0) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `images`
--

CREATE TABLE `images` (
  `hotelid` char(14) NOT NULL,
  `imgname` varchar(150) NOT NULL,
  `directory` varchar(150) NOT NULL,
  `profileImage` varchar(150) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `images`
--

INSERT INTO `images` (`hotelid`, `imgname`, `directory`, `profileImage`) VALUES
('20190801121636', 'Janescom front view', 'hotel_images/JANESCOM LODGE1.PNG', 'current'),
('20190801121636', 'Janescom out side view', 'hotel_images/JANESCOM LODGE0.PNG', NULL),
('20190801121636', 'Janescom profile', 'hotel_images/JANESCOM LODGE2.PNG', 'NULL'),
('20190802063607', 'Mid guest house front view', 'hotel_images/MID NIGHT GUEST.PNG', 'current');

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

--
-- Table structure for table `paymentcode`
--

CREATE TABLE `paymentcode` (
  `code` varchar(14) NOT NULL,
  `phoneno` varchar(14) NOT NULL,
  `teleCompany` varchar(36) NOT NULL,
  `timePaid` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `profilepicture`
--

CREATE TABLE `profilepicture` (
  `ownerid` varchar(14) NOT NULL,
  `directory` varchar(60) NOT NULL,
  `lastUpdate` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `profilepicture`
--

INSERT INTO `profilepicture` (`ownerid`, `directory`, `lastUpdate`) VALUES
('02003040812', 'accountProfileImages/shell.jpg', '2020-03-04 08:15:29');

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

--
-- Table structure for table `recept`
--

CREATE TABLE `recept` (
  `recept_no` char(14) NOT NULL,
  `hotel_id` char(14) NOT NULL,
  `room_id` varchar(6) DEFAULT NULL,
  `cust_id` char(14) NOT NULL,
  `pay_type` varchar(10) DEFAULT NULL,
  `arrived_on` date DEFAULT NULL,
  `check_in_time` timestamp NOT NULL DEFAULT current_timestamp(),
  `arivedf` varchar(20) DEFAULT NULL,
  `departure_on` date NOT NULL,
  `departure_to` varchar(20) NOT NULL,
  `nofguest` int(11) NOT NULL,
  `occupation_type` varchar(15) DEFAULT NULL,
  `cash_amount` double NOT NULL,
  `car_reg` char(15) DEFAULT NULL,
  `p_status` varchar(10) DEFAULT NULL,
  `clerksign` varchar(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `room`
--

CREATE TABLE `room` (
  `room_no` varchar(6) NOT NULL,
  `hotel_id` char(14) NOT NULL,
  `rname` varchar(150) DEFAULT NULL,
  `rcost` double NOT NULL,
  `rtype` varchar(150) NOT NULL,
  `rstatus` varchar(15) NOT NULL DEFAULT 'Free'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `room`
--

INSERT INTO `room` (`room_no`, `hotel_id`, `rname`, `rcost`, `rtype`, `rstatus`) VALUES
('01', '20190801121636', 'Janescom room one', 10000, 'Single with TV', 'Free'),
('01', '20190802063607', 'Mid Town room one', 7000, 'Single ', 'Free'),
('02', '20190801121636', 'Janescom room two', 10000, 'Single self with TV', 'Free'),
('02', '20190802063607', 'Mid Town room two', 7000, 'Single ', 'Free'),
('03', '20190801121636', 'Janescom room three', 10000, 'Single self with TV', 'Free'),
('03', '20190802063607', 'Mid Town room three', 7000, 'Single ', 'Free'),
('04', '20190801121636', 'Janescom room four', 10000, 'Single self with TV', 'Free'),
('04', '20190802063607', 'Mid Town room four', 7000, 'Single ', 'Free'),
('05', '20190801121636', 'Janescom room five', 10000, 'Single self with TV', 'Free'),
('05', '20190802063607', 'Mid Town room five', 7000, 'Single ', 'Free'),
('06', '20190801121636', 'Janescom room six', 10000, 'Single self with TV', 'Free'),
('06', '20190802063607', 'Mid Town room six', 7000, 'Single ', 'Free'),
('07', '20190801121636', 'Janescom room seven', 10000, 'Single self with TV', 'Free'),
('07', '20190802063607', 'Mid Town room seven', 7000, 'Single ', 'Free'),
('08', '20190801121636', 'Janescom room eight', 10000, 'Single self with TV', 'Free'),
('08', '20190802063607', 'Mid Town room eight', 7000, 'Single ', 'Free'),
('09', '20190801121636', 'Janescom room nine upper floor', 10000, 'Single self with TV', 'Free'),
('09', '20190802063607', 'Mid Town room nine', 7000, 'Single ', 'Free'),
('10', '20190801121636', 'Janescom room ten upper floor ', 10000, 'Single self with TV', 'Free'),
('10', '20190802063607', 'Mid Town room ten', 7000, 'Single ', 'Free');

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

--
-- Table structure for table `roomimages`
--

CREATE TABLE `roomimages` (
  `hotelid` varchar(14) NOT NULL,
  `room_no` varchar(6) NOT NULL,
  `imgname` varchar(80) NOT NULL,
  `directory` varchar(80) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `roomimages`
--

INSERT INTO `roomimages` (`hotelid`, `room_no`, `imgname`, `directory`) VALUES
('20190801121636', '01', 'Janescom room bed ', 'hotel_images/JANESCOM ROOM1.PNG'),
('20190801121636', '02', 'Room two bed', 'hotel_images/JANESCOM ROOM2.PNG'),
('20190801121636', '03', 'Rooms Latrine ', 'hotel_images/JANESCOM ROOM3.PNG'),
('20190801121636', '04', 'Room TV', 'hotel_images/JANESCOM ROOM4.PNG'),
('20190801121636', '01', 'Janescom room bed ', 'hotel_images/JANESCOM ROOM1.PNG'),
('20190801121636', '02', 'Room two bed', 'hotel_images/JANESCOM ROOM2.PNG'),
('20190801121636', '03', 'Rooms Latrine ', 'hotel_images/JANESCOM ROOM3.PNG'),
('20190801121636', '04', 'Room TV', 'hotel_images/JANESCOM ROOM4.PNG');

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

--
-- Table structure for table `routetohotel`
--

CREATE TABLE `routetohotel` (
  `routeId` varchar(8) NOT NULL,
  `hotelid` varchar(14) NOT NULL,
  `startStation` varchar(155) NOT NULL,
  `via` varchar(195) NOT NULL,
  `lastStation` varchar(195) NOT NULL,
  `estimatedDistance` varchar(150) NOT NULL,
  `ldistance` varchar(155) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `superuser`
--

CREATE TABLE `superuser` (
  `userid` varchar(15) NOT NULL,
  `fname` varchar(45) NOT NULL,
  `mname` varchar(45) NOT NULL,
  `lname` varchar(45) NOT NULL,
  `password` varchar(45) NOT NULL,
  `title` varchar(155) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `superuser`
--

INSERT INTO `superuser` (`userid`, `fname`, `mname`, `lname`, `password`, `title`) VALUES
('20190322095121', 'Hassan', 'Jeremiah', 'Aikoh', '0758912113AIKOH0689749960', 'System admin'),
('20190322095121', 'Hassan', 'Jeremiah', 'Aikoh', '0758912113AIKOH0689749960', 'System admin');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `account_owner`
--
ALTER TABLE `account_owner`
  ADD PRIMARY KEY (`own_regno`);

--
-- Indexes for table `advertisement`
--
ALTER TABLE `advertisement`
  ADD PRIMARY KEY (`advert_id`),
  ADD KEY `hotel_id` (`hotel_id`);

--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
  ADD PRIMARY KEY (`receipNo`,`cust_id`),
  ADD KEY `hotel_id` (`hotel_id`);

--
-- Indexes for table `expenses`
--
ALTER TABLE `expenses`
  ADD KEY `hotel_id` (`hotel_id`);

--
-- Indexes for table `hotel`
--
ALTER TABLE `hotel`
  ADD PRIMARY KEY (`hotel_id`),
  ADD KEY `owner_id_2` (`owner_id`);

--
-- Indexes for table `hotelasssevices`
--
ALTER TABLE `hotelasssevices`
  ADD PRIMARY KEY (`serviceId`,`hotelid`);

--
-- Indexes for table `images`
--
ALTER TABLE `images`
  ADD PRIMARY KEY (`hotelid`,`imgname`);

--
-- Indexes for table `profilepicture`
--
ALTER TABLE `profilepicture`
  ADD PRIMARY KEY (`ownerid`);

--
-- Indexes for table `recept`
--
ALTER TABLE `recept`
  ADD PRIMARY KEY (`recept_no`,`hotel_id`),
  ADD KEY `hotel_id` (`hotel_id`),
  ADD KEY `room_id` (`room_id`),
  ADD KEY `cust_id` (`cust_id`);

--
-- Indexes for table `room`
--
ALTER TABLE `room`
  ADD PRIMARY KEY (`room_no`,`hotel_id`),
  ADD KEY `hotel_id` (`hotel_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `advertisement`
--
ALTER TABLE `advertisement`
  MODIFY `advert_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `advertisement`
--
ALTER TABLE `advertisement`
  ADD CONSTRAINT `advertisement_ibfk_1` FOREIGN KEY (`hotel_id`) REFERENCES `hotel` (`hotel_id`);

--
-- Constraints for table `customer`
--
ALTER TABLE `customer`
  ADD CONSTRAINT `customer_ibfk_1` FOREIGN KEY (`hotel_id`) REFERENCES `hotel` (`hotel_id`);

--
-- Constraints for table `expenses`
--
ALTER TABLE `expenses`
  ADD CONSTRAINT `expenses_ibfk_1` FOREIGN KEY (`hotel_id`) REFERENCES `hotel` (`hotel_id`);

--
-- Constraints for table `hotel`
--
ALTER TABLE `hotel`
  ADD CONSTRAINT `hotel_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `account_owner` (`own_regno`);

--
-- Constraints for table `recept`
--
ALTER TABLE `recept`
  ADD CONSTRAINT `recept_ibfk_1` FOREIGN KEY (`hotel_id`) REFERENCES `hotel` (`hotel_id`);

--
-- Constraints for table `room`
--
ALTER TABLE `room`
  ADD CONSTRAINT `room_ibfk_1` FOREIGN KEY (`hotel_id`) REFERENCES `hotel` (`hotel_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 */;
