Form Design & Creation of Forms

Disclaimer: The materials used in this column are written by VIP students of Kaige Academy. Students have the right to remain anonymous and have the right to final interpretation of the article. Kaige Academy aims to promote VIP students to learn from each other based on public notes. Disclaimer: The materials used in this column are written by VIP students of Kaige Academy. Students have the right to remain anonymous and have the right to final interpretation of the article. Kaige Academy aims to promote VIP students to learn from each other based on public notes.

Form design:

1. The information must be analyzed in detail, it does not matter if there are more columns

The more detailed the list in the table, the better, to facilitate the collection of data in the future, as shown in the following figure:

image

2. Do not add and subtract columns easily unless you have to

As shown below: If you want to add a class, don't add it like this

image

3. There are many forms, it doesn't matter, you can apply for one more form, and then write the class number to associate it. If you want to change the java class to the javaee class in the future, you can change it directly in the class. In this case, all of your dealings with that class will change, like this It is much more convenient, as shown below:

image

4. It is best to have independent values ​​in a column, not multiple values, unless there is no need to modify

5. To design a unique column, that is, the primary key column

Primary key: That is to say, the value of this column is a unique value, and this query is the fastest, so there must be a primary key column in each table. No matter if you delete or modify it in the future, you must rely on this column as a condition to delete and modify it. The column speed can't be faster

Create the table:

DDL data structure definition statement, table creation, database creation

create table table name (column type and column name) engine or character

create table student(sid int,sname varchar(10));

If NOT NULL is added when creating a table, it is a column that cannot be empty, and data must be filled in later

image

Adding DEFAULT means giving you a default value

image

Write the PRIMARY KEY keyword to indicate that you are the primary key column

image

There is also this way of writing that can also customize the primary key. Finally, it is stated that sid is the primary key, which is the same as the above.

image

The union primary key is the combination of two or more columns and the unique combination of other columns.

Reminder: When operating in the future, it is necessary to use both columns to have an effect.

image

CHARACTER specifies the character set of the table

image

ENGINE engine selection

image

engine plus character encoding

image

TEMPORARY temporary table is created, restart the server and it will be gone

image

drop temporary table; delete temporary table

drop table name; drop table

DCL database operation statement to create an authorized user

show databases; show the databases authorized by your current user

show tables; view the tables in this database

use library name; is to select this library for operation

desc table name; used for table structure query

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326442239&siteId=291194637