master
lwj 2024-07-18 21:00:59 +08:00
commit fd7e3b228a
4 changed files with 133 additions and 0 deletions

35
.gitignore vendored 100644
View File

@ -0,0 +1,35 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea
*.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

36
chaxun.sql 100644
View File

@ -0,0 +1,36 @@
# 2.查询所有学生信息并根据年龄进行降序排序。10分
SELECT * FROM student ORDER BY age DESC
# 3.显示姓王的学生的详细信息。10分
SELECT * FROM student where INSTR(student.ename,'')
#4.查询工资大于5000的所有男同学的信息。10分
SELECT * FROM student where student.sal>5000 and student.sex=''
# 5.查询班级编号为20的男同学的电话号码。10分
SELECT student.tel FROM student WHERE student.classid=20
# 6.查询最低工资。10分
SELECT student.sal FROM student ORDER BY student.sal ASC LIMIT 1
# 7.查询班级为30的学生的最小年龄。10分
SELECT student.age FROM student WHERE student.classid=30 ORDER BY student.age ASC LIMIT 1
# 8.查询女生的最低工资。15分
SELECT student.sal FROM student WHERE student.sex='' ORDER BY student.sal ASC LIMIT 1
# 9.查询女学生中薪资最低的人的全部信息。15分
SELECT * FROM student WHERE student.sex='' ORDER BY student.sal ASC LIMIT 1

17
pom.xml 100644
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bwie</groupId>
<artifactId>rikao7_18</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

45
rikao7_18.sql 100644
View File

@ -0,0 +1,45 @@
/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 80037
Source Host : 127.0.0.1:3306
Source Schema : rikao7_18
Target Server Type : MySQL
Target Server Version : 80037
File Encoding : 65001
Date: 18/07/2024 08:55:50
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
`eid` int NOT NULL AUTO_INCREMENT,
`ename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`tel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`classid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`age` int NULL DEFAULT NULL,
`sal` decimal(10, 2) NULL DEFAULT NULL,
PRIMARY KEY (`eid`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of student
-- ----------------------------
INSERT INTO `student` VALUES (1, '张依依', '', '123456789', '10', 20, 1000.00);
INSERT INTO `student` VALUES (2, '刘小红', '', '123456789', '20', 20, 1556.00);
INSERT INTO `student` VALUES (3, '李四', '', '123456782', '30', 23, 4567.00);
INSERT INTO `student` VALUES (4, '刘强', '', '123456784', '20', 20, 5600.00);
INSERT INTO `student` VALUES (5, '王开', '', '123456786', '30', 25, 1200.00);
INSERT INTO `student` VALUES (6, '梅超风', '', '123456787', '10', 20, 5623.00);
SET FOREIGN_KEY_CHECKS = 1;