> 백엔드 개발 > PHP 튜토리얼 > MySQL 테이블 생성 문

MySQL 테이블 생성 문

WBOY
풀어 주다: 2016-08-08 09:33:00
원래의
885명이 탐색했습니다.

<span> 1</span> <span>DROP</span> <span>TABLE</span> <span>IF</span> <span>EXISTS</span><span> `nuvue`;
</span><span> 2</span> 
<span> 3</span> <span>CREATE</span> <span>TABLE</span><span> `nuvue`(
</span><span> 4</span>     `id` <span>INT</span>(<span>10</span>) UNSIGNED <span>NOT</span> <span>NULL</span><span> AUTO_INCREMENT,
</span><span> 5</span>     `status` <span>TINYINT</span>(<span>2</span>) UNSIGNED <span>NOT</span> <span>NULL</span> <span>DEFAULT</span> <span>0</span> COMMENT <span>'</span><span>状态</span><span>'</span><span>,
</span><span> 6</span>     `uid` <span>INT</span>(<span>10</span>) UNSIGNED <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>创建用户</span><span>'</span><span>,
</span><span> 7</span>     `province_id` <span>TINYINT</span>(<span>3</span>)  UNSIGNED <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>一级城市</span><span>'</span><span>,
</span><span> 8</span>     `city_id` <span>TINYINT</span>(<span>3</span>)  UNSIGNED <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>二级地区</span><span>'</span><span>,
</span><span> 9</span>     `name` <span>VARCHAR</span>(<span>100</span>) <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>场地名称</span><span>'</span><span>,
</span><span>10</span>     `logo_url` <span>VARCHAR</span>(<span>100</span>) <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>场地Logo</span><span>'</span><span>,
</span><span>11</span>     `location_address` <span>VARCHAR</span>(<span>200</span>) <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>场地地址</span><span>'</span><span>,
</span><span>12</span>     `location_point` <span>VARCHAR</span>(<span>30</span>) <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>场地坐标</span><span>'</span><span>,
</span><span>13</span>     `caoncat_phone` <span>VARCHAR</span>(<span>20</span>) <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>联系人电话</span><span>'</span><span>,
</span><span>14</span>     `type` ENUM(<span>'</span><span>livehouse</span><span>'</span>,<span>'</span><span>theare</span><span>'</span>,<span>'</span><span>bar</span><span>'</span>,<span>'</span><span>bookshop</span><span>'</span>,<span>'</span><span>other</span><span>'</span>) <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>场地类型</span><span>'</span><span>,
</span><span>15</span>     `phone` <span>VARCHAR</span>(<span>20</span>) <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>场地电话</span><span>'</span><span>,
</span><span>16</span>     `area` <span>VARCHAR</span>(<span>10</span>) <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>场地面积</span><span>'</span><span>,
</span><span>17</span>     `people` <span>VARCHAR</span>(<span>10</span>) <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>容纳人数</span><span>'</span><span>,
</span><span>18</span>     `device` <span>VARCHAR</span>(<span>100</span>) <span>NOT</span> <span>NULL</span> <span>DEFAULT</span> <span>''</span> COMMENT <span>'</span><span>场地设备</span><span>'</span><span>,
</span><span>19</span>     `introduction` <span>VARCHAR</span>(<span>100</span>) <span>NOT</span> <span>NULL</span> <span>DEFAULT</span> <span>''</span> COMMENT <span>'</span><span>场地简介</span><span>'</span><span>,
</span><span>20</span>     `create_at` <span>DATETIME</span> <span>NOT</span> <span>NULL</span> COMMENT <span>'</span><span>创建时间</span><span>'</span><span>,
</span><span>21</span>     <span>PRIMARY</span> <span>KEY</span><span> `id`(`id`),
</span><span>22</span>     <span>UNIQUE</span> <span>KEY</span><span> `name`(`name`),
</span><span>23</span>     <span>KEY</span><span> `idx_type`(`type`),
</span><span>24</span>     <span>KEY</span><span> `idx_uid`(`uid`),
</span><span>25</span>     <span>KEY</span><span> `idx_status`(`status`),
</span><span>26</span>     <span>KEY</span><span> `idx_location`(`province_id`,`city_id`)
</span><span>27</span> )ENGINE<span>=</span> Myisam <span>DEFAULT</span> CHARSET <span>=</span> utf8;
로그인 후 복사

위 내용은 다양한 측면을 포함하여 MySQL 테이블 생성문을 소개하고 있는데, PHP 튜토리얼에 관심이 있는 친구들에게 도움이 되기를 바랍니다.

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