Team name strongest bronze-database design

Source: Internet
Author: User

E-r Chart

Data dictionary

User (Users table)

Field name

Comments

Data type

Length

Allow null values

Primary key

Id

User ID

Int

11

Whether

Is

Name

User Nickname

varchar

100

Whether

Whether

Sex

User gender

Char

1

Whether

Whether

Password

User password

varchar

20

Whether

Whether

Money

Game Gold Number

Int

5

Whether

Whether

Friends (Friends table)

Field name

Comments

Data type

Length

Allow null values

Primary key

Id

User ID

Int

11

Whether

Is

Id_friend

Friend ID

Int

11

Whether

Whether

Name_friend

What do friends call

varchar

20

Whether

Whether

Sex_friend

Friend Sex

Char

1

Whether

Whether

Mall (mall table)

Field name

Comments

Data type

Length

Allow null values

Primary key

Id

User ID

Int

11

Whether

Is

Weapon ID

Number of weapons

Int

5

Whether

Whether

Weapon Price

The price of the weapon

Int

5

Whether

Whether

Warehouse (Warehouse table)

Field name

Comments

Data type

Length

Allow null values

Primary key

Id

User ID

Int

11

Whether

Is

Primary_weapon

Main weapon

Char

5

Whether

Whether

Sub_weapon

Secondary weapons

Char

5

Whether

Whether

Bomb

Throwing weapons

varchar

15

Whether

Whether

Melee

Near-body weapons

varchar

15

Whether

Whether

Primary (main weapon table)

Field name

Comments

Data type

Length

Allow null values

Primary key

Primary

Main weapon

Char

5

Whether

Is

Id

Weapon number

Int

5

Whether

Whether

Name

Primary Weapon name

varchar

5

Whether

Whether

Damage value

Weapon damage Value

Int

5

Whether

Whether

Price

Weapon Price

Int

5

Whether

Whether

Sub (secondary weapon table)

Field name

Comments

Data type

Length

Allow null values

Primary key

Sub_weapon

Secondary weapons

Char

5

Whether

Is

Id

Weapon number

Int

5

Whether

Whether

Name

Primary Weapon name

varchar

5

Whether

Whether

Damage value

Weapon damage Value

Int

5

Whether

Whether

Price

Weapon Price

Int

5

Whether

Whether

Bomb (throwing Weapon table)

Field name

Comments

Data type

Length

Allow null values

Primary key

Bomb

Throwing weapons

Char

5

Whether

Is

Id

Weapon number

Int

5

Whether

Whether

Name

Primary Weapon name

varchar

5

Whether

Whether

Damage value

Weapon damage Value

Int

5

Whether

Whether

Price

Weapon Price

Int

5

Whether

Whether

Melee (Near-body weapon table)

Field name

Comments

Data type

Length

Allow null values

Primary key

Melee

Near-body weapons

Char

5

Whether

Is

Id

Weapon number

Int

5

Whether

Whether

Name

Primary Weapon name

varchar

5

Whether

Whether

Damage value

Weapon damage Value

Int

5

Whether

Whether

Price

Weapon Price

Int

5

Whether

Whether

database table Part Code

/*
Navicat MySQL Data Transfer

Source server:localhost_3306
Source Server version:50027
Source host:localhost:3306
Source Database:game_demo

Target Server Type:mysql
Target Server version:50027
File encoding:65001

Date:2017-11-27 22:22:55
*/

SET foreign_key_checks=0;

-- ----------------------------
--Table structure for ' melee '
-- ----------------------------
DROP TABLE IF EXISTS ' melee ';
CREATE TABLE ' Melee ' (
' Melee ' varchar (character) set UTF8 not NULL,
' ID ' int (5) is not NULL,
' Name ' varchar (5) Not NULL,
' Damage value ' int (5) Not NULL,
' Price ' int (5) Not NULL,
PRIMARY KEY (' Melee '),
CONSTRAINT ' Melee_ibfk_1 ' FOREIGN KEY (' melee ') REFERENCES ' warehouse ' (' melee ')
) Engine=innodb DEFAULT charset=latin1;

