glendango Posted February 14, 2018 Share Posted February 14, 2018 (edited) Hi.. I have a database which works fine. I ve just started using google charts to make the results look better for the U.Experience. . The example tables are very basic like: Country Visits England 4 Usa 6 Brazil 3 I get all my results form where statements so I have no tables which actually count the entries and show them in a basic table like this. My question is : Should I be using where, count() etc statements to populate the charts or should I have mini tables in my schema that present the information neatly like the above or a counter next to the id of the user/country etc e.g. so I don't need to worry about statements in the chart code.... thx for reading. Edited February 14, 2018 by glendango Quote Link to comment https://forums.phpfreaks.com/topic/306538-database-schema/ Share on other sites More sharing options...
Solution Barand Posted February 14, 2018 Solution Share Posted February 14, 2018 A basic rule of relational database design is "do not store derived data such as counts or totals". You get them when required with a query. Quote Link to comment https://forums.phpfreaks.com/topic/306538-database-schema/#findComment-1556387 Share on other sites More sharing options...
glendango Posted February 14, 2018 Author Share Posted February 14, 2018 (edited) thx , I thought so but needed to confirm for my own mind. Edited February 14, 2018 by glendango Quote Link to comment https://forums.phpfreaks.com/topic/306538-database-schema/#findComment-1556389 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.