これはかなり複雑な質問なので、準備してください!EAV テーブルのテスト データを Excel で生成したいと考えています。私が持っている列は次のとおりです。
user_id、属性、値
各 user_id は 1 ~ 4 の間のランダムな回数繰り返され、エントリごとにリストからランダムな属性を選択し、次にこれが取ることができるランダムな値を選択します。最後に、各 ID エントリの属性を一意にする必要があります。つまり、同じ ID と属性を持つ複数のエントリは必要ありません。以下は、私が意味するものの例です。
user_id attribute value
100001 gender male
100001 religion jewish
100001 university imperial
100002 gender female
100002 course physics
可能な値:
attribute value
gender male
female
course maths
physics
chemistry
university imperial
cambridge
oxford
ucl
religion jewish
hindu
christian
muslim
上の表がおかしくてすみません。構造を保持したままここに貼り付ける方法がわかりません。うまくいけば、私が話していることがわかると思います。さもなければ、スクリーンショットを取得できます。
これどうやってするの?過去に、乱数ジェネレーターと VLOOKUP を使用してランダム データを生成しましたが、これは私のリーグから少し外れています。