Ask Your Question
4

How to design a MYSQL schema for individuals who have multiple usernames but do not have userIDs?

asked 2023-02-23 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-05-20 13:00:00 +0000

devzero gravatar image

One possible schema design for individuals with multiple usernames but no userIDs in MYSQL could involve creating two tables: one for users and one for usernames.

The first table for users would include columns for relevant personal information, such as name, email, and any other identifying details. The second table for usernames would have columns for the usernames themselves, and a foreign key linking them to the corresponding user in the first table.

For example:

Table: users -columns: -id (primary key) -name -email -other identification details

Table: usernames -columns: -id (primary key) -username -user_id (foreign key linking to 'id' in 'users' table)

This design allows for multiple usernames to be associated with a single user, while still maintaining the necessary data structure and relationships in a relational database.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-02-23 11:00:00 +0000

Seen: 13 times

Last updated: May 20 '22