From eee60a372c1bb26a47e3cd89b2759f7fd728749e Mon Sep 17 00:00:00 2001 From: Stas Date: Thu, 1 Oct 2026 12:42:51 +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=20lesson0.sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lesson0.sql | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/lesson0.sql b/lesson0.sql index e6d0659..ea787cb 100644 --- a/lesson0.sql +++ b/lesson0.sql @@ -1,42 +1,42 @@ create table card ( - card_id int (primary key) - card_name text (not null) - card_stage text (not null) - card_hp int (not null, check) (card_hp > 0) - card_pokidex_number int (not null, check) (card_pokidex_number > 0) - card_species next (not null) - card_height_m numeric (not null, check) ( card_height_m > 0) - card_weight_kg numeric (not null, check) (card_weight_kg > 0) - card_number_in_set text (not null) - card_retrat_cost int (not null, check) (card_retrat_cost > 0) - card_release_year int (not null) - card_set_id int (not null) - card_ellement_type_id int (not null) - card_illustrator_id int (not null) + card_id int primary key + card_name text not null + card_stage text not null + card_hp int not null check (card_hp > 0) + card_pokidex_number int not null check (card_pokidex_number > 0) + card_species next not null + card_height_m numeric not null check (card_height_m > 0) + card_weight_kg numeric not null check (card_weight_kg > 0) + card_number_in_set text not null + card_retrat_cost int not null check (card_retrat_cost > 0) + card_release_year int not null + card_set_id int not null + card_ellement_type_id int not null + card_illustrator_id int not null ); create table card_set ( - card_set_id int (primary key, foreign key) - card_set_name text (not null) - card_set_code text (not null) - set_total_cards int (not null, check) (set_total_cards > 0) - set_release_date date (not null) + card_set_id int primary key foreign key + card_set_name text not null + card_set_code text not null + set_total_cards int not null check (set_total_cards > 0) + set_release_date date not null ); create table attack ( - attack_id int (primary key, foreign key) - attack_name text (not null) - attack_base_damage text (not null, check) (attack_base_damage > 0) + attack_id int primary key foreign key + attack_name text not null + attack_base_damage text not null, check (attack_base_damage > 0) attack_effect text - attack_card_id int (not null) + attack_card_id int not null ); create table element_type ( - element_type_id int (primary key, foreign key) - element_type_name text (not null) + element_type_id int primary key foreign key + element_type_name text not null ); create table illustrator ( - illustrator_id int (primary key, foreign key) - illustrator_name text (not null) + illustrator_id int primary key foreign key + illustrator_name text not null ); \ No newline at end of file