master
Cui YongXing 2024-07-18 21:19:12 +08:00
commit caf525b13f
4 changed files with 97 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

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>day01</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

38
sql/day01.sql 100644
View File

@ -0,0 +1,38 @@
create table t_stu(
sid int PRIMARY KEY auto_increment,
sname VARCHAR(20),
sex VARCHAR(2),
tel VARCHAR(13),
class_id int ,
age int ,
sal decimal(10,2)
);
INSERT INTO t_stu(sname,sex,tel,class_id,age,sal) VALUES
('张三','','12345678901',10,20,1000.00),
('李四','','12345678902',10,22,5000.00),
('王五','','12345678903',20,23,3120.00),
('赵柳','','12345678904',20,23,1353.00),
('王启','','12345678905',30,21,15123.00),
('王浩','','12345678905',30,22,5123.00),
('志伟','','12345678905',30,20,7241.00);
SELECT * FROM t_stu ORDER BY age desc;
SELECT * FROM t_stu WHERE sname LIKE '王%';
SELECT * FROM t_stu WHERE sal>5000 and sex='';
SELECT tel FROM t_stu WHERE class_id=20 and sex = '';
SELECT MIN(sal) FROM t_stu ;
SELECT MIN(age) FROM t_stu WHERE class_id = 30;
SELECT MIN(sal) FROM t_stu WHERE sex='';
SELECT * FROM t_stu WHERE sid = (SELECT sid FROM
t_stu WHERE sex='' ORDER BY sal asc LIMIT 1)

View File

@ -0,0 +1,7 @@
package com.bwie;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}