1創建Bigschool 資料庫

drop database if exists Bigschool;
create database Bigschool default charset utf8 collate utf8_bin;
2.創建學院表

create table tb_college
(
collid int not null auto_increment comment ‘學院排行號’,
collname varchar(50) not null comment ‘學院名稱’,
collmaster varchar(20) not null comment ‘院長姓名’,
collweb varchar(511) default ‘’ comment ‘學院資訊’,
primary key (collid)
);
添加唯一約束
alter table tb_college add constraint uni_college_collname unique (collname);
1.插入

insert into tb_college (collname, collmaster, collweb) values
(‘北京大學’, ‘王紅利’, ‘cdon.com’),
(‘清華大學’, ‘趙側田’, ‘appong.com’),
(‘輕工業學院’, ‘黎天才’, ‘gcfnd.com’);
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/220894.html
標籤:python
上一篇:git bash很卡很慢
下一篇:MySql常用SQL陳述句
