Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The use of database SQL statements

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains the "use of database SQL statements", the content of the explanation is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "the use of database SQL statements" bar!

1. Create database create database if not exists cs2013;2, create database tables create table if not exists comp (id int not null primary key auto_increment, pid varchar (30) not null unique, cname varchar (30) not null, ename varchar (30) not null, grade varchar (30) not null, sex int not null, clothe varchar (15) not null) default charset = utf8 Create table if not exists team (id int not null primary key auto_increment, cname varchar (30) not null, ename varchar (30) not null, coach0 int not null, coach2 int not null, stu0 int not null, stu1 int not null, stu2 int not null, isgirls int not null, email varchar (30) not null, phone varchar (15) not null Foreign key (coach0) references comp (id), foreign key (coach2) references comp (id), foreign key (stu0) references comp (id), foreign key (stu1) references comp (id), foreign key (stu2) references comp (id) default charset = utf8 Create table if not exists college (id int not null primary key auto_increment, cname varchar (30) not null, ename varchar (30) not null, teamcnt int not null) default charset = utf8 Create table if not exists rc (id int not null primary key auto_increment, college int not null, team int not null, date date not null, foreign key (college) references college (id), foreign key (team) references team (id)) default charset = utf8 Create table if not exists room (id int not null primary key auto_increment, name varchar (30) not null, totcnt int not null, regcnt int not null, price double not null) default charset = utf8 Create table if not exists hotel (id int not null primary key auto_increment, name varchar (30) not null, room0 int not null, room1 int not null, room2 int not null, foreign key (room0) references room (id), foreign key (room1) references room (id), foreign key (room2) references room (id) default charset = utf8 Create table if not exists rh (id int not null primary key auto_increment, college int not null, hotel int not null, date date not null, foreign key (college) references college (id), foreign key (hotel) references hotel (id)) default charset = utf8 Thank you for your reading, the above is the content of "the use of database SQL statements", after the study of this article, I believe you have a deeper understanding of the use of database SQL statements, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report