Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8882727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:39:03+00:00 2026-06-14T20:39:03+00:00

Database normalization is getting on my nerves. Suppose I have a scenario to find

  • 0

Database normalization is getting on my nerves. Suppose I have a scenario to find out mutual friends. And I am using three fields in my database

conn_id,user_id,friend_id

user_id represent a normal id of users, and friend id represent the same, i am just trying to relate each users with friends.

I now enter a user id, and enter friends id, one record each

For Example:

conn_id | user_id |friend_id

1 – us1 – us2

2 – us1 – us3

3 – us1 – us5

4 – us3 – us1

5 – us3 – us6

………………………………….and so on

How does it fail to comply with database normalization?

EDIT (clarification from comments):

someone got me confused saying that i have one record with user1 — user2 . And another record with user2 — user1 : That does not violate normalization, does it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:39:05+00:00Added an answer on June 14, 2026 at 8:39 pm

    A common normalization violation is the tacking on of a sequence number for an id when rows are already uniquely identified by some column or combination of columns therein. Of course people do this all the time. There are reasons to keep your schemas normalized and plenty of reasons not to do so as well.

    It looks like that’s the case here. If it is not meaningful to have duplicate entries of (user_id, friend_id), then that combination of columns can be used as a primary key. Unless the sequence number is actually meaningful in its own right it is likely extraneous from a normalization perspective.

    UPDATE

    Another consideration you bring up below is the possibility of duplicate records e.g. (u1 -> u2) and (u2 -> u1). This comes down to a question of whether or not friendship is commutative.

    If user2 is user1’s friend, then is user1 also necessarily user2’s friend? If friendship is commutative then you’d have duplicate records. If this is something like a social app I would assume that’s NOT the case and those would not be duplicate records at all: they represent two completely independent relationships.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Database: DB2 v9.5 on AIX Scenario: I have 2 instances- db2inst1 and db2inst2. I
I have a database that has no real normalization, so I am going back
The way a part of my database is designed I have three tables: Partners
I'm trying to figure out most of the database design and normalization before I
We already have a database structure, but it is the structure without normalization and
I know the basics of mySQL and database normalization. I am getting into Microsoft
I understand the concept of database normalization, but always have a hard time explaining
I just started learning about database normalization and I have a question about one
How should you design your database? Using OO inheritance principes or using database normalization
I was studying the article on Database Normalization 2NF in Wikipedia at Wikipedia ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.