Implementing database Programming with Java-01 design of the first chapter database

Source: Internet
Author: User

1. Database design: The process of planning and structuring the relationships between the data entities in the database and the data entities;

a good database design:

Save storage space for data

to ensure the integrity of the data

facilitate the development of database application system

Poor database design:

data redundancy, wasted storage space

Wasted memory space

data updates and inserted exceptions

2. Steps for database design:

1. Requirements Analysis Phase : Analysis of customer's business and data processing requirements

2, outline design stage : Design database e-r model Diagram, confirm the need information is correct and complete

3. detailed design stage : convert e-r graph to multiple tables, make logical design, confirm main foreign key of each table, and apply three paradigm to audit database structure

4, code writing phase: physical implementation of the database, coding implementation of the application

5. Software testing phase: ...

6. installation and deployment: ...

  3,         Database analysis steps:

1, collect information: with the system personnel to communicate, discussion, fully understand the user needs, understand the database needs to complete the task

2. identity entity : Identifies the key object or entity to be managed by the database, the entity is usually a noun, and an entity describes only one thing, Entities with the same meaning cannot appear

3. Identify the details that each entity needs to store , identify the attributes of each entity (Attribute), and, in the case of entity attribute decomposition, Member information that has the same meaning cannot recur.

4. identify The relationship between entities (relationship): The relational database has a very powerful function, that is, it can correlate the information of each project in the database;

4 , E-r diagram:

Symbol

Meaning

Entity (set), usually a noun

Attribute (set), usually a noun

Contact (set), usually a verb

Used to connect attributes and entity sets, and also to connect entity sets and contact sets

(a line can have a direction (at the end there is an arrow) to represent the mapping cardinality of the contact set)

Entity: Something in the real world that distinguishes the characteristics or attributes of other things and is associated with other things;

properties: characteristics of the entity;

Contact: A connection between two or more entities;

Map cardinality: One-to-many, many- to-a, many-to-many;

Entity Relationship diagram;

5 , relational database schema: The data model of relation between entity and entity is represented by the form of two-dimensional table .

Relational database schema is the description of relational data structure;

form: R (U) or R (A, b)

★r represents a collection of attributes, and A, B represents the properties of u in;

E-r diagram to convert to relational mode:

1. convert each entity to a relational mode R (U) or R (A, b) Form

2. Establishing the conversion of inter-entity linkages;

6. Data Normalization:

Non-canonical table design

Information Duplication

Update Exception

Insert Exception (some information cannot be represented correctly)

Delete Exception (Loss of valid information)

7. the design of a database table using three main paradigms: (Normal formate)

the first paradigm (normal formate, 1NF):

The goal of the first paradigm is to ensure the atomicity of each column, which satisfies the first normal form (1NF) if each column is the smallest data unit (also known as the smallest atomic unit) that cannot be divided .

the second paradigm (normal formate, 2NF): The second paradigm requires that each table describe only one thing;

goal: Ensure that each column in the table is related to the primary key, if a relationship satisfies the first normal form (2NF), and all columns except the primary key depend on the primary key;

the third paradigm (normal formate, 3NF):

Objective: Ensure that each column is directly associated with the primary key, not indirectly, If a relationship satisfies 2NF and the columns other than the primary key are not passed dependent on the primary key column, there is no dependency between the columns and columns, and the third normal form (3NF) is satisfied;

8. the relationship between normalization and performance :

database performance is more important than normalizing a database to meet a business goal

1. Reduce the amount of time needed to search for information by adding additional fields to a given table

2, by inserting the computed column in the given table (such as score score), to facilitate the query

? at the same time of data normalization, we should consider the performance of database comprehensively.

9. Database Integrity: Database Integrity refers to the logical consistency, correctness, validity, and compatibility of data in a database.

Database integrity is guaranteed by a variety of integrity constraints, so it can be said that database integrity design is the design of database integrity constraints.

Database integrity constraints can be implemented through a DBMS or application, and DBMS-based integrity constraints are stored in the database as part of the schema.

Database integrity through the DBMS is designed according to the database design steps, while the database integrity implemented by the application software is incorporated into the application software design (the former is mainly discussed in this paper).

10. the role of database integrity:

1. Database Integrity constraints prevent legitimate users from adding non-semantic data to the database when they use the database.

2. implement business rules using DBMS-based integrity control mechanisms that are easy to define, easy to understand, and can reduce application complexity and improve application efficiency. At the same time, the DBMS-based integrity control mechanism is centrally managed, making it easier than the application to achieve database integrity.

3. Reasonable Database integrity design, can simultaneously take into account the integrity of the database and the effectiveness of the system. For example, when loading large amounts of data, the database integrity constraint of DBMS is invalidated before loading, so it can guarantee the database integrity without affecting the efficiency of data loading.

4. in the functional testing of the application software, perfect database integrity can help to detect errors in application software as early as possible.

Implementing database Programming with Java-01 design of the first chapter database

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.