Subject Re: [Firebird-general] Firebird Experiment (was Property Management/Hotel systems)
Author Dariusz Zelichowski
I would also modify TABLE tbl_rooms quite a bit by breaking
it into more tables. This would ensure greater flexibility
for the user.

CREATE TABLE tbl_room (
int_room_gen INTEGE NOT NULL,
int_room NUMERIC(18,0) NOT NULL,
int_number INTEGER NOT NULL, /* Room number, default to
-1 for rooms with no numbers but names instead */
str_room_nname VARCHAR(20) NOT NULL, /* some rooms have
no numbers but names */
int_floor INTEGER, /* Floor number */
int_building NUMERIC(18,0), /* References tbl_building */
CASCADE,
FOREIGN KEY(int_building) REFERENCES tbl_building
(int_building) ON
UPDATE CASCADE
);


CREATE TABLE tbl_room_type (
int_room_type_gen INTEGER NOT NULL,
str_room_type_code VARCHAR(10) NOT NULL,
int_sleeps INTEGER, /* Sleeps how many people */
int_singles INTEGER, /* Number of single beds */
int_dbls INTEGER, /* Number of double beds */
str_window_exposure VARCHAR(40) /* South, view of the
Ocean etc. Yes, some folks won't fall asleep unlss the room
faces East :) */
);


CREATE TABLE tbl_room_equipment_types (
int_room_equip_type_gen INTEGE NOT NULL,
str_room_equip_descr VARACHAR(40) NOT NULL
);


CREATE TABLE tbl_room_type_equipment (
int_room_type_equipment_gen INTEGER NOT NULL,
int_room_equip_type_gen INTEGE NOT NULL,
char_equip_available INTEGER NOT NULL /*Y,N. optional
field*/
);


/*table below would allow to enter extra features not
present in
TABLE tbl_room_type or in TABLE tbl_room_equipment_types
Optionally, new room types could be created for such
scenarios, even if
only to setisfy the ned to desccribe a single room
which falls out of other room types */

CREATE TABLE tbl_room_override_features (
int_room_type_equipment_gen INTEGER NOT NULL,
int_room_equip_type_gen INTEGE NOT NULL,
char_equip_available INTEGE NOT NULL /*optional field*/
);



--- Nigel Weeks <nweeks@...> wrote:

>
> Righto, lunch is over. Here's what I've done:
> Anyone like to add/modify/delete?
>
> Nige.
>
>





__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail