Alpha DevCon Engineering Roundtables
Results 1 to 15 of 15

Thread: What first step do you take when building tables from scratch?

  1. #1
    Member
    Real Name
    Richard Battle
    Join Date
    May 2017
    Location
    Austin,TX
    Posts
    30

    Default What first step do you take when building tables from scratch?

    I've seen the videos on repeating sections that show how to build parent-child dependencies through the Data Binding section table builder. In a different thread it was suggested that using MySQl or similar programs is easier/better. First to build out a schema there, and then build a connection string to the data.

    From my current viewpoint, both seem quite challenging since there's very little documentation on how best to approach building the relations between tables on the backend of this program. Almost every video starts by importing the Northwind db and then creating "flat" grids or list controls that don't address relations between tables.

    This question is to more developers with more experience under their belts. What approach are you using when starting out in AA?

    Regards,
    Richard

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,065

    Default Re: What first step do you take when building tables from scratch?

    Data design drives everything... you always start there first... with a SQL backend (MySQL, SQL Server, MariaDB, etc) it doesn't matter which. Start building out your parent table first, then the child tables.

    Northwind still offers a good example with the Customers, Orders, Order Details tables.

    You're not building "the backend of this program", you're building a good, hierarchical back end. It's got nothing to do with Alpha or any other front end... it's just a good data design.

    Then, when you start building in Alpha you'll see how easy the data fits into the tools. Parent data with Child data Repeating Sections, Parent-Child Lists... it's all the same pattern.

  3. #3
    Member
    Real Name
    Michael Cornford
    Join Date
    Oct 2011
    Location
    East Sussex, UK
    Posts
    836

    Default Re: What first step do you take when building tables from scratch?

    You will not regret taking a step back and following David's advice. For someone who has used excel SQL is not too different visually. The data resides in tables. Excel calls these sheets.

    Often people attempt to use a "Flat" structure in excel and this is not encouraged in SQL. Look at Northwinds as David suggested. Try to understand the idea of splitting the "Flat" data that excel may display in one sheet, as 3 linked tables. An order detail is linked by a "Key" to an order which in turn links to a customer. The idea is if you know the order detail then you can find your way back to the customer.

    Having said all of that if you want to play on your own then Alpha has a way of building tables for you.

    Message answer..png

    Good luck

  4. #4
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,200

    Default Re: What first step do you take when building tables from scratch?

    in order to learn basics of database design, which is what i deduce from your question, there are lots of material out there on the internet, better yet books on database design. a better database design will help you achieve your final end better.
    a better database design starts with what you want in the end, the outcome. then you design the beginning, the end dictates the start. before a single keyboard click to start designing, always write down what you want then see if you can separate the data into smaller pieces so there is less repetition of data. then only design in the database software. alpha sql design is fairly easy but as far as i know it does not give you flexibility as you would get by yourself like designing in phpadmin, navicat or toad.
    reading, studying northwind database is good, if you already know how to design the tables and their structures, since it is a finished product, in order to take you thru building and teach design basics you need to read database design books or internet. even then the concept will be adjusted as time goes on and as you mature in database design. once you learn the basics then nothwind will definitely help you fine tune your idea.
    in any case good luck and have fun.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  5. #5
    Member
    Real Name
    Doron
    Join Date
    Dec 2011
    Location
    NJ, USA
    Posts
    161

    Post Re: What first step do you take when building tables from scratch?

    Hello,

    Start up with the database design is crucial for any application development. We are using xCase as data modelling tool. Have a look at this article: Reverse Database Engineering and Database Design.

    That tool will help you to design your database and will generate the script for any table, indexes, relations and more without leaving this tool at all.

    Regards,

    Doron
    The Farber Consulting Group, Inc.

    Main Web Site: http://www.dFarber.com

    Avis Car Rental Software
    MS SQL Blog: http://http://www.dfarber.com/computer-consulting-blog/
    Convert Ms Access to Web
    Last edited by Steve Wood; 08-17-2017 at 12:37 PM. Reason: fixed hyperlink

  6. #6
    Member
    Real Name
    Richard Battle
    Join Date
    May 2017
    Location
    Austin,TX
    Posts
    30

    Default Re: What first step do you take when building tables from scratch?

    Thanks, I appreciate it.

  7. #7
    Member
    Real Name
    Wale Lasaki
    Join Date
    Apr 2012
    Location
    Abeokuta
    Posts
    25

    Default Re: What first step do you take when building tables from scratch?

    where can I download this application "Reverse Database Engineering and Database Design".
    I like to try it.

  8. #8
    Member
    Real Name
    Doron
    Join Date
    Dec 2011
    Location
    NJ, USA
    Posts
    161

    Default Reverse database Engineering

    Hello Wale,

    Check this company named xCase.

    Regards,

    Doron
    The Farber Consulting Group, Inc.

    Main Web Site: http://www.dFarber.com
    Alpha AnyWhere Development
    Reverse Database Engineering and Database Design

  9. #9
    "Certified" Alphaholic CharlesParker's Avatar
    Real Name
    Charles Parker
    Join Date
    Dec 2012
    Location
    New Orleans, LA
    Posts
    1,572

    Default Re: What first step do you take when building tables from scratch?

    one thing to consider in design is to count on user tracking and data manipulation tracking, which I wish I had done from the beginning. Take, for example, the deletion of an invoice. What if the user of your app wants to "undo" that? What if there are two logins for the same account and one of them makes an update to a record and the other calls you to say his data changed? The idea would be that you could then look into it and say well there was a login at 2:45pm by user1 who updated that record.

    I would say though that just starting out you will want to flesh out the amount of redundancy you want in the data that you want to track and as others have said it really depends on you and what data you want to store. For me, event tracking has been something I added later as the need surfaced but I wish I had it in place from the beginning as part of the base table design.
    NWCOPRO Nuisance Wildlife Control Software-My Application: http://www.nwcopro.com OR my Developer Chat
    Any sufficiently advanced bug is indistinguishable from a feature.

  10. #10
    Member
    Real Name
    Richard Battle
    Join Date
    May 2017
    Location
    Austin,TX
    Posts
    30

    Default Re: What first step do you take when building tables from scratch?

    Time stamps are something I've been trying to get my head around. So I created 6 tables: User entered data(id field), user changed data(id), date entered(date), date changed(date), time entered(time_stamp), time changed(time_stamp). I've followed different Javasript examples and not working so far. Of course I'm not sure where JS should be placed. I just copied some stuff from this forum, and not much else.

  11. #11
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,065

    Default Re: What first step do you take when building tables from scratch?

    You should let your SQL Tables handle this... and just have 1 dateCreated and 1 dateUpdated field. Each field type is datetime. You don't need separate date and time fields.

    The dateCreated field will have the default value set to CURRENT_TIMESTAMP.
    The dateUpdated field will have the option On Update CURRENT_TIMESTAMP turned on.

    timeStamp1.PNGtimeStamp2.PNG
    Last edited by Davidk; 08-22-2017 at 09:01 PM.

  12. #12
    Member
    Real Name
    Doron
    Join Date
    Dec 2011
    Location
    NJ, USA
    Posts
    161

    Post Re: What first step do you take when building tables from scratch?

    Hi Rich,

    Time stamp you use when the record is saved. In MS SQL the function for that is GETDATE() and you use that as default so all is done in the database level without even thinking about that. No need to use JS for that.

    Regards,

    Doron
    The Farber Consulting Group, Inc.

    Main Web Site: http://www.dFarber.com

    Avis Car Rental Software
    Custom Software Development
    Last edited by DoronF; 08-23-2017 at 12:15 PM.

  13. #13
    Member
    Real Name
    Richard Battle
    Join Date
    May 2017
    Location
    Austin,TX
    Posts
    30

    Default Re: What first step do you take when building tables from scratch?

    Thanks David and Doron. I wasted a lot of time trying it client side when it's server side stuff.

    In MySQL the time stamp is expression CURRENT_TIMESTAMP, and it autosaves date and time. Works like a charm!

  14. #14
    Member
    Real Name
    Edward paul
    Join Date
    Aug 2017
    Posts
    9

    Default Re: What first step do you take when building tables from scratch?

    Thanks Charles, for sharing such a great ideas…..!

  15. #15
    Member The Mage's Avatar
    Real Name
    William McGowen
    Join Date
    Jul 2010
    Location
    Nebraska
    Posts
    287

    Default Re: What first step do you take when building tables from scratch?

    This forum led me to this book, and I can't recommend it enough.


    database_design_for_mere_mortals_3rd_edition_j_hernandez(www.ebook-dl.com)_Large.jpg

Similar Threads

  1. NEW: 4 hour step by step course on building Web apps with ALPHA FIVE. August 6th 2010
    By Richard Rabins in forum Alpha Five Version 10 - Desktop Applications
    Replies: 0
    Last Post: 08-07-2010, 09:09 AM
  2. NEW: 4 hour step by step course on building Web apps with ALPHA FIVE. August 6th 2010
    By Richard Rabins in forum Application Server Version 8
    Replies: 0
    Last Post: 08-07-2010, 09:08 AM
  3. NEW: 4 hour step by step course on building Web apps with ALPHA FIVE. August 6th 2010
    By Richard Rabins in forum Application Server Version 9 - Web/Browser Applications
    Replies: 0
    Last Post: 08-07-2010, 09:08 AM
  4. NEW: 4 hour step by step course on building Web apps with ALPHA FIVE. August 6th
    By Richard Rabins in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 08-07-2010, 09:07 AM
  5. Replies: 0
    Last Post: 08-07-2010, 09:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •