Repository navigation
Expand file tree
/
Copy pathinput.txt
More file actions
108 lines (100 loc) · 8.61 KB
/
Copy pathinput.txt
File metadata and controls
108 lines (100 loc) · 8.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
create table nazioni ( id int not null auto_increment , nome text not null , annotazioni text , primary key (id) );
create table studenti ( nome text not null , cognome text not null , id int not null auto_increment , matricola int not null , nazione int , nascita date , tempo time , media float , crediti int , primary key ( id ) , foreign key (nazione) references nazioni (id) );
insert into nazioni ( nome , annotazioni ) values ("italia" , "1000 posti disponibli" );
insert into nazioni ( nome , annotazioni ) values ("india" , "250 posti disponibli" );
insert into nazioni ( nome , annotazioni ) values ("cina" , "300 posti disponibli" );
insert into nazioni ( nome , annotazioni ) values ("spagna" , "200 posti disponibli" );
insert into nazioni ( nome , annotazioni ) values ("usa" , "100 posti disponibli" );
insert into nazioni ( nome , annotazioni ) values ("bangladesh" , "100 posti disponibli" );
insert into nazioni ( nome , annotazioni ) values ("romania" , "200 posti disponibli" );
insert into nazioni ( nome , annotazioni ) values ("francia" , "200 posti disponibli" );
insert into nazioni ( nome , annotazioni ) values ("australia" , "140 posti disponibli" );
insert into nazioni ( nome , annotazioni ) values ("messico" , "20 posti disponibli" );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "silvio" , "verdini" , 214359 , 7 , 09/10/1997 , 01.42.12 , 23.1 , 145 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "carlo" , "giannini" , 244329 , 1 , 22/01/1996 , 03.49.50 , 27.3 , 150 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "france" , "sassaiola" , 213359 , 7 , 05/11/1994 , 12.43.56 , 21.0 , 165 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "pablo" , "escobar" , 244322 , 9 , 09/12/1993 , 18.42.13 , 28.6 , 156 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "alessio" , "rossi" , 123359 , 1 , 12/06/1963 , 05.52.12 , 23.3 , 150 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "simon" , "jule" , 123424 , 8 , 23/04/1956 , 06.46.45 , 30.3 , 90 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "simone" , "scaboro" , 245759 , 1 , 21/11/1965 , 16.10.52 , 23.3 , 130 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "xian" , "wu" , 256655 , 3 , 30/10/1935 , 10.02.16 , 24.3 , 160 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "giulia" , "toffoli" , 265659 , 3 , 21/11/1956 , 11.00.45 , 18.5 , 170 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "giulio" , "geretto" , 235459 , 1 , 02/05/1965 , 07.45.00 , 30.6 , 45 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "giorgio" , "peretti" , 234349 , 4 , 08/04/1965 , 23.43.01 , 25.4 , 15 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "giulia" , "sandri" , 210002 , 5 , 09/05/1965 , 04.13.14 , 25.1 , 10 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "elisa" , "rosso" , 224556 , 5 , 05/01/1966 , 12.45.12 , 22.4 , 134 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "suami" , "ching" , 223444 , 6 , 06/03/1957 , 21.30.16 , 23.5 , 145 );
insert into studenti ( nome , cognome, matricola , nazione , nascita , tempo , media , crediti ) values ( "ahmed" , "elsaka" , 234533 , 6 , 16/03/1967 , 23.41.43 , 18.0 , 150 );
select * from nazioni;
select * from studenti;
select * from studenti order by media asc;
select * from studenti order by crediti desc;
select * from studenti where nome = "carlo";
select * from studenti where nome <> "carlo";
select * from studenti where nome >= "carlo";
select * from studenti where nazione >= 3;
select * from studenti where nascita > "03/12/1993";
select * from studenti where tempo < "18.00.00";
select * from studenti where media between 25 and 30;
select * from studenti order by cognome asc;
select * from studenti order by tempo desc;
select * from studenti order by nascita asc;
select * from studenti where nazione = 1 order by media desc;
select * from studenti where nazione >= 4 order by nome desc;
select * from studenti where matricola between 232422 and 243343 order by id asc;
select * from studenti where matricola between 232422 and 243343 order by tempo desc;
select * from studenti where nome like "%o";
select * from studenti where nome like "g%";
select * from studenti where not nome like "g%";
select * from studenti where cognome like "p%";
select * from studenti where cognome like "%i";
select * from studenti where nome like "%simo__";
select * from studenti where cognome like "%ross_";
select nome,cognome,media,id,matricola,tempo from studenti where nome = "silvio";
select nome,cognome,media,id,matricola,tempo from studenti where cognome <= "giannini";
select nome,cognome,media,id,nascita,tempo from studenti where nascita > "02/12/1994";
select nome,cognome,media,id,matricola,tempo from studenti where tempo <= "18.00.00";
select nome,cognome,media,id,matricola,tempo from studenti where media >= 23;
select nome,cognome,media,id,matricola,tempo from studenti where media < 27;
select nome,cognome,media,id,matricola,tempo from studenti order by nome asc;
select nome,cognome,media,id,matricola,tempo from studenti order by tempo asc;
select nome,cognome,media,id,nascita,tempo from studenti order by nascita desc;
select nome,cognome,media,id,matricola,crediti from studenti where crediti between 120 and 170;
select nome,cognome,media,id,matricola,nascita from studenti where nascita between "23/02/1990" and "23/02/2000";
select nome as n,cognome as c,media as m,id,matricola,tempo from studenti where cognome between "AAA" and "GGGH";
select nome,cognome,media,id,matricola,tempo from studenti where nazione <= 3 order by media asc;
select nome,cognome,media,id,matricola,crediti from studenti where media between 18 and 27 order by crediti desc;
select nome,cognome,media,id,matricola,crediti from studenti where crediti between 10 and 120 order by cognome asc;
select nome,cognome,media,id,matricola,tempo from studenti where media > 18 and media < 22 or nome = "carlo" or cognome = "verdini";
select nome,cognome,media,id,matricola,crediti from studenti where crediti > 120 and media > 24 or nome = "giulia" or cognome = "verdini";
select nome,cognome,media,id,crediti,tempo,nascita from studenti where nascita < "12/02/1994" and tempo <= "18.00.00" or nome = "elisa" or crediti > 160;
select nome,cognome,media,id,crediti,tempo,nascita from studenti where nascita < "12/02/1994" and tempo <= "18.00.00" or nome = "elisa" or not crediti > 160;
select nome,cognome,media,id,crediti,tempo,nascita from studenti where nascita < "12/02/1994" and not tempo <= "18.00.00" or nome = "elisa" or crediti > 160;
select nome,cognome,media,id,matricola,tempo from studenti where nome = "silvio" or cognome = "giannini";
select nome,cognome,media,id,matricola,tempo,nazione from studenti where media > 18 and nazione = 3 or nazione = 4 or nazione = 7 and media > 23;
select nome,cognome,media,id,matricola,tempo from studenti where matricola > 117221 and matricola < 250000 or media > 30 or media = 18;
select * from studenti order by nome asc;
update studenti set media = 28 where nome = "giulia";
select * from studenti where nome = "Giulia";
update studenti set nascita = 12/02/1000 where media > 26;
select * from studenti where media > 26;
update studenti set tempo = 13.43.12 where crediti >= 170;
select * from studenti where crediti >= 170;
update studenti set crediti = 180 , nazione = 1 where tempo > 21.00.00;
select * from studenti where tempo > "21.00.00";
update studenti set nascita = 12/02/1200 , nazione = 3 where tempo >= 22.00.00;
select * from studenti where tempo >= "22.00.00";
delete from studenti where nome = "giorgio";
select * from studenti;
delete from studenti where id >= 14;
select * from studenti;
delete from studenti where crediti >= 10 and crediti < 50 or media > 30;
select * from studenti;
delete from studenti where tempo > 10.00.00 and tempo < 14.00.00 or cognome = "Escobar";
select * from studenti;
delete from studenti where nascita > 22/12/1960 and nascita < 10/03/1970;
select * from studenti;
truncate table studenti;
select * from studenti;
drop table studenti;
quit;