diff --git a/Readme.md b/Readme.md index a7bdb7c..29f9a64 100644 --- a/Readme.md +++ b/Readme.md @@ -4,3 +4,4 @@ ## Список работ * [Лабораторная работа №1](./works/lab-01) +* [Лабораторная работа №2](./works/lab-02) \ No newline at end of file diff --git a/works/lab-01/lesson1_result_07.09_1st_class.txt b/works/lab-01/lesson1_result_07.09_1st_class.md similarity index 99% rename from works/lab-01/lesson1_result_07.09_1st_class.txt rename to works/lab-01/lesson1_result_07.09_1st_class.md index 6c097ff..22af93c 100644 --- a/works/lab-01/lesson1_result_07.09_1st_class.txt +++ b/works/lab-01/lesson1_result_07.09_1st_class.md @@ -1,3 +1,4 @@ +```csharp Table card { card_id integer [primary key, not null, unique] card_name text [not null] diff --git a/works/lab-01/lesson1_result_07.09_2nd_class.txt b/works/lab-01/lesson1_result_07.09_2nd_class.txt deleted file mode 100644 index e69de29..0000000 diff --git a/works/lab-02/Readme.md b/works/lab-02/Readme.md new file mode 100644 index 0000000..982ced7 --- /dev/null +++ b/works/lab-02/Readme.md @@ -0,0 +1,74 @@ +# Лабораторная работа №2 + +* **Студент:** Закиров Алим Альбертович +* **Вариант / Карточка:** Проектирование связей "Многие-ко-Многим" + +--- + +## Ключевой код +```csharp +Table card { + card_id integer [primary key, not null, unique] + card_name text [not null] + card_stage text [not null] + card_hp integer [not null, check: `card_hp > 0`] + card_num_in_pokedex integer [not null] + card_type text [not null] + card_height integer [not null, check: `card_height > 0`] + card_weight integer [not null, check: `card_weight > 0`] + card_retreat_cost integer [not null, check: `card_retreat_cost >= 0`] + card_release_date date [not null] + card_set_id integer [not null] + attack_id integer [not null] + element_type_id integer [not null] + illustrator_id integer [not null] +} + + +Table card_set { + card_set_id integer [primary key, not null, unique] + card_set_name text [not null] + card_set_total_quantity integer [not null, check: `card_set_total_quantity > 0`] + card_set_release_date date [not null] +} + +Table attack { + attack_id integer [primary key, not null, unique] + attack_name text [not null] + attack_base_damage integer [not null, check: `attack_base_damage >= 0`] + attack_damage_modifier text + attack_effect text +} + +Table element_type { + element_type_id integer [primary key, not null, unique] + element_type_name text [not null] +} + +Table illustrator { + illustrator_id integer [primary key, not null, unique] + illustrator_name text [not null] +} + +Table attack_card { + attack_card_id int [pk, not null, unique] + card_id int [not null] + attack_id int [not null] +} + +Table attack_card_prining { + attack_card_prining_id int [pk, not null, unique] + attack_card_prining_cost int [not null, check: `attack_card_pricing_cost >= 0`] + attack_card_id int [not null] + element_type_id int [not null] +} + + +Ref: card_set.card_set_id < card.card_set_id +Ref: attack.attack_id < card.attack_id +Ref: element_type.element_type_id < card.element_type_id +Ref: illustrator.illustrator_id < card.illustrator_id +Ref: card.card_id > attack_card.card_id +Ref: attack.attack_id > attack_card.attack_id +Ref: attack_card_prining.attack_card_id < attack_card.attack_card_id +Ref: element_type.element_type_id < attack_card_prining.element_type_id \ No newline at end of file