From d25ef7f951794a0d784708e9a9daffa3e1246e8d Mon Sep 17 00:00:00 2001 From: Stas Date: Tue, 22 Sep 2026 13:55:38 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20lesson2.sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lesson2.sql | 62 +++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/lesson2.sql b/lesson2.sql index 87f73bd..fed31ad 100644 --- a/lesson2.sql +++ b/lesson2.sql @@ -1,43 +1,39 @@ Table illustrator { - -illustrator_id int [pk, increment, unique, note: 'CHECK (illustrator_id > 0)'] illustrator name text [not null, unique] + illustrator_id int [pk, increment, unique, note: 'CHECK (illustrator_id > 0)'] + illustrator name text [not null, unique] +} Table element_type { - -element_type_id int [pk, increment, unique, note: 'CHECK (element_type_id > 0)'] element_type_name text [not null, unique] + element_type_id int [pk, increment, unique, note: 'CHECK (element_type_id > 0)'] + element_type_name text [not null, unique] +} Table card set { - -set_id int [pk, increment, unique, note: 'CHECK (set_id > 0)'] - -set_name text [not null, unique] - -set_code text [not null, unique] - -set_total_cards int [not null, note: 'CHECK (set_total_cards > @)'] + set_id int [pk, increment, unique, note: 'CHECK (set_id > 0)'] + set_name text [not null, unique] + set_code text [not null, unique] + set_total_cards int [not null, note: 'CHECK (set_total_cards > @)'] +} Table card { - -card_id int [pk, increment, unique, note: 'CHECK (card_id > 0)'] - -card_name text [not null] - -card_hp int [not null] - -card_number text [not null, note: 'CHECK (card_number > 0)'] - -card_illustrator_id int [not null] - -card_element_type_id int [not null] - -card_set_id int [not null] + card_id int [pk, increment, unique, note: 'CHECK (card_id > 0)'] + card_name text [not null] + card_hp int [not null] + card_number text [not null, note: 'CHECK (card_number > 0)'] + card_illustrator_id int [not null] + card_element_type_id int [not null] + card_set_id int [not null] +} Table attack { + attack_id int [pk, increment, note: 'CHECK (attack_id > 0)'] + attack_name text [not null] + attack_base_damage int [not null, note: 'CHECK (attack_base_damage >= 0)'] + attack_damage_modifier text [note: 'CHECK (attack_damage_modifier in ["+", "x"])'] + attack card id int [not null] +} -attack_id int [pk, increment, note: 'CHECK (attack_id > 0)'] - -attack_name text [not null] - -attack_base_damage int [not null, note: 'CHECK (attack_base_damage >= 0)'] attack_damage_modifier text [note: 'CHECK (attack_damage_modifier in ["+", "x"])'] attack card id int [not null] - -Ref: card.card illustrator_id > illustrator.illustrator id Ref: card.card_element_type_id > element_type.element type id Ref: card.card_set_id > card_set.set_id Ref: attack.attack_card_id > card.card_id \ No newline at end of file +Ref: card.card illustrator_id > illustrator.illustrator id +Ref: card.card_element_type_id > element_type.element type id +Ref: card.card_set_id > card_set.set_id +Ref: attack.attack_card_id > card.card_id \ No newline at end of file