Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
1
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
CREATE TABLE `players` ( `id_player` INT NOT NULL AUTO_INCREMENT, `login` varchar(255) NOT NULL UNIQUE, `password` INT NOT NULL, `email` varchar(255) NOT NULL UNIQUE, `data_register` DATE NOT NULL, `last_ip` INT NOT NULL, `level_account` INT NOT NULL, `last_connect` DATE NOT NULL, `id_banned` BOOLEAN NOT NULL, `ban_reason` varchar(255) NOT NULL, PRIMARY KEY (`id_player`) ); CREATE TABLE `characters` ( `id_character` INT NOT NULL AUTO_INCREMENT, `id_player` INT NOT NULL, `name_character` varchar(255) NOT NULL UNIQUE, `creation_date` DATE NOT NULL, `level` INT NOT NULL, `appearance` INT NOT NULL, `hair_style` INT NOT NULL, `hair_color` INT NOT NULL, `sex` INT NOT NULL, `exp` INT NOT NULL, `karma` INT NOT NULL, `count_pvp` INT NOT NULL, `gold` INT NOT NULL, `donate_currency` INT NOT NULL, `id_clan` INT NOT NULL, `id_stats` INT NOT NULL, PRIMARY KEY (`id_character`) ); CREATE TABLE `items_character` ( `id_item` INT NOT NULL AUTO_INCREMENT, `id_player` INT NOT NULL, `id_character` INT NOT NULL, `item_name` varchar(255) NOT NULL, `item_class` INT NOT NULL, `id_item_type` INT NOT NULL, `weight` INT NOT NULL, `storeroom` INT NOT NULL, `inventory` INT NOT NULL, `price` INT NOT NULL, `quantity` INT NOT NULL, PRIMARY KEY (`id_item`) ); CREATE TABLE `item_history` ( `id_action` DATE NOT NULL AUTO_INCREMENT, `date` DATE NOT NULL, `id_player` INT NOT NULL, `id_item` INT NOT NULL, `id_character` INT NOT NULL, `item_class` INT NOT NULL, `quantity` INT NOT NULL, `name_sender` INT NOT NULL, `player_sender` INT NOT NULL, `name_receiver` INT NOT NULL, `player_receiver` INT NOT NULL, `goal` varchar(255) NOT NULL, PRIMARY KEY (`id_action`) ); CREATE TABLE `payments` ( `id_payment` INT NOT NULL AUTO_INCREMENT, `payment_name` varchar(255) NOT NULL, `id_character` INT NOT NULL, `id_player` INT NOT NULL, `price` INT NOT NULL, `donate_currency` INT NOT NULL, `date` DATE NOT NULL, `time` TIME NOT NULL, PRIMARY KEY (`id_payment`) ); CREATE TABLE `action_records` ( `id_action` INT NOT NULL AUTO_INCREMENT, `id_player` INT NOT NULL, `id_character` INT NOT NULL, `date` DATE NOT NULL, `x` INT NOT NULL, `y` INT NOT NULL, `z` INT NOT NULL, `id_item` INT NOT NULL, PRIMARY KEY (`id_action`) ); CREATE TABLE `item_type` ( `id_item_type` INT NOT NULL AUTO_INCREMENT, `is_equipment` BOOLEAN NOT NULL, `strength` INT NOT NULL, `agility` INT NOT NULL, `Intelligence` INT NOT NULL, `atack` INT NOT NULL, `attack` INT NOT NULL, `hp` INT NOT NULL, `mp` INT NOT NULL, PRIMARY KEY (`id_item_type`) ); CREATE TABLE `stats` ( `id_stats` INT NOT NULL AUTO_INCREMENT, `hp` INT NOT NULL, `current_mp` INT NOT NULL AUTO_INCREMENT, `mp` INT NOT NULL AUTO_INCREMENT, `current_hp` INT NOT NULL AUTO_INCREMENT, `attack` INT NOT NULL AUTO_INCREMENT, `strength` INT NOT NULL AUTO_INCREMENT, `agility` INT NOT NULL AUTO_INCREMENT, `intelligence` INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id_stats`) ); CREATE TABLE `clans` ( `id_clan` INT NOT NULL AUTO_INCREMENT, `clan_name` varchar(255) NOT NULL AUTO_INCREMENT, `clan_level` INT NOT NULL, `members_limit` INT NOT NULL, `members` INT NOT NULL, `reputation` INT NOT NULL, PRIMARY KEY (`id_clan`) ); ALTER TABLE `characters` ADD CONSTRAINT `characters_fk0` FOREIGN KEY (`id_player`) REFERENCES `players`(`id_player`); ALTER TABLE `characters` ADD CONSTRAINT `characters_fk1` FOREIGN KEY (`count_pvp`) REFERENCES `rating_characters`(`rating-currency`); ALTER TABLE `characters` ADD CONSTRAINT `characters_fk2` FOREIGN KEY (`id_clan`) REFERENCES `clans`(`id_clan`); ALTER TABLE `characters` ADD CONSTRAINT `characters_fk3` FOREIGN KEY (`id_stats`) REFERENCES `stats`(`id_stats`); ALTER TABLE `items_character` ADD CONSTRAINT `items_character_fk0` FOREIGN KEY (`id_player`) REFERENCES `players`(`id_player`); ALTER TABLE `items_character` ADD CONSTRAINT `items_character_fk1` FOREIGN KEY (`id_character`) REFERENCES `characters`(`id_character`); ALTER TABLE `items_character` ADD CONSTRAINT `items_character_fk2` FOREIGN KEY (`id_item_type`) REFERENCES `item_type`(`id_item_type`); ALTER TABLE `item_history` ADD CONSTRAINT `item_history_fk0` FOREIGN KEY (`id_player`) REFERENCES `players`(`id_player`); ALTER TABLE `item_history` ADD CONSTRAINT `item_history_fk1` FOREIGN KEY (`id_item`) REFERENCES `items_character`(`id_item`); ALTER TABLE `item_history` ADD CONSTRAINT `item_history_fk2` FOREIGN KEY (`id_character`) REFERENCES `characters`(`id_character`); ALTER TABLE `payments` ADD CONSTRAINT `payments_fk0` FOREIGN KEY (`id_character`) REFERENCES `characters`(`id_character`); ALTER TABLE `payments` ADD CONSTRAINT `payments_fk1` FOREIGN KEY (`id_player`) REFERENCES `players`(`id_player`); ALTER TABLE `action_records` ADD CONSTRAINT `action_records_fk0` FOREIGN KEY (`id_player`) REFERENCES `players`(`id_player`); ALTER TABLE `action_records` ADD CONSTRAINT `action_records_fk1` FOREIGN KEY (`id_character`) REFERENCES `characters`(`id_character`); ALTER TABLE `action_records` ADD CONSTRAINT `action_records_fk2` FOREIGN KEY (`id_item`) REFERENCES `items_character`(`id_item`); ALTER TABLE `clans` ADD CONSTRAINT `clans_fk0` FOREIGN KEY (`reputation`) REFERENCES `rating_clans`(`rating-currency`);
Absolute service time: 0,36 sec, absolute service time: 0,37 sec
edit mode
|
history
|
discussion
Error(s), warning(s):
Table 'players' already exists