创建mysql数据库并导入XML

创建mysql数据库并导入XML,mysql,xml,Mysql,Xml,Hy 我试图在一个XML文件之后找出一个数据库结构。我是相对新来的,对这样的复杂性 在我创建了able之后,我需要导入它。问题是,我认为它是使用连接生成的xml。你能给我一些如何处理这个问题的建议吗。我的XML中的一行如下所示: <listing> <id>GS0147</id> <date_added>2014-10-9</date_added> <property_type>residential</proper

Hy 我试图在一个XML文件之后找出一个数据库结构。我是相对新来的,对这样的复杂性

在我创建了able之后,我需要导入它。问题是,我认为它是使用连接生成的xml。你能给我一些如何处理这个问题的建议吗。我的XML中的一行如下所示:

 <listing>
<id>GS0147</id>
<date_added>2014-10-9</date_added>
<property_type>residential</property_type>
<property_subtype>appartment</property_subtype>
<listing_type>rent</listing_type>
<geo_location>
<lat>00000</lat>
<lon>26.13860</lon>
</geo_location>
<address>
<county>Bucuresti Ilfov</county>
<city>Bucuresti</city>
<neighbourhood>Berceni</neighbourhood>
<street>Ion Iriceanu</street>
<street_number/>
</address>
<price>
<price>1100</price>
<currency>EUR</currency>
<price_type>full</price_type>
<price_eur>1100</price_eur>
<rent_period/>
</price>
<area>35</area>
<land_area/>
<title>
<![CDATA[ Inchiriere garsoniera Berceni,Oltenitei,Iriceanu ]]>
</title>
<description>
<![CDATA[
&lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;strong&gt;&amp;nbsp;Va ofer spre inchiriere o garsoniera in zona&amp;nbsp;&lt;span style=&quot;line-height: 115%;&quot;&gt;BERCENI,&amp;nbsp; Oltenitei, vila, confort, contorizata total, aer conditionat, catv, LCD, receiver, internet, balcon, foisor curte, strada necirculata, parcare, termen lung.Investitia lunara este de 1100 ron.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
]]>
</description>
<images>
<image>
http://soft.echiparenet.ro/images/propertiessite/img_1240_15230.jpg
</image>
<image>
http://soft.echiparenet.ro/images/propertiessite/img_1240_15231.jpg
</image>
<image>
http://soft.echiparenet.ro/images/propertiessite/img_1240_15232.jpg
</image>
<image>
http://soft.echiparenet.ro/images/propertiessite/img_1240_15233.jpg
</image>
<image>
http://soft.echiparenet.ro/images/propertiessite/img_1240_15234.jpg
</image>
<image>
http://soft.echiparenet.ro/images/propertiessite/img_1240_15235.jpg
</image>
<image>
http://soft.echiparenet.ro/images/propertiessite/img_1240_15236.jpg
</image>
<image>
http://soft.echiparenet.ro/images/propertiessite/img_1240_15237.jpg
</image>
<image>
http://soft.echiparenet.ro/images/propertiessite/img_1240_15238.jpg
</image>
</images>
<url>
http://www.gabrielstefan.ro/garsoniera-de-inchiriat-berceni-bucuresti-1236.html
</url>
<rooms>1</rooms>
<bathrooms>1</bathrooms>
<kitchens>0</kitchens>
<balconies>0</balconies>
<appartment_type>3</appartment_type>
<floor>2</floor>
<building_floors>2</building_floors>
<air_conditionning>0</air_conditionning>
<internet>0</internet>
<television>0</television>
<security>0</security>
<phone>0</phone>
<heatting_system/>
<furnished/>
<wather>0</wather>
<gas>0</gas>
<electricity>0</electricity>
<street_front>0</street_front>
<termopan>0</termopan>
<wood_floors>0</wood_floors>
<parking/>
<garage/>
<paperwork/>
<build_year>2006</build_year>
<build_materials/>
</listing>

GS0147
2014-10-9
住宅的
公寓
租金
00000
26.13860
比库雷斯蒂·伊尔福夫
比丘里斯蒂
贝塞尼
离子虹彩
1100
欧元
满的
1100
35
http://soft.echiparenet.ro/images/propertiessite/img_1240_15230.jpg
http://soft.echiparenet.ro/images/propertiessite/img_1240_15231.jpg
http://soft.echiparenet.ro/images/propertiessite/img_1240_15232.jpg
http://soft.echiparenet.ro/images/propertiessite/img_1240_15233.jpg
http://soft.echiparenet.ro/images/propertiessite/img_1240_15234.jpg
http://soft.echiparenet.ro/images/propertiessite/img_1240_15235.jpg
http://soft.echiparenet.ro/images/propertiessite/img_1240_15236.jpg
http://soft.echiparenet.ro/images/propertiessite/img_1240_15237.jpg
http://soft.echiparenet.ro/images/propertiessite/img_1240_15238.jpg
http://www.gabrielstefan.ro/garsoniera-de-inchiriat-berceni-bucuresti-1236.html
1.
1.
0
0
3.
2.
2.
0
0
0
0
0
0
0
0
0
0
0
2006

我不知道您有多少数据,但如果是我,我会尝试统计每个字段的变化。这有助于识别哪些是常见的,哪些是更独特的。计数越高,共同点就越多

您可以通过导入所有字段并获得每个字段的计数(假设它不是太大而无法处理)来进行第一次传递。如果不需要所有字段,可以只导出需要的字段,从而减少需要处理的数据的总体大小

一旦掌握了要处理的内容,就可以开始真正设计模式了。
希望这有帮助。

分离xml。找出哪些标记/子标记可以重复-这些标记/子标记进入子表。其他任何东西都可以放在主桌上,是我做的。我对表格进行了认证,但您知道如何同时导入表格吗。有没有办法在我的相关表中进行多次导入?