From 8f4748e2f4a037d2f0f39da1ffd495fbfe911e67 Mon Sep 17 00:00:00 2001 From: Stas Date: Thu, 1 Oct 2026 07:30:13 +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 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lesson2.sql b/lesson2.sql index 280f7d5..70fc88a 100644 --- a/lesson2.sql +++ b/lesson2.sql @@ -1,4 +1,4 @@ -create table card ( +CREATE TABLE card ( card_id int [primary key] card_name text [not null, unique] card_hp int [not null] @@ -6,36 +6,36 @@ create table card ( card_illustrator_id int [not null] ); -create table illustrator ( - illustrator_id int [primary key] - illustrator_name text [not null] +CREATE TABLE illustrator ( + illustrator_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, + illustrator_name TEXT NOT NULL ); -create table card_set ( +CREATE TABLE card_set ( card_set_id int [primary key] card_set_name text [not null, unique] card_set_code text [not null, unique] card_set_release_date date [not null] ); -create table card_attack ( +CREATE TABLE card_attack ( card_attack_id int [primary key] card_id int [not null] attack_id int [not null] ); -create table attack ( +CREATE TABLE attack ( attack_id int [primary key] attack_name text [not null] attack_base_damage int [not null] ); -create table element_type ( - element_id int [primary key] - element_name text [not null, unique] +CREATE TABLE element_type ( + element_type_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, + element_type_name TEXT NOT NULL UNIQUE ); -create table attack_energy_cost ( +CREATE TABLE attack_energy_cost ( attack_energy_cost_id int [primary key] attack_id int [not null] element_type_id int [not null]