Software development life cycle-hotel sales Management System Example---1. Database design

Source: Internet
Author: User

Software project development Model

a spiral development model

Suitable for the early part of the project needs of the situation, for each module to develop each:

Analysis, design, coding, testing, on-line.

Benefits: Reduce the risk of software development (products to meet user needs as far as possible)

Two waterfall mode

First of all the requirements of the module analysis, when the analysis is over, only to enter the next phase of the project, namely design, coding, testing, on-line

It is easier to control the project, the quality of the project is controlled.

"Restaurant King" system function analysis

1. Table Management

2. Food category Management (cuisine)

3. Food information (dishes)

4. Order Management

Detailed analysis

1. Background input table, to be displayed in the foreground: and only show not booked

2. Background input menu category, display on the front page

3. Background input menu information, displayed on the front page

4. Orders generated by the foreground, show order details in the background

================================================

Database system table Design

================================================

----1. Table

CREATE DATABASE Hotel Character Set UTF8;

Use Hotel;

CREATE TABLE dinnertable

(

ID INT PRIMARY auto_increment,-----table primary Key

TableName VARCHAR,-----table name

Tablestatus INT deafult 0,-----table State 0 Free 1 Reservations

OrderDate DATETIME

);

----2. Table of Cuisine categories

CREATE TABLE FoodType (

ID INT PRIMARY Key auto_increment,---primary key

TypeName VARCHAR----Dish alias

);

----3. Table of varieties of dishes

CREATE TABLE Food (

ID INI PRIMARY Key auto_increment,---primary key

Foodname VARCHAR,---dish name

FOODTYPE_ID INT,----owned cuisine, foreign key field

Price DOUBLE,---prices

Mprice DOUBLE---member price

Remark VARCHAR ($),---Introduction

IMG VARCHAR (---) 's photos

);

----4. Order Form

CREATE TABLE Orders (

ID INI PRIMARY Key auto_increment,----primary key

TABLE_ID INT,---foreign key, table number

OrderDate datetime,---order date

Totalprice Double,--the total amount required for the order

Orderstatus INT DEFAULT 0,--order status 0 not checkout 1 checkout

);

----5. Order schedule (mainly of dishes)

CREATE TABLE OrderDetail (

ID INT PRIMARY Key auto_increment,---primary key

OrderId INT,---Foreign key, introduces the primary key of the order table

FOOD_ID INT,---foreign key, refers to the primary key of the menu information table

Foodcount INT---The number of dishes

);

----To add a relationship constraint to a dish category

ALTER TABLE Food ADD constaint fk_food_foodtype_id FOREIGN KEY (foodtype_id) REFERENCES foodtype (ID);  

----Order Details, relationship to the order form

ALTER TABLE orderdetail ADD CONSTRAINT orderdetail_order_id FOREIGN KEY (orderId) REFERENCES orders (ID);

----Order Details, and the relationship of the menu information ALTER TABLE orderdetail ADD CONSTRAINT orderdetail_food_id FOREIGN KEY (food_id) REFERENCES food (ID); ----Order table, relationship with table table ALTER TABLE orderdetail ADD CONSTRAINT order_table_id FOREIGN KEY (table_id) REFERENCES dinnertable (ID);

Software development Life cycle-hotel sales Management System Example---1. 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.