Mysql-MySql database, about data insertion.

Source: Internet
Author: User
There is a user table a with fields such as OID (primary key, auto-incrementing), username, gender, and creation time. Then there is another Table B, where the field is the primary key OID of the user table and the corresponding user identity RID. Identities are like super administrators, team leaders, leaders, and employees. Now we want to insert data to the user table. we just need to insert data to this user table. now we want to insert data to the user table by default. For example, the leader's RID is 1, the leader is 2, the user is 3, and the administrator is 0. The primary key OID of user table a corresponds to the RID of Table B. For example, if the first employee is 10000, the second employee is 10001, and the third employee is 10002, then Table B is 10001... mysql programming language database

There is a user table a with fields such as OID (primary key, auto-incrementing), username, gender, and creation time. Then there is another Table B, where the field is the primary key OID of the user table and the corresponding user identity RID. Identities are like super administrators, team leaders, leaders, and employees. Now we want to insert data to the user table. we just need to insert data to this user table. now we want to insert data to the user table by default.
For example, the leader's RID is 1, the leader is 2, the user is 3, and the administrator is 0.
The primary key OID of user table a corresponds to the RID of Table B. For example, the first employee is 10000, the second is 10001, and the third is 10002, in this case, Table B corresponds to 1, 10001, and 1, and 2, and 3. the problem is that table a can correspond to 2 (group leaders) by default when users are inserted to table a. how can this problem be solved. The programming language is JAVA. Ask me to solve the problem.

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.