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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:00:39+00:00 2026-06-05T15:00:39+00:00

I am trying to figure out a design for a specific function in my

  • 0

I am trying to figure out a design for a specific function in my system (It is apart of a cloud based service)

Essentially, I want users to be able to create their own psuedo-‘tables’ for a simple CRM entry/retrieval system that integrates with the system.

So I have 2 questions I am in need of help with

  1. I am wondering how I will store data, I’ve thought of two layouts

    • making 3 tables which will store either text, integer or
      double for example

    cms_item_text – [id, heaqderID, data (text)]

    cms_item_int – [id, headerID, data (int)]

    cms_item_double – [id, headerID, data (double)]

    • OR cms_item – [id, headerID, data (text)] and I will (use the
      MySQL cast() function to convert from text to integer/double when
      doing order eg order by cast(data as signed integer) )
  2. Now retrieval of the data is a different story. Since it is often in a table view, what is the best way to read from it? I’ve thought of it like this –

    SELECT barcode.data as barcode, price.data as price, notes.data as notes
    FROM cms_item barcode, cms_item price, cms_item notes
    WHERE (barcode.headerID = 1 and barcode.id = 1) and
          (price.id = 1 and price.headerID = 2) and
          (notes.id = 1 and notes.headerID = 3)
    

so that I could get results like

array("barcode" => "eg", "price" => "123", "notes" => "hello there")
array("barcode" => "no2", "price" => "456", "notes" => "yes")

What is the best design path to take?

  • 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-05T15:00:40+00:00Added an answer on June 5, 2026 at 3:00 pm

    I faced a similar problem with my application design. Essentially I had to allow the user to define the ‘tables’ in the database including specifying the data types.

    I ended up going down the first approach, whereby i had a single table with multiple fields and different types which the user could define.

    While i eventually got it all working it wasn’t smooth sailing. The queries got quite complex, and I had to use Dynamic SQL quite a lot in conjunction with building SQL queries from within my application.

    The kicker for me and why i chose to implement strongly typed data field in my application (as opposed to storing everything in text fields) was the ability to perform SQL functions (AVG,MAX,MIN etc) on numeric data types.

    So all i can say, is that either way you choose to go, there will be some things that are easy to implement and code, and others that are difficult. If you wish to pull out the data, and CAST the data either by using SQL functions or in code, depending on how big your application becomes there may be a lot of unnecessary validation checks when both storing and retrieving the data.

    I would advise you to really think about what functionality your users need of the data in the DB, which is a decision you need to thoroughly investigate and will be dependent on your application and its intended use.

    UPDATE

    You may also need to consider the amount of data in your tables. I noticed you will be doing an ORDER BY using the CAST() function. Note that this is inefficient and may lead to slow queries.

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

Sidebar

Related Questions

I'm trying to figure out the best design for the messaging system I'm porting
I'm trying to figure out how to design an iOS app that would connect
I'm trying to figure out what's the best design I can go with for
I'm trying to figure out the best way to design Car and Road objects
I'm trying to figure out the origin of the view handler design pattern in
An odd case I'm trying to figure out here. I'm trying to design a
I'm trying to figure out how to design a small application more elegantly, and
I'm trying to figure out a good design for a Spring/Hibernate app. When creating
I need help trying to figure out the proper design of my classes. I
I'm a novice to SQL scripting. I am trying to figure out a design

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.