diff --git "a/NBA\344\275\234\344\270\232/\345\217\266\347\234\237/NBA.sql" "b/NBA\344\275\234\344\270\232/\345\217\266\347\234\237/NBA.sql" new file mode 100644 index 0000000000000000000000000000000000000000..8c3e62d6dd28482a2d7b60ea960cc108100906d6 --- /dev/null +++ "b/NBA\344\275\234\344\270\232/\345\217\266\347\234\237/NBA.sql" @@ -0,0 +1,114 @@ +use master +go + +create database NBADate +go + +use NBA +go + +create table Team +( + TeamId int primary key identity not null , + reamName varchar(20) not null , + victory int not null , + coach varchar(20) not null +) +go + +create table UsersInfo +( + UsersId int primary key identity not null, + UsersName varchar(20) not null , + UsersSex varchar(2) , + jingli int not null , + Team varchar(20) +) +go + +create table UsersData +( + UsersId int references UsersInfo(UsersId) not null, + TeamId int references Team(TeamId) not null , + chuchang int not null , + mingzhong varchar(10) not null , + trisection varchar(10) not null , + faqiu varchar(10) not null , + lanban float not null , + zhugong float not null , + defeng float not null , + qiangduan float not null , + gaimao float not null +) +go + +create table Game +( + GameId int primary key identity not null , + TeamId1 int references Team(TeamId) not null , + defen1 int not null, + TeamId2 int references Team(TeamId) not null , + defen2 int not null, + date date not null +) +go + +create table champion +( + TeamId int references Team(TeamId) not null , + Mvp nvarchar(20) not null, + duoguan int not null, + victory int not null , + failing int not null +) +go + +insert into UsersInfo + select '勒布朗-詹姆斯','男','17','湖人' union + select '贾里德-杜德利 ','男','13','湖人' union + select '扬尼斯-阿德托昆博 ','男','7','雄鹿' union + select '布鲁克-洛佩兹','男','12','雄鹿' union + select '斯蒂芬-库里 ','男','11','勇士' union + select '克雷-汤普森','男','8','勇士' union + select '凯文-杜兰特','男','12','篮网' union + select '詹姆斯-哈登 ','男','11','篮网' union + select '科怀-莱昂纳德 ','男','9','快船' union + select '拉简-朗多 ','男','14','快船' +go + +insert into Team + select '湖人','32','弗兰克-沃格尔' union + select '雄鹿','32','迈克-布登霍尔泽' union + select '勇士','24','史蒂夫-科尔' union + select '篮网','36','史蒂夫-纳什' union + select '快船','34','泰伦-卢' +go + +insert into Game + select '4','138','5','99','2020-12-26 03:30:00' union + select '1','87','2','81','2020-12-12 11:00:00' union + select '1','131','2','106','2020-12-14 09:30:00' union + select '3','125','5','99','2020-12-23 08:00:00' union + select '1','109','2','116','2020-12-23 11:00:00' +go + +insert into UsersData + select '1','4','32','53.0','44.3','87.3','7.6','5.2','28.3','0.6','1.0' union + select '2','1','23','54.0','48.2','86.3','7.3','5.1','28.6','0.4','1.1' union + select '3','3','20','53.0','44.3','87.3','7.3','5.3','28.4','0.7','1.4' union + select '4','2','36','51.0','44.6','86.2','8.1','5.5','28.4','0.8','1.0' union + select '5','5','40','54.0','46.2','76.5','7.4','6.5','28.4','0.6','1.3' union + select '6','2','41','54.5','44.2','84.6','8.1','5.6','28.6','0.7','1.5' union + select '7','1','41','51.3','36.8','70.3','7.9','7.9','25.4','1','0.6' union + select '8','5','43','48.1','40.8','92.5','5.5','6','29.7','1.3','0.1' union + select '9','4','45','56.5','30.2','68.7','11.4','6.2','28.8','1.1','1.3' union + select '10','3','42','46.3','35.8','87.0','8','10.9','25.2','1.2','0.7' +go + +insert into champion + select '1','沙奎尔·奥尼尔','2000','4','2' union + select '1','沙奎尔·奥尼尔','2001','4','1' union + select '1','沙奎尔·奥尼尔','2002','4','0' union + select '1','科比-布莱恩特','2008','4','1' union + select '1','科比-布莱恩特','2009','4','3' +go