Home > Database > Mysql Tutorial > mysql 创建表 creat table实例

mysql 创建表 creat table实例

WBOY
Release: 2016-06-01 09:58:18
Original
1513 people have browsed it

实例一:创建最基本的表(下面创建了一个manong表)

<code>CREATE TABLE manong(
    id int not null,
    category char(20)
);</code>
Copy after login

 

实例二:创建带主键(primary key)的表

<code>CREATE TABLE manong(
    id int not null primary key,
    category char(20)
);</code>
Copy after login

上面实例创建了一个mangnong表,分别有id和category两个字段,其中id为主键。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template