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 9023845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:51:37+00:00 2026-06-16T05:51:37+00:00

I have three tables USER USER_ID USERNAME [additional fields] ASSET ASSET_ID DISPLAY_NAME [additional fields]

  • 0

I have three tables

USER
USER_ID
USERNAME
[additional fields]

ASSET
ASSET_ID
DISPLAY_NAME
[additional fields]

PAGE
PAGE_ID
[additional fields]

The USER table is what you would expect and standard USER table. Each user can add assets to their library, so there is a 1 to many relationship between USER and ASSET. Additionally, each ASSET is made up of multiple pages, and each PAGE can have multiple notes that is just for that user to see. My initial thought is to have a lookup table between all three tables:

USER_ASSET_PAGE
UAP_ID
USER_ID
ASSET_ID
PAGE_ID
NOTE

So now I have to query the USER_ASSET_PAGE table to get notes that correspond to a specific page of a specific document for a distinct user:

SELECT NOTE 
FROM USER_ASSET_PAGE
USER_ID = {user_id} AND ASSET_ID = {asset_id} AND PAGE_ID = {page_id}

Is there a better way to structure this type of data? It feels like there maybe complications down the road.

  • 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-16T05:51:38+00:00Added an answer on June 16, 2026 at 5:51 am

    Well based on your description, I personally would use the following scenario:

    USER {UserID,User_Name},...;
    ASSET {AssetID,DISPLAY_NAME,UserID (FK)};
    PAGE {PageID,AssetID (FK)...};
    NOTE {NoteID,Note,PageID (FK)};
    

    then, to query for notes from a specific user,asset and page:

    Select n.NOTE
    From NOTE n
    inner join PAGE p on p.ID=n.PageID
    inner join ASSET a on a.AssetID=p.AssetID
    inner join USER u on u.UserID=a.UserID
    where u.UserId=x and p.PageID=y and a.AssetID=z
    

    This is obviously a normalized attempt. Of course it all depends on what your goals are and the expected data to be stored. With low amount of data, your denormalize design would be enough. However with major amounts of data, hundreds of users with several assets with hundreds of pages, you could face a great growth on your USER_ASSET_PAGE table.

    My approach would serve better an operational purpose, rather than a “data exploration” one. Later on if you would need to perform some major aggregation on these tables it would be a good idea to denormalize data like you did and look for some optimization as well.

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

Sidebar

Related Questions

I have three tables to define users: USER: user_id (int), username (varchar) USER_METADATA_FIELD: user_metadata_field_id
I have three tables: Users, Groups and GroupsUsers User table: id: 1 username: admin
I have three tables: USER: user_id (pk); username FIELD: field_id (pk); name METADATA: metadata_id
I have a table with three fields, User , City and Country , where
I have a table of users with three columns. Username Accepted Rejected User 1
I have a table like this, with three fields: User | Question# | Answer
I have three tables as follows user(username address) profile(fname,lname,mobile) details(performance,activity) I want all information
I have 3 tables, user - contains user_id | username | fullname | email
Suppose I have three tables: user , group and xref , a table that
I have three tables which are defined as: class User(Base): __tablename__ = 'users' id

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.