-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathechipa.sql
109 lines (89 loc) · 3.28 KB
/
echipa.sql
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
109
CREATE DATABASE proiecttw
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'ro-RO-x-icu'
LC_CTYPE = 'ro-RO'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
CREATE USER andrei with encrypted password 'andrei';
GRANT ALL PRIVILEGES ON DATABASE proiectTW TO andrei;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO andrei;
CREATE TYPE tip_compartiment AS ENUM('gramada', 'troacar');
create type tip_pozitie as enum('linia 1', 'linia 2', 'linia 3', 'demi', 'uvertura', 'centru', 'aripa', 'fundas');
create table if not exists jucatori (
id serial primary key,
nume varchar(50) unique NOT NULL,
descriere text,
compartiment tip_compartiment default 'gramada',
pozitie tip_pozitie default 'linia 3',
inaltime numeric(8,2),
greutate int,
data_nasterii timestamp default current_timestamp,
foste_echipe varchar[],
statut_JS boolean default false,
poza varchar(100)
);
insert into jucatori(nume,descriere,compartiment,pozitie,inaltime,greutate,foste_echipe,statut_JS,poza) values
('Budeanu', 'Tanc rusesc', 'gramada', 'linia 1', 1.8, 120, null, False,'budeanu.jpg'),
('Chitic', 'Animal feroce', 'gramada', 'linia 1', 1.8, 110, '{"Metrorex"}', False,'chitic.jpg'),
('Ailincai', 'Nu te pune cu moldoveanul', 'gramada', 'linia 1', 1.75, 126, null, False,'ailincai.jpg'),
('Antonescu', 'Spaidarman', 'gramada', 'linia 2', 1.95, 90, '{"Metrorex"}', True,'antonescu.jpg'),
('Podoleanu', 'Podo nebunul', 'gramada', 'linia 2', 1.89, 100, null, False,'podoleanu.jpg'),
('Mercone', 'Chelutu', 'gramada', 'linia 3', 1.7, 84, '{"Golescu"}', True,'rmercone.jpg'),
('Glavan', 'Sageata albastra', 'gramada', 'linia 3', 1.85, 94, '{"Golescu"}', True,'glavan.jpg'),
('Ispas', 'Il Capitano', 'gramada', 'linia 3', 1.9, 100, '{"Steaua"}', False,'ispas.jpg'),
('Homiuc', 'Omi cel viteaz', 'troacar', 'demi', 1.77, 74, '{"Tomitanii","Steaua"}', False,'homiuc.jpg'),
('Patrascu', 'Talent pur sange', 'troacar', 'uvertura', 1.7, 84, '{"Tomitanii","Steaua"}', False,'patrascu.jpg'),
('Turcu', 'Bestia din Pantelimon', 'troacar', 'aripa', 1.8, 94, null, False,'turcu.jpg'),
('Cotoc', 'Bestia din Joita', 'troacar', 'centru', 1.8, 94, null, False,'cotoc.jpgc'),
('Preda', 'Batran dar bun', 'troacar', 'centru', 1.8, 85, null, False,'preda.jpg'),
('Mircea Silviu', 'Gazela 1', 'troacar', 'aripa', 1.75, 78, null, False,'mircea.jpg'),
('Mircea Alex', 'Gazela 2', 'troacar', 'fundas', 1.75, 78, null, False,'mircea.jpg');
alter table jucatori
add column tara varchar(50);
update jucatori
set tara='Romania'
where id='1';
update jucatori
set tara='Romania'
where id='2';
update jucatori
set tara='Romania'
where id='3';
update jucatori
set tara='Anglia'
where id='4';
update jucatori
set tara='Franta'
where id='5';
update jucatori
set tara='Franta'
where id='6';
update jucatori
set tara='Franta'
where id='7';
update jucatori
set tara='Anglia'
where id='8';
update jucatori
set tara='Africa de Sud'
where id='9';
update jucatori
set tara='Africa de Sud'
where id='10';
update jucatori
set tara='Romania'
where id='11';
update jucatori
set tara='Romania'
where id='12';
update jucatori
set tara='Romania'
where id='13';
update jucatori
set tara='Romania'
where id='14';
update jucatori
set tara='Romania'
where id='15';