A simple database design example and a simple database design example

Source: Internet
Author: User

A simple database design example and a simple database design example

An example of database design in a simple management system, including design tables, ergraphs, modeling, and scripts.


++ ++ ++

  • Project information

Project Name:Book Manager System
DB:MySQL5.5
DB Name:Db_library
Tables:
1). tb_book_info
2). tb_user
3). tb_admin_info
4). tb_borrow_return
5). tb_book_type


  • Table Design



  • E-R Diagram


  • PowerDesigner Modeling


  • Script

C: \ Program Files \ MySQL Server5.5 \ bin>Mysql-u root-pabcd <c: \ admin. SQL
NOTE:
1. Run MySQL-u root-pabcd <c: \ admin. SQL In the mysql/bin directory.
2. database name used for the exercise: db_library in the library Project
/* ===================================================== ======================================= */
/* Table: tb_admin_info Table for administrator login */
/* ===================================================== ======================================= */
Drop database if exists library; # the database used for the exercise. Delete the database if it exists.
Create database library; # create a database.
Use library; # Open the database. use a semicolon.
Create tabletb_admin_info # create an exercise table.
(
Admin_id int (3) auto_increment not null primary key, # primary key, non-empty, auto-increment.
Admin_user varchar (15) not null,
Admin_pwd varchar (15) not null
);
Insert into tb_admin_infovalues ('001', 'Tom ', 'Jerry'); # insert two pieces of data for testing.
Insert into tb_admin_infovalues ('002 ', 'root', 'root'); # insert two pieces of data for testing.

 


Related Article

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.