Обновить works/sqllab1

This commit is contained in:
2026-09-09 12:45:04 +00:00
parent 3111cabd36
commit 4122ab58f6
+107 -48
View File
@@ -1,74 +1,133 @@
table card { Table card {
card_id int [pk,not null]
card_name text [not null] card_name text [not null]
card_hp int [not null, check: `card_hp > 0`] card_rarity text
card_rarity text [null]
card_id int [pk, increment]
card_number text [not null] card_number text [not null]
card_artist text [null] card_artist text
card_release_date date [null] card_release_date date
card_inge_url text [null] card_image_url text
illustrator_id text [not null, ref: > illustrator.illustrator_id]
card_set_id int [not null, ref: > card_set.card_set_id] card_set_id int [not null, ref: > card_set.card_set_id]
illustrator_id int [not null, ref: > illustrator.illustrator_id]
card_pokemon_id int [not null, ref: > card_pokemon.card_pokemon_id]
attack_energy_cost_id int [not null, ref: > attack_energy_cost.attack_energy_cost_id]
energy_type_id int [not null, ref: > energy_type.element_type_id]
coach_id int [not null, ref: > coach.coach_id]
} }
table card_set { Table card_pokemon {
set_name text [not null, unique] card_pokemon_id int [pk, not null]
set_relaced_date date [null] card_pokemon_hp int [not null, check: `card_hp > 0`]
set_code int [not null, unique] card_pokemon_hieght numeric
set_total_cards int [null, check: `set_total_cards > 0` ] card_pokemon_weight numeric
card_set_id int [not null, increment] card_pokemon_name text [not null]
card_card_id int [pk, not null]
card_pokemon_stage text [not null]
card_pokemon_evloves_from text
card_pokemon_category text
entrgy_type_id int [not null, ref: > energy_type.energy_type_id]
attack_energy_cost_id int [not null, ref: > attack_energy_cost.attack_energy_cost_id]
attack_id int [not null, ref: > attack.attack_id]
coach_id int [not null, ref: > coach.coach_id]
} }
table pockemon {
pockemon_name text [not null]
pockemon_id int [pk, increment]
pockemon_hp int [not null, check: `pockemon_hp > 0`]
pockemon_release_date date [null]
pockemon_inge_url text [null]
pockemon_base_attack int [null, check: `pockemon_base_attack > 0`]
Table card_set {
card_set_id int [pk, not null]
card_set_releaced_date date
card_set_name text [not null, unique]
card_set_code int [not null, unique]
card_set_total_cards int [not null, unique]
card_set_series text [not null]
card_set_logo_url text [not null]
card_set_symbol_url text [not null]
} }
table attack {
Table attack {
attack_id int [pk, not null]
attack_name text [not null] attack_name text [not null]
attack_base_damage int [null, check: `attack_base_damge >= 0`] attack_base_damage text [null, check: `attack_base_damege >= 0`]
attack_id int [pk, increment] attack_effect text
attack_decription text [null] attack_retreat_cost int [null, check: `attack_retreat_cost >= 0`]
attack_retreat_cost int [null, check: `attack_retreat_cost >=0`]
} }
table element_type { Table card_attack {
card_attack_id int [pk]
card_id int [not null, ref: > card.card_id]
attack_id int [not null, ref: > attack.attack_id]
card_attack_position int [null, check: `card_attack_position > 0`]
}
Table energy_type {
energy_quantily text [null]
element_type_id int [ pk, not null]
element_type_name text [not null, unique] element_type_name text [not null, unique]
element_type_id int [pk, increment] energy_type_id int [not null, pk]
element_type_symbol text [null] energy_type_name text [not null, unique]
} }
table illustrator { Table illustrator {
illustrator_name text [not null, unique] illustrator_name text [not null, unique]
illustrator_id int [pk, increment] illustrator_id int [primary key, not null]
illustrator_nationality text [null] illustrator_nationality text [null]
illustrator_website text [null] illustrator_natinality twxt [null]
} }
table card_attack { Table attack_energy_cost {
card_id int [not null, ref: > card.card_id ] attack_energy_cost_id int [pk]
card_attack_id int [pk, increment] attack_id int [not null]
attack_id int [not null, ref: > attack.attack_id] element_type_id int [not null]
card_attack_position int [not null, check: `card_attack_position > 0`]
} }
table attack_energy_cost { Table coach {
attack_energy_cost_id int [pk, increment] coach_id int [primary key, not null]
attack_id int [not null, ref: > attack.attack_id] coach_name text [not null, unique]
element_type_id int [not null, ref: >element_type.element_type_id] coach_type int [not null]
energy_quality int [not null, check: `energy_quality > 0`] coach_releaced_date date [not null]
coach_skill text [not null]
coach_description text [not null]
coach_rarity text [not null]
coach_image_url text [not null]
} }
Table pockemon_sub_type {
pockemon_sub_type_id int [pk, not null]
pockemon_sub_type_name text [not null, unique]
pockemon_sub_type_default_prize_count int [not null]
pockemon_sub_type_global_rule_text text [not null]
}
Table ability_type {
ability_type_id int [pk, not null]
ability_type_name text [not null, unique]
}
Ref: "pockemon"."pockemon_id" <? "card"."card_id" Table attack_name {
attack_name_id int [pk, not null]
attack_name_title text [not null, unique]
}
Ref: "pockemon"."pockemon_id" <? "pockemon"."pockemon_name" Table coach_printed_type {
Ref: "attack"."attack_base_damage"<?"pockemon"."pockemon_base_attack" printed_type_id int [not null, pk]
Ref: "attack"."attack_retreat_cost"<?"pockemon"."pockemon_base_attack" printed_type_name text [not null, unique]
Ref: "card"."card_name" <> "pockemon"."pockemon_name" }
Ref: "card"."card_hp" <> "pockemon"."pockemon_hp" Table game_mechanic {
mechanic_id int [not null, pk]
mechanic_name text [not null, unique]
}
Table pockemon_species {
species_pockemon_number int [not null, pk]
species_eng_name text [not null, unique]
species_generation int [not null]
species_height_m float [not null]
species_weight_kg float [not null]
}
Table pokedex_entry {
entry_id int [not null, pk]
entry_pokedex_number int [not null]
entry_source_game text [not null]
entry_description text [not null]
}
Table