How to make design for booking hotel and program ?

  • I need  to design database for booking  tours  for tourism company

    Tourist  booking package  have two type :

    Reservation hotel  : this is will by 4 days or 6 days .

    Suppose he select hotel Hilton 4 days meaning 3 Nights include (  accommodation costs + flight costs + transfer costs )

    Reservation Program: this will be 4 days or 6 days only

    Suppose he select program alexa 4 days meaning 3 Nights ( accommodation costs + flight costs + transfer costs + excursions costs)

    Accommodation cost include room price per days + services  depend on periods

    Meaning room  price from 01/01/2017 to 01/04/2017 different from 01/05/2017 to 01/09/2017

    Flight include internal flights and return back to his country

    Transfer : include internal transfer from airport to hotel  .

    Price of transfers  from date 01/01/2017 to 01/04/2017 different from 02/04/2017 to 02/12/2017

    Excursions : visit musumes  like that and this is represent cost of visit

    Excursion price depend on periods .

    Price of excursion   from date 01/01/2017 to 01/04/2017 different from 02/04/2017 to 02/12/2017

    And excursion only found on programs not hotel reservation

    4 days for hotel or program start from flight date

    Every flight have more than one package (reservation hotel or program)

    Final Result as below :

    Package 1 4 days
    day     flight                                   hotel
    day1     amsterdam to aswan      Hilton
    day2                                            Hilton
    day3                                            Hilton
    day4    aswan to amsterdam     
    Package 1 4 days costs(Here actually my problem )
    day             flightcosts      hotelcosts
    26/07/2017    500                50
    27/07/2017                         50
    28/07/2017                        50
    29/07/2017                        500      

  • Sounds like homework. Pretty sure you're supposed to do it yourself.  Try it and ask if you don't understand something.

  • And if it's not homework, consider getting an external consultant/contractor in who's familiar with DB design. Designing a full DB from sparse requirements is a bit beyond a forum's free help.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Albert Kallal wrote one of these several years ago. Or one very similar to this. Not sure if he used SQL Server as a back end, although he might have.
    Here's a link... He may have done the back end in Access, but he could convert it to SQL Server...

    Of course, if this is for learning/school, that's a different matter entirely.

  • can't be sure if this is homework or someone entirely out of their depth in a job.
    same requests for help here

    https://stackoverflow.com/questions/44974294/hotel-hotelid-have-relation-with-package-and-in-same-time-have-relation-with-day

    https://social.msdn.microsoft.com/Forums/en-US/1e23b6ad-5c8d-430b-a27d-8324676a38af/hotel-hotelid-have-relation-with-package-and-in-same-time-have-relation-with-daydetails-table?forum=transactsql

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • I will work then if you see any thing wrong help me .
    I need to make database design to booking hotel and program tourists
    to  this site from scratch
    https://www.egypte.nl/
    to booking hotels go to bestemmingen then select bestemmingen then select hotels
    to booking Programs tourists go to Ronderizen then select program .
    so i create 4 tables tables 
    Hotels
    Program
    programtype
    Package
    USE [NileTravel]
    GO
    /****** Object: Table [dbo].[Hotel]  Script Date: 08/07/2017 5:27:41 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Hotel](
        [HotelID] [int] NOT NULL,
        [HotelName] [nvarchar](50) NULL,
        [Rating] [nvarchar](10) NULL,
    CONSTRAINT [PK_Product] PRIMARY KEY CLUSTERED
    (
        [HotelID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]

    GO
    /****** Object: Table [dbo].[Package]  Script Date: 08/07/2017 5:27:41 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Package](
        [PackageID] [int] NOT NULL,
        [PackageName] [nvarchar](100) NULL,
        [Duration] [nvarchar](50) NULL,
        [HotelID] [int] NULL,
        [ProgramID] [int] NULL,
    CONSTRAINT [PK_Package] PRIMARY KEY CLUSTERED
    (
        [PackageID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]

    GO
    /****** Object: Table [dbo].[Program]  Script Date: 08/07/2017 5:27:41 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Program](
        [ProgramID] [int] NOT NULL,
        [ProgramName] [nvarchar](50) NULL,
        [ProgramTypeID] [int] NULL,
    CONSTRAINT [PK_Program] PRIMARY KEY CLUSTERED
    (
        [ProgramID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]

    GO
    /****** Object: Table [dbo].[Type]  Script Date: 08/07/2017 5:27:41 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[Type](
        [ProgramTypeID] [int] NOT NULL,
        [ProgramType] [nvarchar](50) NULL,
    CONSTRAINT [PK_Type] PRIMARY KEY CLUSTERED
    (
        [ProgramTypeID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]

    GO
    INSERT [dbo].[Hotel] ([HotelID], [HotelName], [Rating]) VALUES (1, N'Hilton', N'***')
    INSERT [dbo].[Hotel] ([HotelID], [HotelName], [Rating]) VALUES (2, N'Basma', N'**')
    INSERT [dbo].[Hotel] ([HotelID], [HotelName], [Rating]) VALUES (3, N'Movenpick', N'***')
    INSERT [dbo].[Package] ([PackageID], [PackageName], [Duration], [HotelID], [ProgramID]) VALUES (1, N'HiltonPackage', N'4', 1, NULL)
    INSERT [dbo].[Package] ([PackageID], [PackageName], [Duration], [HotelID], [ProgramID]) VALUES (2, N'BasmaPackage', N'4,6', 2, NULL)
    INSERT [dbo].[Package] ([PackageID], [PackageName], [Duration], [HotelID], [ProgramID]) VALUES (3, N'alexaPackage', N'4', NULL, 1)
    INSERT [dbo].[Package] ([PackageID], [PackageName], [Duration], [HotelID], [ProgramID]) VALUES (4, N'sfinxPackage', N'4,6', NULL, 1)
    INSERT [dbo].[Program] ([ProgramID], [ProgramName], [ProgramTypeID]) VALUES (1, N'alexa', 1)
    INSERT [dbo].[Program] ([ProgramID], [ProgramName], [ProgramTypeID]) VALUES (2, N'sfinx', 1)
    INSERT [dbo].[Program] ([ProgramID], [ProgramName], [ProgramTypeID]) VALUES (3, N'amon', 2)
    INSERT [dbo].[Type] ([ProgramTypeID], [ProgramType]) VALUES (1, N'NileCruize')
    INSERT [dbo].[Type] ([ProgramTypeID], [ProgramType]) VALUES (2, N'Sun')
    INSERT [dbo].[Type] ([ProgramTypeID], [ProgramType]) VALUES (3, N'Sea')
    ALTER TABLE [dbo].[Package] WITH CHECK ADD CONSTRAINT [FK_Package_Program] FOREIGN KEY([ProgramID])
    REFERENCES [dbo].[Program] ([ProgramID])
    GO
    ALTER TABLE [dbo].[Package] CHECK CONSTRAINT [FK_Package_Program]
    GO
    ALTER TABLE [dbo].[Package] WITH CHECK ADD CONSTRAINT [FK_Program_Hotel] FOREIGN KEY([HotelID])
    REFERENCES [dbo].[Hotel] ([HotelID])
    GO
    ALTER TABLE [dbo].[Package] CHECK CONSTRAINT [FK_Program_Hotel]
    GO
    ALTER TABLE [dbo].[Program] WITH CHECK ADD CONSTRAINT [FK_Program_Type] FOREIGN KEY([ProgramTypeID])
    REFERENCES [dbo].[Type] ([ProgramTypeID])
    GO
    ALTER TABLE [dbo].[Program] CHECK CONSTRAINT [FK_Program_Type]
    GO


    until now this is correct or not

  • i start building what i need from first step by step
    cbecause i have some point problem before i write i must introduce to it

  • ahmed_elbarbary.2010 - Saturday, July 8, 2017 9:37 AM

    i start building what i need from first step by step
    cbecause i have some point problem before i write i must introduce to it

    hmmm... the site you refer "https://www.egypte.nl/"  seems to me be working OK......what is your business involvement in this?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • I need to do design site like that and i have some problem to design database

  • can you help me please i will work and if some thing wrong tell me please

  • this is database design expected to website http://www.egypte.nl
    * every package have only one hotel .
    * every package have only one program .
    * package have more duration may be 8 or 15 or 21 days only so that i have many in package duration table .
    * day details data is fixed meaning not every day change hotel accommodation per program or flight or transfer or excursion .
    hotel booking include period accommodation + flight cost + transfer cost
    program tourists booking include hotels accommodation + flight costs + transfer costs + excursion costs
    PackagePackageID PackageName Duration
      01             hotelpackage 8,15
    PackageDuration
    PD01 01 8 7
    PD02 01 15 14 (7,14 represent nights,nights=days-1)
    DurationDetails
    DD01 PD01 DAY1
    DD02 PD01 DAY2
    DD03 PD01 DAY3
    Until 8 days etc
    DayDetails
    Day1 Hilton Hotel
    Day1 flight
    Day2 Hilton Hotel
    Day3 Hilton Hotel
    Day4 Hilton Hotel
    Day5 Hilton Hotel
    Day6 Hilton Hotel
    Day7 Hilton Hotel
    Day8 flight
    DayDetailsCost
    26/06/2017 50
    26/06/2017 500
    27/06/2017 50
    28/06/2017 50
    29/06/2017 50
    30/06/2017 50
    01/07/2017 50
    02/07/2017 50
    03/07/2017 500

  • this is design expected for database design
    * every package have only one hotel .
    * every package have only one program .
    * package have more duration may be 8 or 15 or 21 days only so that i have many in package duration table .
    * day details data is fixed meaning not every day change hotel accommodation per program or flight or transfer or excursion .
    hotel booking include period accommodation + flight cost + transfer cost
    program tourists booking include hotels accommodation + flight costs + transfer costs + excursion costs

    PackagePackageID PackageName Duration
    01     hotelpackage 8,15
    PackageDuration
    PD01 01 8 7
    PD02 01 15 14 (7,14 represent nights,nights=days-1)
    DurationDetails
    DD01 PD01 DAY1
    DD02 PD01 DAY2
    DD03 PD01 DAY3
    Until 8 days etc
    DayDetails
    Day1 Hilton Hotel
    Day1 flight
    Day2 Hilton Hotel
    Day3 Hilton Hotel
    Day4 Hilton Hotel
    Day5 Hilton Hotel
    Day6 Hilton Hotel
    Day7 Hilton Hotel
    Day8 flight
    DayDetailsCost
    26/06/2017 50
    26/06/2017 500
    27/06/2017 50
    28/06/2017 50
    29/06/2017 50
    30/06/2017 50
    01/07/2017 50
    02/07/2017 50
    03/07/2017 500


  • I have more questions 
    first question
    I have relation between hotel table and package and in same time have relation between hotel and day details table are this circular reference 
    day details table have relation with hotel because every day have accommodation hotel or more .
    and every hotel have more than one package may be 8 or 15 days
    include flights and transfer .
    Are relation between tables hotel and packes and day details is correct or circular reference ?
    and if circular reference how to fix it

  • I hate to be ugly, but I really think you're over your head on this one.  E-mail Albert Kallal and see. He wrote about designing something very similar on the website I posted a link to. Did you read it?  he ended up using classes in VBA to do it (it was a long time ago). This is a non-trivial database, so if you're not sure you know what you're doing, things are going to be extremely hard.  Your best bet would be to find someone who can help.

  • Personally I wouldn't link packages direct to hotels. Packages link to day details, which links to Hotel.

    There's way too many tables there
    Why are package and package duration different tables? Do packages have multiple durations? Why would they not be considered different packages (their details will be different, costs will be different)
    Why are Excursion and Excursion period different tables? TransferType and Transfer period?

    p.s. Why is this yet another thread?
    You're not going to get better answers by asking the same question multiple times.

    No more replies here please, let's try and keep this tidy
    https://www.sqlservercentral.com/Forums/1884715/How-to-make-relation-between-tables-to-calculate-cost-of-flight-and-transfer-and-hotel-and-excursion

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic. Login to reply