English 中文(简体)
租赁名单设计数据库
原标题:Database Design for Rental Listings

I m designing a simple database for a rental listings website,
sort of like classified ads but only for home/room rentals.

This is what I ve come up with thus far:

“entergraph

Question 1
For the "post" table, I actually wanted more information. For example, there would be a facilities section where the users can select whether there s parking available, do I need a separate table? Or just use 0 for no and 1 for yes?

Question 2
Here s what I did with the "category" table (sorry I don t know how to pretty print yet)
Category_ID 1 is Rent
Category_ID 2 is buildingType

For "categoryProperty" table
Category_ID 1 categoryPropertyID 1 House
Category_ID 1 categoryPropertyID 2 Room
Category_ID 2 categoryPropertyID 3 Apartment
Category_ID 2 categoryPropertyID 4 Condominium
Category_ID 2 categoryPropertyID 5 Detached

www.un.org/Depts/DGACM/index_spanish.htm 是否具有意义?

Question 3
Users can post whether they are logged in or not.
Just that logged in users/members have the advantage of tracking their ads/adjusting the availability.
How do I record the ads that a member has posted? Like their history.
Should I create a "postHistory" table and set the postHistory_ID as FK to "member" table?

Thanks a lot in advance, I appreciate your help, especially just pointing me to the right direction.

问题回答

问题1:

make a separate table and make a One to One relation, that would be the simplest way:

POST - 深层

在EXTRAS, 您可能拥有每个额外领域(火花=1/0,_down_town=1/0,has_a_gost=1/0)

Question 2: This does not make sense, you ve two options:

in the Post table create a "type_of_operation", that can have two vales (building_type,rent). Or you can create different tables, but would make this more complicate (you should analyise if the same type can be in both states, etc).

Question 3: I recommend you to make your users register. Even with a really simple form (email+password) .

您的具体问题:

问题1:假设有一个以上类型的设施(园艺、游泳池、吉姆),那么你的关系是多方面的,你希望有两个新的表格: 设施和不动产。 每个财产(或我猜测“邮政”)在财产法表中可以有多个行文。

问题2:没有真正清楚你重新获得什么——每个财产类型是否可以全部或部分出租或每间房租赁?

问题3:良好问题,你想要做的是,在贵组织名册上有一个积极的轨道,或者有缺陷——那么,任何变成不活动或过期的东西都自动成为历史数据,无需将其整理到历史表格中。 虽然你最终必须存档。





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签