以创建一张Person表为例


# 创建数据库
create database if not exists daily;

# 创建数据表
create table if not exists `person` (
    `id` int unsigned auto_increment,
    `name` varchar(20) not null,
    `age` int unsigned not null,
    `gender` varchar(5) not null,
    `birthday` DATE DEFAULT NULL,
    primary key(`id`)
)ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

# 插入数据
insert into `person` values
(null,'Rick',12,'男','2020-07-15'),
(null,'Morty',55,'男','1988-03-17'),
(null,'Beth',28,'女','1999-12-05'),
(null,'Jerry',30,'男','1990-05-11'),
(null,'Summer',14,'女','2018-03-12'),
(null,'Bird',29,'男','1989-04-16');

相关文章:

  • 2021-04-07
  • 2022-12-23
  • 2021-08-07
  • 2021-06-17
  • 2022-01-07
  • 2022-12-23
  • 2021-05-02
  • 2021-08-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-12-30
  • 2022-12-23
相关资源
相似解决方案