Compare commits
No commits in common. "main" and "SQL_Extended" have entirely different histories.
main
...
SQL_Extend
26
.gitignore
vendored
26
.gitignore
vendored
@ -1,26 +0,0 @@
|
||||
# ---> Java
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
replay_pid*
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
import animals.Kotik;
|
||||
|
||||
public class Application {
|
||||
public static void main(String[] args) {
|
||||
Kotik firstKot = new Kotik("Petr", "hi", 10, 5);
|
||||
Kotik secondKot = new Kotik();
|
||||
secondKot.setName("Barsik");
|
||||
secondKot.setVoice("hello");
|
||||
secondKot.setSatiety(5);
|
||||
secondKot.setWeight(3);
|
||||
for(String str : firstKot.liveAnotherDay()){
|
||||
System.out.println(str);
|
||||
}
|
||||
System.out.println(secondKot.getName());
|
||||
System.out.println(secondKot.getWeight());
|
||||
System.out.println(Application.compareVoice(firstKot, secondKot));
|
||||
System.out.println(Kotik.getCount());
|
||||
}
|
||||
|
||||
public static boolean compareVoice(Kotik firstKot, Kotik secondKot){
|
||||
return firstKot.getVoice().equals(secondKot.getVoice());
|
||||
}
|
||||
}
|
||||
@ -1,182 +0,0 @@
|
||||
package animals;
|
||||
|
||||
public class Kotik {
|
||||
|
||||
private static final int METHODS = 5;
|
||||
|
||||
private static int count = 0;
|
||||
|
||||
private String name;
|
||||
private String voice;
|
||||
private int satiety;
|
||||
private int weight;
|
||||
|
||||
public Kotik(String name, String voice, int satiety, int weight) {
|
||||
this.name = name;
|
||||
this.voice = voice;
|
||||
this.satiety = satiety;
|
||||
this.weight = weight;
|
||||
count++;
|
||||
}
|
||||
|
||||
public Kotik() {
|
||||
count++;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getVoice() {
|
||||
return voice;
|
||||
}
|
||||
|
||||
public void setVoice(String voice) {
|
||||
this.voice = voice;
|
||||
}
|
||||
|
||||
public int getSatiety() {
|
||||
return satiety;
|
||||
}
|
||||
|
||||
public void setSatiety(int satiety) {
|
||||
this.satiety = satiety;
|
||||
}
|
||||
|
||||
public int getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(int weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public static int getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void eat(int units) {
|
||||
System.out.println("Kotik is eating");
|
||||
this.satiety += units;
|
||||
}
|
||||
|
||||
public void eat(int units, String food) {
|
||||
System.out.println("Kotik is eating " + food);
|
||||
this.satiety += units;
|
||||
}
|
||||
|
||||
public void eat() {
|
||||
eat(2, "fish");
|
||||
}
|
||||
|
||||
public boolean play() {
|
||||
if (satiety > 0) {
|
||||
System.out.println("Kotik is playing");
|
||||
satiety--;
|
||||
return true;
|
||||
} else {
|
||||
System.out.println("kotik wanna eat");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean sleep() {
|
||||
if (satiety > 0) {
|
||||
System.out.println("Kotik is sleeping");
|
||||
satiety--;
|
||||
return true;
|
||||
} else {
|
||||
System.out.println("kotik wanna eat");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean wash() {
|
||||
if (satiety > 0) {
|
||||
System.out.println("Kotik is washing");
|
||||
satiety--;
|
||||
return true;
|
||||
} else {
|
||||
System.out.println("kotik wanna eat");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean walk() {
|
||||
if (satiety > 0) {
|
||||
System.out.println("Kotik is walking");
|
||||
satiety--;
|
||||
return true;
|
||||
} else {
|
||||
System.out.println("kotik wanna eat");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hunt() {
|
||||
if (satiety > 0) {
|
||||
System.out.println("Kotik is hunting");
|
||||
satiety--;
|
||||
return true;
|
||||
} else {
|
||||
System.out.println("kotik wanna eat");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public String[] liveAnotherDay() {
|
||||
String[] kotikToDoList = new String[24];
|
||||
for (int i = 0; i < 24; i++) {
|
||||
switch ((int) (Math.random() * METHODS) + 1) {
|
||||
case (1):
|
||||
if (play())
|
||||
kotikToDoList[i] =(i + " - play");
|
||||
else {
|
||||
eat();
|
||||
kotikToDoList[i] =(i + " - eat");
|
||||
}
|
||||
break;
|
||||
case (2):
|
||||
if (sleep())
|
||||
kotikToDoList[i] =(i + " - sleep");
|
||||
else {
|
||||
eat();
|
||||
kotikToDoList[i] =(i + " - eat");
|
||||
}
|
||||
break;
|
||||
case (3):
|
||||
if (wash())
|
||||
kotikToDoList[i] =(i + " - wash");
|
||||
else {
|
||||
eat();
|
||||
kotikToDoList[i] =(i + " - eat");
|
||||
}
|
||||
break;
|
||||
case (4):
|
||||
if (walk())
|
||||
kotikToDoList[i] =(i + " - walk");
|
||||
else {
|
||||
eat();
|
||||
kotikToDoList[i] =(i + " - eat");
|
||||
}
|
||||
break;
|
||||
case (5):
|
||||
if (hunt())
|
||||
kotikToDoList[i] =(i + " - hunt");
|
||||
else {
|
||||
eat();
|
||||
kotikToDoList[i] =(i + " - eat");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
System.out.println("something wrong");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return kotikToDoList;
|
||||
}
|
||||
}
|
||||
8
src/main/resources/sql-extended.properties
Normal file
8
src/main/resources/sql-extended.properties
Normal file
@ -0,0 +1,8 @@
|
||||
task1=select count(*) from boarding_passes
|
||||
task2=select COUNT(DISTINCT ticket_no) FROM boarding_passes WHERE seat_no = '17E'
|
||||
task3=select MAX(amount),MIN(amount),AVG(amount) from ticket_flights
|
||||
task4=select passenger_name from tickets where passenger_id like '8099%43' and book_ref like 'B%'
|
||||
task5=select count(*) from flights where aircraft_code = (SELECT aircraft_code from aircrafts_data WHERE model like 'Cessna 208 Caravan' )
|
||||
task6=Select airports_data.airport_name,airports_data.city, flight_id, flight_no from flights join airports_data on flights.departure_airport = airports_data.airport_code where flight_no = 'PG0305' and scheduled_departure = '2017-09-09 09:10:00'
|
||||
task7=select distinct aircrafts_data.model from flights join aircrafts_data on flights.aircraft_code = aircrafts_data.aircraft_code where flight_no = 'PG0210'
|
||||
task8=SELECT CONCAT(first_name,' ',last_name) AS FI FROM employees WHERE first_name ILIKE 'Anna' UNION SELECT passenger_name AS FI FROM tickets WHERE passenger_name ILIKE 'Anna%';
|
||||
@ -1,3 +0,0 @@
|
||||
task1= INSERT INTO helpdesk_ticket (title, created, modified, submitter_email, status, on_hold, description, priority, queue_id, secret_key) VALUES ('Ticket for test', CAST('2026-01-19' AS DATE), CAST('2026-01-20' AS DATE), 'some@mail.ru', 2, TRUE, 'test ticket for sql', 1, 1, 1);
|
||||
task2= update helpdesk_ticket set submitter_email = 'ticketchange@mail.ru' where %s = 77
|
||||
task3=delete from helpdesk_ticket where %s = 77
|
||||
Loading…
Reference in New Issue
Block a user