Team project----Texas Hold ' em database design improved version

Source: Internet
Author: User

Because the database design experience is insufficient, and the knowledge system is imperfect, the database analysis ability is not enough, resulting in the previous version (http://www.cnblogs.com/qiangzai/p/8032833.html) design errors a lot; this time, after my deliberation, The database has been greatly adjusted, hoping to continue to improve and repair in the future learning.

The E-r chart is as follows:

this project uses MYSQL Create a database game_db, This includes four tables, each of which is a user login information table ( AccountInfo ), the User Details table ( Individual_info ), User score table ( Gamescoreinfo ) , Room Information Table ( House ) :

AccountInfo table:

Property name

Data type

Property Description

Userid

Int

User ID

GameID

Int

Game ID

Account

Varchar (45)

Player name

Password

Varchar (45)

Password

Memberorder

Int

Membership level

Individual_info table:

Property name

Data type

Property Description

Userid

Int

User ID

Really_name

Varchar (45)

real name

Sex

Varchar (10)

Gender

Qq

Varchar (45)

QQ number

Phone

Varcher (45)

Phone number

Email

Varchar (45)

e-mail address

Gamescoreinfo table:

Property name

Data type

Property Description

GameID

Int

Game ID

Houseid

Int

Room ID

Score

Int

Game Score

Wincount

Varchar (45)

Victory Bureau Number

Lostcount

Varchar (45)

Number of Lost offices

Drawcount

Varchar (45)

Number of bureaux

Runcount

Varchar (45)

Number of escape bureaus

House table:

Property name

Data type

Property Description

Houseid

Int

Room ID

Housename

Varchar (45)

Room number

Entertime

Varchar (45)

Enter time

Leavetime

Varchar (45)

Departure time

build libraries, tables, and insert data SQL statement:

CREATE SCHEMA ' game_db ';

CREATE TABLE ' game_db '. ' Accountsinfo ' (

' UserID ' INT not NULL auto_increment,

' GameID ' INT not NULL,

' Account ' VARCHAR BINARY is not NULL,

' Password ' VARCHAR BINARY NULL DEFAULT 0,

' Sex ' VARCHAR (Ten) not NULL DEFAULT ' nan ',

' Memberorder ' INT not NULL,

UNIQUE INDEX ' account_unique ' (' Account ' ASC);

SELECT * from Game_db.accountsinfo;

INSERT into ' game_db '. ' Accountsinfo ' (' UserID ', ' GameID ', ' account ', ' Password ', ' Memberorder ') VALUES (' 1 ', ' 1 ', ' liming ', ' 123 ', ' 1 ');

INSERT into ' game_db '. ' Accountsinfo ' (' UserID ', ' GameID ', ' account ', ' Password ', ' Memberorder ') VALUES (' 2 ', ' 2 ', ' Bob '), ' 111 ', ' 2 ');

INSERT into ' game_db '. ' Accountsinfo ' (' UserID ', ' GameID ', ' account ', ' Password ', ' Memberorder ') VALUES (' 3 ', ' 3 ', ' Qinagz Ai ', ' 222 ', ' 5 ');

INSERT into ' game_db '. ' Accountsinfo ' (' UserID ', ' GameID ', ' account ', ' Password ', ' Memberorder ') VALUES (' 4 ', ' 4 ', ' Jier ', ' 333 ', ' 4 ');

INSERT into ' game_db '. ' Accountsinfo ' (' UserID ', ' GameID ', ' account ', ' Password ', ' memberorder ', ' Accountsinfocol ') VALUES (' 5 ', ' 5 ', ' Lucy ', ' 1234 ', ' 7 ', ' 1 ');

CREATE TABLE ' game_db '. ' Individual_info ' (

' UserID ' INT not NULL,

' Really_name ' VARCHAR is not NULL,

' Sex ' VARCHAR (+) not NULL,

' QQ ' VARCHAR () not NULL,

' Phone ' VARCHAR is not NULL,

' Email ' VARCHAR (not NULL),

PRIMARY KEY (' UserID '));

SELECT * from Game_db.individual_info;

INSERT into ' game_db '. ' Individual_info ' (' UserID ', ' really_name ', ' QQ ', ' Sex ', ' Phone ', ' Email ') VALUES (' 1 ', ' AA ', ' 12345 677 ', ' nan ', ' 13177789865 ', ' [email protected] ');

INSERT into ' game_db '. ' Individual_info ' (' UserID ', ' really_name ', ' QQ ', ' Sex ', ' Phone ', ' Email ') VALUES (' 2 ', ' BB ', ' 12234 ", ' nan ', ' 17738724089 ', ' [email protected] ');

INSERT into ' game_db '. ' Individual_info ' (' UserID ', ' really_name ', ' QQ ', ' Sex ', ' Phone ', ' Email ') VALUES (' 3 ', ' CC ', ' 45665 654 ', ' nan ', ' 17890762354 ', ' [email protected] ');

INSERT into ' game_db '. ' Individual_info ' (' UserID ', ' really_name ', ' QQ ', ' Sex ', ' Phone ', ' Email ') VALUES (' 4 ', ' DD ', ' 34424 5345 ', ' nan ', ' 13798082376 ', ' [email protected] ');

INSERT into ' game_db '. ' Individual_info ' (' UserID ', ' really_name ', ' QQ ', ' Sex ', ' Phone ', ' Email ') VALUES (' 5 ', ' EE ', ' 56456 ", ' nan ', ' 197662762 ', ' [email protected] ');

CREATE TABLE ' game_db '. ' Gamescoreinfo ' (

' GameID ' INT not NULL auto_increment,

' Score ' INT not NULL DEFAULT 0,

' Wincount ' VARCHAR not NULL DEFAULT 0,

' Lostcount ' VARCHAR not NULL DEFAULT 0,

' Drawcount ' VARCHAR not NULL DEFAULT 0,

' Runcount ' VARCHAR not NULL DEFAULT 0,

PRIMARY KEY (' GameID '));

SELECT * from Game_db.gamescoreinfo;

INSERT into ' game_db '. ' Gamescoreinfo ' (' GameID ', ' score ', ' Wincount ', ' lostcount ', ' drawcount ', ' Runcount ') VALUES (' 1 ', ' 7 ', ' 3 ', ' 2 ', ' 4 ');

INSERT into ' game_db '. ' Gamescoreinfo ' (' GameID ', ' score ', ' Wincount ', ' lostcount ', ' drawcount ', ' Runcount ') VALUES (' 2 ', ' 7 ', ' 3 ', ' 2 ', ' 4 ');

INSERT into ' game_db '. ' Gamescoreinfo ' (' GameID ', ' score ', ' Wincount ', ' lostcount ', ' drawcount ', ' Runcount ') VALUES (' 3 ', ' 7 ', ' 3 ', ' 2 ', ' 4 ');

INSERT into ' game_db '. ' Gamescoreinfo ' (' GameID ', ' score ', ' Wincount ', ' lostcount ', ' drawcount ', ' Runcount ') VALUES (' 4 ', ' 7 ', ' 3 ', ' 2 ', ' 4 ');

INSERT into ' game_db '. ' Gamescoreinfo ' (' GameID ', ' score ', ' Wincount ', ' lostcount ', ' drawcount ', ' Runcount ') VALUES (' 5 ', ' 7 ', ' 3 ', ' 2 ', ' 4 ');

CREATE TABLE ' game_db '. ' House ' (

' Houseid ' INT not NULL auto_increment,

' Houseid ' VARCHAR is not NULL,

' Entertime ' VARCHAR not NULL DEFAULT 0,

' Leavetime ' VARCHAR is not NULL,

PRIMARY KEY (' Houseid '));

SELECT * from Game_db.house;

INSERT into ' game_db '. ' House ' (' UserID ', ' Houseid ', ' entertime ', ' Leavetime ') VALUES (' 1 ', ' 1 ', ' 12 ', ' 345 ');

You are welcome to criticize correct

Team project----Texas Hold ' em database design improved version

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.