-- ----------------------------
--Records of melee
-- ----------------------------

SET foreign_key_checks=0;

-- ----------------------------
--Table structure for ' primary '
-- ----------------------------
DROP TABLE IF EXISTS ' primary ';
CREATE TABLE ' primary ' (
' Primary_weapon ' char (5) Character set UTF8 not NULL,
' ID ' int (5) is not NULL,
' Name ' varchar (5) Not NULL,
' Damage value ' int (5) Not NULL,
' Price ' int (5) Not NULL,
PRIMARY KEY (' Primary_weapon '),
CONSTRAINT ' Primary_ibfk_1 ' FOREIGN KEY (' primary_weapon ') REFERENCES ' warehouse ' (' Primary_weapon ')
) Engine=innodb DEFAULT charset=latin1;

-- ----------------------------
--Records of primary
-- ----------------------------

SET foreign_key_checks=0;

-- ----------------------------
--Table structure for ' bomb '
-- ----------------------------
DROP TABLE IF EXISTS ' bomb ';
CREATE TABLE ' bomb ' (
' Bomb ' varchar (character) set UTF8 not NULL,
' ID ' int (5) is not NULL,
' Name ' varchar (5) Not NULL,
' Damage value ' int (5) Not NULL,
' Price ' int (5) Not NULL,
PRIMARY KEY (' bomb '),
CONSTRAINT ' Bomb_ibfk_1 ' FOREIGN KEY (' bomb ') REFERENCES ' warehouse ' (' bomb ')
) Engine=innodb DEFAULT charset=latin1;

-- ----------------------------
--Records of bomb
-- ----------------------------

SET foreign_key_checks=0;

-- ----------------------------
--Table structure for ' friend '
-- ----------------------------
DROP TABLE IF EXISTS ' friend ';
CREATE TABLE ' friend ' (
' id ' int (one) is not NULL,
' Id_friend ' int (one) is not NULL,
' name_friend ' varchar (character) set UTF8 not NULL,
' Sex_friend ' char (1) Character set UTF8 not NULL,
PRIMARY KEY (' id '),
CONSTRAINT ' User_friend ' FOREIGN KEY (' id ') REFERENCES ' user ' (' ID ')
) Engine=innodb DEFAULT charset=latin1;

-- ----------------------------
--Records of friend
-- ----------------------------
INSERT into ' friend ' VALUES (' 1 ', ' 100 ', ' Li Ming 100 ', ' Male ');

SET foreign_key_checks=0;

-- ----------------------------
--Table structure for ' Log_ytt '
-- ----------------------------
DROP TABLE IF EXISTS ' Log_ytt ';
CREATE TABLE ' Log_ytt ' (
' id ' int (one) is not NULL,
PRIMARY KEY (' id '),
CONSTRAINT ' Log_ytt_ibfk_1 ' FOREIGN KEY (' id ') REFERENCES ' user ' (' ID ')
) Engine=innodb DEFAULT charset=latin1;

-- ----------------------------
--Records of Log_ytt
-- ----------------------------

SET foreign_key_checks=0;

-- ----------------------------
--Table structure for ' mall '
-- ----------------------------
DROP TABLE IF EXISTS ' mall ';
CREATE TABLE ' Mall ' (
' id ' int (one) is not NULL,
' Weapon id ' int (5) Not NULL,
' Weapon price ' int (5) Not NULL,
PRIMARY KEY (' id '),
CONSTRAINT ' Mall_ibfk_1 ' FOREIGN KEY (' id ') REFERENCES ' user ' (' id '),
CONSTRAINT ' mall_ibfk_2 ' FOREIGN KEY (' id ') REFERENCES ' warehouse ' (' ID ')
) Engine=innodb DEFAULT charset=latin1;

-- ----------------------------
--Records of mall
-- ----------------------------

Team name strongest bronze-database design

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.