From 3e7d573f60abdbb4d908ddd139193d21ef43e327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E8=B0=83?= <3084898776@qq.com> Date: Thu, 18 Jul 2024 20:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E8=80=831?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 38 ++ .idea/$PROJECT_FILE$ | 11 + .idea/.gitignore | 8 + .idea/encodings.xml | 8 + .idea/inspectionProfiles/Project_Default.xml | 5 + .idea/misc.xml | 33 ++ .idea/qaplug_profiles.xml | 465 +++++++++++++++++++ .idea/vcs.xml | 6 + pom.xml | 17 + src/main/java/com/bwie/Main.java | 7 + src/sql/sql语句.sql | 67 +++ src/sql/zhuangao6rk11.sql | 44 ++ 12 files changed, 709 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/$PROJECT_FILE$ create mode 100644 .idea/.gitignore create mode 100644 .idea/encodings.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/qaplug_profiles.xml create mode 100644 .idea/vcs.xml create mode 100644 pom.xml create mode 100644 src/main/java/com/bwie/Main.java create mode 100644 src/sql/sql语句.sql create mode 100644 src/sql/zhuangao6rk11.sql diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ff6309 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/$PROJECT_FILE$ b/.idea/$PROJECT_FILE$ new file mode 100644 index 0000000..58b7e3e --- /dev/null +++ b/.idea/$PROJECT_FILE$ @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..63574ec --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..8d66637 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b356895 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,33 @@ + + + + + + { + "isMigrated": true +} + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/qaplug_profiles.xml b/.idea/qaplug_profiles.xml new file mode 100644 index 0000000..3dfd21f --- /dev/null +++ b/.idea/qaplug_profiles.xml @@ -0,0 +1,465 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..9cf65ae --- /dev/null +++ b/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + com.bwie + day_01 + 1.0-SNAPSHOT + + + 17 + 17 + UTF-8 + + + diff --git a/src/main/java/com/bwie/Main.java b/src/main/java/com/bwie/Main.java new file mode 100644 index 0000000..1287888 --- /dev/null +++ b/src/main/java/com/bwie/Main.java @@ -0,0 +1,7 @@ +package com.bwie; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} \ No newline at end of file diff --git a/src/sql/sql语句.sql b/src/sql/sql语句.sql new file mode 100644 index 0000000..847e37e --- /dev/null +++ b/src/sql/sql语句.sql @@ -0,0 +1,67 @@ +-- #查询所有学生信息,并根据年龄进行降序排序 +SELECT +EID, +ENAME, +SEX, +TEL, +CLASSID, +AGE, +SAL +FROM student ORDER BY AGE DESC + +-- 显示姓王的学生的详细信息 +SELECT +EID, +ENAME, +SEX, +TEL, +CLASSID, +AGE, +SAL +FROM student WHERE ENAME LIKE '王%' + +-- #查询工资大于5000的所有男同学的信息 + +SELECT +EID, +ENAME, +SEX, +TEL, +CLASSID, +AGE, +SAL +FROM student WHERE SAL > 5000 AND SEX = '男' + +-- #查询班级编号为20的男同学的电话号码 + +SELECT TEL FROM student WHERE CLASSID = 20 AND SEX = '男' + +-- #查询最低工资 + +SELECT MIN(SAL) AS MINSAL FROM student + +-- #查询班级为30的学生的最小年龄 + +SELECT MIN(AGE) AS MINAGE FROM student WHERE CLASSID = 30 + +-- #查询女生的最低工资 + +SELECT MIN(SAL) AS WOMANMINSAL FROM student WHERE SEX = '女' + +-- #查询女学生中薪资最低的人的全部信息 + +SELECT +EID, +ENAME, +SEX, +TEL, +CLASSID, +AGE, +SAL +FROM student WHERE SEX = '女' AND SAL = (SELECT MIN(SAL) FROM student WHERE SEX = '女') + + + + + + diff --git a/src/sql/zhuangao6rk11.sql b/src/sql/zhuangao6rk11.sql new file mode 100644 index 0000000..b861bfa --- /dev/null +++ b/src/sql/zhuangao6rk11.sql @@ -0,0 +1,44 @@ +/* + Navicat Premium Data Transfer + + Source Server : 129.211.0.187 + Source Server Type : MySQL + Source Server Version : 50736 + Source Host : 129.211.0.187:3306 + Source Schema : zhuangao6rk11 + + Target Server Type : MySQL + Target Server Version : 50736 + File Encoding : 65001 + + Date: 18/07/2024 08:56:25 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for student +-- ---------------------------- +DROP TABLE IF EXISTS `student`; +CREATE TABLE `student` ( + `EID` int(11) NOT NULL AUTO_INCREMENT COMMENT '学生编号', + `ENAME` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '学生姓名', + `SEX` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '学生性别', + `TEL` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '学生电话', + `CLASSID` int(11) NULL DEFAULT NULL COMMENT '学生班级编号', + `AGE` int(11) NULL DEFAULT NULL COMMENT '学生年龄', + `SAL` decimal(10, 2) NULL DEFAULT NULL COMMENT '学生薪资', + PRIMARY KEY (`EID`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 10006 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '学生表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of student +-- ---------------------------- +INSERT INTO `student` VALUES (10001, '张三', '男', '123456789', 10, 20, 1000.00); +INSERT INTO `student` VALUES (10002, '李四', '女', '123456781', 20, 20, 1556.00); +INSERT INTO `student` VALUES (10003, '张依依', '男', '123456782', 30, 23, 8000.00); +INSERT INTO `student` VALUES (10004, '刘强', '男', '1234567890', 20, 20, 1245.00); +INSERT INTO `student` VALUES (10005, '王凯', '女', '456231789', 30, 20, 4563.00); + +SET FOREIGN_KEY_CHECKS = 1;