create table t_card( card_id char(20) primary key auto_increment not null , student_id char(10) not null, student_name varchar(20) not null, curr_money decimal(8,2) not null, Register_data date not null );
时间: 2024-04-27 21:19:34 浏览: 11
这是一条创建名为 t_card 的表的 SQL 语句。该表包含以下 5 个列:
- card_id: char(20) 类型的主键列,长度为 20,使用 auto_increment 自增,并且不允许为空。
- student_id: char(10) 类型的列,长度为 10,不允许为空。
- student_name: varchar(20) 类型的列,长度为 20,不允许为空。
- curr_money: decimal(8,2) 类型的列,总长度为 8,小数点后有 2 位,不允许为空。
- Register_data: date 类型的列,日期类型,不允许为空。
这个表的设计比较简单,适用于存储学生卡的信息,其中每张卡都由一个唯一的卡号(card_id)来标识,同时记录了该卡所属的学生(student_id)、学生姓名(student_name)、卡内余额(curr_money)和注册日期(Register_data)。