From c8596b4d4c5294b62b2b1feb0a52e2d3108ec524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=85=88=E6=9D=B0?= <19892226650@139.com> Date: Fri, 16 Sep 2022 05:00:10 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E5=BC=A0=E5=85=88?= =?UTF-8?q?=E6=9D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\274\240\345\205\210\346\235\260/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\345\274\240\345\205\210\346\235\260/.keep" diff --git "a/\345\274\240\345\205\210\346\235\260/.keep" "b/\345\274\240\345\205\210\346\235\260/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From 78b1618d52cdee3c4ac36634565690df0ddc410b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=85=88=E6=9D=B0?= <19892226650@139.com> Date: Fri, 16 Sep 2022 05:00:45 +0000 Subject: [PATCH 2/2] =?UTF-8?q?38=E5=BC=A0=E5=85=88=E6=9D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张先杰 <19892226650@139.com> --- .../SQLQuery1.sql" | 71 +++++++++++++++++++ .../\347\254\224\350\256\260.md" | 2 + 2 files changed, 73 insertions(+) create mode 100644 "\345\274\240\345\205\210\346\235\260/\345\274\240\345\205\210\346\235\260/SQLQuery1.sql" create mode 100644 "\345\274\240\345\205\210\346\235\260/\345\274\240\345\205\210\346\235\260/\347\254\224\350\256\260.md" diff --git "a/\345\274\240\345\205\210\346\235\260/\345\274\240\345\205\210\346\235\260/SQLQuery1.sql" "b/\345\274\240\345\205\210\346\235\260/\345\274\240\345\205\210\346\235\260/SQLQuery1.sql" new file mode 100644 index 0000000..e112875 --- /dev/null +++ "b/\345\274\240\345\205\210\346\235\260/\345\274\240\345\205\210\346\235\260/SQLQuery1.sql" @@ -0,0 +1,71 @@ +--ݿ DBTEST +if exists (select * from sys.databases where name = 'DBTEST') +drop database DBTEST +create database DBTEST; + + +--ϢsectionInfo +-- ű sectionID int ʶ +-- sectionName varchar(10) Ϊ + +create table sectionInfo( + sectionID int primary key identity(1,1), + sectionName varchar(10) not null +) + +insert sectionInfo values('з'); +insert sectionInfo values(''); +insert sectionInfo values(''); +insert sectionInfo values(''); +insert sectionInfo values('ƻ'); + +-- select * from sectionInfo; + +--ԱϢuserInfo +-- Ա userNo int ʶ Ϊ +-- Ա userName varchar(10) ΨһԼ Ϊ ȱ4 +-- ԱԱ userSex varchar(2) Ϊ ֻлŮ +-- Ա userAge int Ϊ Χ1-100֮ +-- Աַ userAddress varchar(50) ĬֵΪ +-- Ա userSection int òϢIJű + +--drop table userInfo; + +create table userInfo ( + userNo int identity(1,1) primary key not null, + userName varchar(10) unique not null check(len(userName) > 4), + userSex varchar(2) not null check(userSex = '' or userSex = 'Ů') , + userAge int not null check(userAge between 1 and 100), + userAddress varchar(50) default '', + userSection int references sectionInfo(sectionId) +); + +insert userInfo (userName,userSex,userAge,userAddress,userSection) +values ('123','','25','','1'), + ('123','Ů','30','Ϻ','2'), + ('123','Ů','36','Ϻ','3'), + ('123','Ů','40','','4'), + ('11223','Ů','27','','5'); +--select * from userInfo + +--ԱڱworkInfo +-- ڱ workId int ʶ Ϊ +-- Ա userId int ԱϢԱ Ϊ +-- ʱ workTime datetime Ϊ +-- ˵ workDescription varchar(40) Ϊ ֻǡٵˡ١¼١еһ + +create table workInfo( + workId int identity(1,1) primary key not null, + userId int references userInfo(userNo) not null, + workTime datetime not null, + workDescription varchar(40) not null check(workDescription = 'ٵ' or workDescription = '' or workDescription = '' or workDescription = '' or workDescription = '¼') +) +insert workInfo(userId,workTime,workDescription) +values (1,'2022-1-15 15:15:1','ٵ'), + (2,'2022-1-16 15:15:1',''), + (3,'2022-1-14 15:15:1',''), + (4,'2022-1-16 15:15:1',''), + (5,'2022-1-12 15:15:1','¼'); + + +--select * from workInfo \ No newline at end of file diff --git "a/\345\274\240\345\205\210\346\235\260/\345\274\240\345\205\210\346\235\260/\347\254\224\350\256\260.md" "b/\345\274\240\345\205\210\346\235\260/\345\274\240\345\205\210\346\235\260/\347\254\224\350\256\260.md" new file mode 100644 index 0000000..2584ad8 --- /dev/null +++ "b/\345\274\240\345\205\210\346\235\260/\345\274\240\345\205\210\346\235\260/\347\254\224\350\256\260.md" @@ -0,0 +1,2 @@ +哎嘿 + -- Gitee