LearningToTalk / L2TDatabase

Helper functions for working with our lab's MySQL database
GNU General Public License v2.0
0 stars 0 forks source link

re-organize database #62

Closed tjmahr closed 7 years ago

tjmahr commented 7 years ago

The database has been growing table by table, but now it's a little unwieldy. There are 24 tables of raw data. These can't be used out of the box without running a query to connect Research ID to the data. There are 11 queries that can be used out of the box. They all start with q_.

# list all the tbls in the database
src_tbls(l2t)
#>  [1] "BRIEF"                             
#>  [2] "Blending_Admin"                    
#>  [3] "Blending_Responses"                
#>  [4] "Caregiver"                         
#>  [5] "Caregiver_Entry"                   
#>  [6] "Child"                             
#>  [7] "ChildStudy"                        
#>  [8] "EVT"                               
#>  [9] "FruitStroop"                       
#> [10] "GFTA"                              
#> [11] "Household"                         
#> [12] "LENA_Admin"                        
#> [13] "LENA_Hours"                        
#> [14] "Literacy"                          
#> [15] "MinPair_Admin"                     
#> [16] "MinPair_Responses"                 
#> [17] "PPVT"                              
#> [18] "RealWordRep_Admin"                 
#> [19] "SAILS_Admin"                       
#> [20] "SAILS_Responses"                   
#> [21] "SES"                               
#> [22] "SES_Entry"                         
#> [23] "Study"                             
#> [24] "VerbalFluency"                     

#> [25] "q_Household_Education"             
#> [26] "q_Household_Maternal_Caregiver"    
#> [27] "q_Household_Max_Maternal_Education"
#> [28] "q_LENA_Averages"                   
#> [29] "q_MinPair_Aggregate"               
#> [30] "q_SAILS_Aggregate"                 
#> [31] "q_SAILS_ModulesPropCorrect"        
#> [32] "q_SAILS_PropCorrect"               
#> [33] "q_Scores_TimePoint1"               
#> [34] "q_Scores_TimePoint2"               
#> [35] "q_Scores_TimePoint3"

To make things more user-friendly, I'm going to split the database into an l2t database with queries that are ready-to-use for each test type and study. So the EVT table is this database will have Study, ResearchID, and the usual EVT scores ready to go. I will make a backend database with the raw data that populates the queries for the l2t database. This will basically break all my previous scripts and queries, but it'll be worth it.