From a46928168705fcc57762f4b3133f0b9673e07bfc Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Fri, 19 Jul 2024 10:36:58 -0300 Subject: [PATCH] dbt: add word_oecd_pisa.student --- models/world_oecd_pisa/schema.yml | 625 ++++++++++++++++++ .../world_oecd_pisa__student.sql | 375 +++++++++++ 2 files changed, 1000 insertions(+) create mode 100644 models/world_oecd_pisa/schema.yml create mode 100644 models/world_oecd_pisa/world_oecd_pisa__student.sql diff --git a/models/world_oecd_pisa/schema.yml b/models/world_oecd_pisa/schema.yml new file mode 100644 index 00000000..fc745b1d --- /dev/null +++ b/models/world_oecd_pisa/schema.yml @@ -0,0 +1,625 @@ +--- +version: 2 +models: + - name: world_oecd_pisa__student + description: This table includes contextual information, estimates of student + performance and parent-questionnaire data + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: [year, student_id] + columns: + - name: year + description: Year + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: country_id_iso_3 + description: Country ID ISO3 + tests: + - relationships: + to: ref('pais__sigla_pais_iso3') + field: sigla_pais_iso3.sigla_pais_iso3 + - name: country_id_m49 + description: Country Identifier + tests: + - relationships: + to: ref('pais__id_pais_m49') + field: id_pais_m49.id_pais_m49 + - name: school_id + description: School ID + - name: student_id + description: Student ID + - name: assessment_type + description: PISA Assessment Cycle (2 digits + 2 character Assessment type + - MS/FT) + - name: national_centre_code + description: National Centre 6-digit Code + - name: stratum + description: Stratum ID 7-character (cnt + region ID + original stratum ID) + - name: subregion + description: Adjudicated sub-region code 7-digit code (3-digit country code + + region ID + stratum ID) + - name: oecd + description: OECD country + - name: mode_respondent + description: Mode of Respondent + - name: language_questionnaire + description: Language of Questionnaire + - name: language_assessment + description: Language of Assessment + - name: form_id + description: Form Identifier + - name: international_grade + description: Student International Grade (Derived) + - name: month_birth + description: Student (Standardized) Birth - Month + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__ano') + field: ano.ano + - name: year_birth + description: Student (Standardized) Birth - Year + tests: + - relationships: + to: ref('br_bd_diretorios_data_tempo__mes') + field: mes.mes + - name: gender + description: Student (Standardized) Gender + - name: effort_put_into_test + description: How much effort did you put into this test? + - name: effort_would_have_invested + description: How much effort would you have invested? + - name: occupation_mother + description: ISCO-08 Occupation code - Mother + - name: occupation_father + description: ISCO-08 Occupation code - Father + - name: occupation_self + description: ISCO-08 Occupation code - Self + - name: grade_compared + description: Grade compared to modal grade in country + - name: age + description: Age + - name: national_study_programme + description: Unique national study programme code + - name: country_birth_self + description: Country of Birth National Categories- Self + - name: country_birth_mother + description: Country of Birth National Categories- Mother + - name: country_birth_father + description: Country of Birth National Categories- Father + - name: language_home + description: Language at home (3-digit code) + - name: isced_level + description: ISCED level + - name: isced_designation + description: ISCED designation + - name: isced_orientation + description: ISCED orientation + - name: mother_isced + description: Mothers Education (ISCED) + - name: father_isced + description: Fathers Education (ISCED) + - name: highest_parent_isced + description: Highest Education of parents (ISCED) + - name: highest_parent_years_schooling + description: Index highest parental education in years of schooling + - name: mother_isced_alternate_definition + description: Mothers Education - alternate definition (ISCED) + - name: father_isced_alternate_definition + description: Fathers Education - alternate definition (ISCED) + - name: highest_parent_isced_alternate_definition + description: Highest Education of parents - alternate definition (ISCED) + - name: highest_parent_international_years_schooling + description: Index highest parental education (international years of schooling + scale) + - name: mother_isei + description: ISEI of mother + - name: father_isei + description: ISEI of father + - name: index_highest_parent_occupation + description: Index highest parental occupational status + - name: index_immigration_status + description: Index Immigration status + - name: duration_early_childhood_education_care + description: Duration in early childhood education and care + - name: grade_repetition + description: Grade Repetition + - name: student_occupational_status + description: Students expected occupational status (SEI) + - name: learning_time_mathematics + description: Learning time (minutes per week) - + - name: learning_time_language + description: Learning time (minutes per week) - + - name: learning_time_science + description: Learning time (minutes per week) - + - name: learning_time_total + description: Learning time (minutes per week) - in total + - name: school_change + description: Number of school changes + - name: number_educational_change + description: Number of changes in educational biography (Sum) + - name: body_mass_index + description: Body mass index of student + - name: index_economic_social_cultural_status + description: Index of economic, social and cultural status + - name: meta_cognition_understanding_remembering + description: 'Meta-cognition: understanding and remembering' + - name: meta_cognition_summarising + description: 'Meta-cognition: summarising' + - name: meta_cognition_assess_credibility + description: 'Meta-cognition: assess credibility' + - name: ict_home + description: ICT available at home + - name: ict_school + description: ICT available at school + - name: wle_home_possessions + description: Home possessions index (WLE) + - name: wle_cultural_possessions + description: Cultural possessions at home index (WLE) + - name: wle_home_educational_resources + description: Home educational resources index (WLE) + - name: wle_family_wealth + description: Family wealth index (WLE) + - name: wle_ict_resources + description: ICT resources index (WLE) + - name: wle_teacher_support_language + description: Teacher support in test language lessons index (WLE) + - name: wle_perceived_feedback + description: Perceived feedback index (WLE) + - name: wle_perceived_parents_emotional_support + description: Parents' emotional support perceived by student index (WLE) + - name: wle_subjective_well_being_sense_belonging + description: 'Subjective well-being: Sense of belonging to school index (WLE)' + - name: wle_ict_use_outside_school_leisure + description: ICT use outside of school (leisure) index (WLE) + - name: wle_ict_use_outside_school_work + description: Use of ICT outside of school (for school work activities) index + (WLE) + - name: wle_ict_use_at_school + description: Use of ICT at school in general index (WLE) + - name: wle_ict_interest + description: Interest in ICT index (WLE) + - name: wle_ict_competence + description: Perceived ICT competence index (WLE) + - name: wle_ict_autonomy + description: Perceived autonomy related to ICT use index (WLE) + - name: wle_ict_social_interaction + description: ICT as a topic in social interaction index (WLE) + - name: wle_parental_support_learning + description: Current parental support for learning at home index (WLE) + - name: wle_parents_emotional_support + description: Parents' emotional support index (WLE) + - name: wle_parents_perceived_school_quality + description: Parents' perceived school quality index (WLE) + - name: wle_school_policies_parental_involvement + description: School policies for parental involvement index (WLE) + - name: wle_previous_parental_support_learning + description: Previous parental support for learning at home index (WLE) + - name: wle_disciplinay_climate_specific_domain + description: Disciplinary climate in specific domain (mathematics,science + or language) lessons (WLE) + - name: wle_teacher_directed_instruction + description: Teacher-directed instruction (WLE) + - name: wle_teacher_stimulation_reading + description: Teacher's stimulation of reading engagement perceived by student + (WLE) + - name: wle_adaptation_instruction + description: Adaptation of instruction (WLE) + - name: wle_perceived_teachers_interest + description: Perceived teacher's interest (WLE) + - name: wle_joy_reading + description: Joy/Like reading (WLE) + - name: wle_reading_self_concept_competence + description: 'Self-concept of reading: Perception of competence (WLE)' + - name: wle_reading_self_concept_difficulty + description: 'Self-concept of reading: Perception of difficulty (WLE)' + - name: wle_pisa_test_difficulty_perception + description: Perception of difficulty of the PISA test (WLE) + - name: wle_competitiveness_perception + description: Perception of competitiveness at school (WLE) + - name: wle_cooperation_perception + description: Perception of cooperation at school (WLE) + - name: wle_attitude_towards_school_learning_activities + description: 'Attitude towards school: learning activities (WLE)' + - name: wle_competitiveness + description: Competitiveness (WLE) + - name: wle_work_mastery + description: Work mastery (WLE) + - name: wle_general_fear_failure + description: General fear of failure (WLE) + - name: wle_eudaemonia + description: 'Eudaemonia: meaning in life (WLE)' + - name: wle_subjective_well_being_positive_affect + description: 'Subjective well-being: Positive affect (WLE)' + - name: wle_resilence + description: Resilience (WLE) + - name: wle_mastery_goal_orientation + description: Mastery goal orientation (WLE) + - name: wle_self_efficacy_regarding_global_issues + description: Self-efficacy regarding global issues (WLE) + - name: wle_students_awareness_global_issues + description: Student's awareness of global issues (WLE) + - name: wle_students_attitudes_towards_immigrants + description: Student's attitudes towards immigrants (WLE) + - name: wle_students_interest_learning_other_cultures + description: Student's interest in learning about other cultures (WLE) + - name: wle_perspective_taking + description: Perspective-taking (WLE) + - name: wle_cognitive_flexibility + description: Cognitive flexibility/adaptability (WLE) + - name: wle_respect_people_from_other_cultures + description: Respect for people from other cultures (WLE) + - name: wle_intercultural_communication_awareness + description: Awareness of intercultural communication (WLE) + - name: wle_global_mindedness + description: Global-mindedness (WLE) + - name: wle_discriminating_school_climate + description: Discriminating school climate (WLE) + - name: wle_students_experience_being_bullied + description: Student's experience of being bullied (WLE) + - name: wle_ict_use_during_lessons + description: Subject-related ICT use during lessons (WLE) + - name: wle_ict_use_outside_lessons + description: Subject-related ICT use outside of lessons (WLE) + - name: wle_carrer_information + description: Information about careers (WLE) + - name: wle_labour_market_information_by_school + description: Information about the labour market provided by the school (WLE) + - name: wle_labour_market_information_outside_school + description: Information about the labour market provided outside of school + (WLE) + - name: wle_financial_matters_confidence + description: Confidence about financial matters (WLE) + - name: wle_financial_matters_confidence_digital_devices + description: Confidence about financial matters using digital devices (WLE) + - name: wle_financial_education_school_lessons + description: Financial education in school lessons (WLE) + - name: wle_parents_involvement_financial_literacy + description: Parental involvement in matters of Financial Literacy (WLE) + - name: wle_parents_reading_enjoyment + description: Parents enjoyment of reading (WLE) + - name: wle_parents_attitudes_towards_immigrants + description: Parents' attitudes towards immigrants (WLE) + - name: wle_parents_interest_learking_other_cultures + description: Parents' interest in learning about other cultures (WLE) + - name: wle_parents_awareness_global_issues + description: Parents' awareness of global issues (WLE) + - name: wle_body_image + description: Body image (WLE) + - name: wle_parents_social_connections + description: 'Social Connections: Parents (WLE)' + - name: consider_perspective_before_position + description: "Agree/disagree: I try to consider everybody's perspective before\ + \ I take a position." + - name: understand_classmates_thinking + description: "Agree/disagree: I want to understand my classmates' ways of\ + \ thinking." + - name: view_things_different_angles + description: 'Agree/disagree: I can view almost all things from different + angles.' + - name: imagine_in_somebody_place + description: "Agree/disagree: I imagine how I would feel if I were in somebody\ + \ else's place." + - name: one_correct_position_disagreement + description: 'Agree/disagree: I think there is only one correct position in + a disagreement.' + - name: understand_why_people_behave + description: 'Agree/disagree: I want to understand why people behave the way + they do.' + - name: difficult_anticipate_others_think + description: 'Agree/disagree: I find it difficult to anticipate what other + people think.' + - name: envision_friends_points_of_view + description: "Agree/disagree: I try to envision how things look from my friends'\ + \ points of view" + - name: final_student_weight + description: Final trimmed nonresponse adjusted student weight + - name: student_weight_1 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 1 + - name: student_weight_2 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 2 + - name: student_weight_3 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 3 + - name: student_weight_4 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 4 + - name: student_weight_5 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 5 + - name: student_weight_6 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 6 + - name: student_weight_7 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 7 + - name: student_weight_8 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 8 + - name: student_weight_9 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 9 + - name: student_weight_10 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 10 + - name: student_weight_11 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 11 + - name: student_weight_12 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 12 + - name: student_weight_13 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 13 + - name: student_weight_14 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 14 + - name: student_weight_15 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 15 + - name: student_weight_16 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 16 + - name: student_weight_17 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 17 + - name: student_weight_18 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 18 + - name: student_weight_19 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 19 + - name: student_weight_20 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 20 + - name: student_weight_21 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 21 + - name: student_weight_22 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 22 + - name: student_weight_23 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 23 + - name: student_weight_24 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 24 + - name: student_weight_25 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 25 + - name: student_weight_26 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 26 + - name: student_weight_27 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 27 + - name: student_weight_28 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 28 + - name: student_weight_29 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 29 + - name: student_weight_30 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 30 + - name: student_weight_31 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 31 + - name: student_weight_32 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 32 + - name: student_weight_33 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 33 + - name: student_weight_34 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 34 + - name: student_weight_35 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 35 + - name: student_weight_36 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 36 + - name: student_weight_37 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 37 + - name: student_weight_38 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 38 + - name: student_weight_39 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 39 + - name: student_weight_40 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 40 + - name: student_weight_41 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 41 + - name: student_weight_42 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 42 + - name: student_weight_43 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 43 + - name: student_weight_44 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 44 + - name: student_weight_45 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 45 + - name: student_weight_46 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 46 + - name: student_weight_47 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 47 + - name: student_weight_48 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 48 + - name: student_weight_49 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 49 + - name: student_weight_50 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 50 + - name: student_weight_51 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 51 + - name: student_weight_52 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 52 + - name: student_weight_53 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 53 + - name: student_weight_54 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 54 + - name: student_weight_55 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 55 + - name: student_weight_56 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 56 + - name: student_weight_57 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 57 + - name: student_weight_58 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 58 + - name: student_weight_59 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 59 + - name: student_weight_60 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 60 + - name: student_weight_61 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 61 + - name: student_weight_62 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 62 + - name: student_weight_63 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 63 + - name: student_weight_64 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 64 + - name: student_weight_65 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 65 + - name: student_weight_66 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 66 + - name: student_weight_67 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 67 + - name: student_weight_68 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 68 + - name: student_weight_69 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 69 + - name: student_weight_70 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 70 + - name: student_weight_71 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 71 + - name: student_weight_72 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 72 + - name: student_weight_73 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 73 + - name: student_weight_74 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 74 + - name: student_weight_75 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 75 + - name: student_weight_76 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 76 + - name: student_weight_77 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 77 + - name: student_weight_78 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 78 + - name: student_weight_79 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 79 + - name: student_weight_80 + description: Final trimmed nonresponse adjusted student replicate BRR-Fay + weights 80 + - name: randomly_assigned_unit_number + description: Randomly assigned unit number + - name: randomized_final_variance_stratum + description: Randomized final variance stratum + - name: plausible_value_1_mathematics + description: Plausible Value 1 in Mathematics + - name: plausible_value_2_mathematics + description: Plausible Value 2 in Mathematics + - name: plausible_value_3_mathematics + description: Plausible Value 3 in Mathematics + - name: plausible_value_4_mathematics + description: Plausible Value 4 in Mathematics + - name: plausible_value_5_mathematics + description: Plausible Value 5 in Mathematics + - name: plausible_value_6_mathematics + description: Plausible Value 6 in Mathematics + - name: plausible_value_7_mathematics + description: Plausible Value 7 in Mathematics + - name: plausible_value_8_mathematics + description: Plausible Value 8 in Mathematics + - name: plausible_value_9_mathematics + description: Plausible Value 9 in Mathematics + - name: plausible_value_10_mathematics + description: Plausible Value 10 in Mathematics + - name: plausible_value_1_reading + description: Plausible Value 1 in Reading + - name: plausible_value_2_reading + description: Plausible Value 2 in Reading + - name: plausible_value_3_reading + description: Plausible Value 3 in Reading + - name: plausible_value_4_reading + description: Plausible Value 4 in Reading + - name: plausible_value_5_reading + description: Plausible Value 5 in Reading + - name: plausible_value_6_reading + description: Plausible Value 6 in Reading + - name: plausible_value_7_reading + description: Plausible Value 7 in Reading + - name: plausible_value_8_reading + description: Plausible Value 8 in Reading + - name: plausible_value_9_reading + description: Plausible Value 9 in Reading + - name: plausible_value_10_reading + description: Plausible Value 10 in Reading + - name: plausible_value_1_science + description: Plausible Value 1 in Science + - name: plausible_value_2_science + description: Plausible Value 2 in Science + - name: plausible_value_3_science + description: Plausible Value 3 in Science + - name: plausible_value_4_science + description: Plausible Value 4 in Science + - name: plausible_value_5_science + description: Plausible Value 5 in Science + - name: plausible_value_6_science + description: Plausible Value 6 in Science + - name: plausible_value_7_science + description: Plausible Value 7 in Science + - name: plausible_value_8_science + description: Plausible Value 8 in Science + - name: plausible_value_9_science + description: Plausible Value 9 in Science + - name: plausible_value_10_science + description: Plausible Value 10 in Science + - name: senate_weight + description: Senate Weight (sum of 5000 per country) + - name: date_database_creation + description: Date of the database creation diff --git a/models/world_oecd_pisa/world_oecd_pisa__student.sql b/models/world_oecd_pisa/world_oecd_pisa__student.sql new file mode 100644 index 00000000..4d1c1848 --- /dev/null +++ b/models/world_oecd_pisa/world_oecd_pisa__student.sql @@ -0,0 +1,375 @@ +{{ + config( + alias="student", + schema="world_oecd_pisa", + materialized="table", + partition_by={ + "field": "year", + "data_type": "int64", + "range": { + "start": 2015, + "end": 2022, + "interval": 1, + }, + }, + cluster_by=["country_id_iso_3"], + ) +}} + +select + safe_cast(year as int64) year, + safe_cast(country_id_iso_3 as string) country_id_iso_3, + safe_cast(country_id_m49 as string) country_id_m49, + safe_cast(school_id as string) school_id, + safe_cast(student_id as string) student_id, + safe_cast(assessment_type as string) assessment_type, + safe_cast(national_centre_code as string) national_centre_code, + safe_cast(stratum as string) stratum, + safe_cast(subregion as string) subregion, + safe_cast(oecd as string) oecd, + safe_cast(mode_respondent as string) mode_respondent, + safe_cast(language_questionnaire as string) language_questionnaire, + safe_cast(language_assessment as string) language_assessment, + safe_cast(form_id as string) form_id, + safe_cast(international_grade as string) international_grade, + safe_cast(month_birth as int64) month_birth, + safe_cast(year_birth as int64) year_birth, + safe_cast(gender as string) gender, + safe_cast(effort_put_into_test as string) effort_put_into_test, + safe_cast(effort_would_have_invested as int64) effort_would_have_invested, + safe_cast(occupation_mother as string) occupation_mother, + safe_cast(occupation_father as string) occupation_father, + safe_cast(occupation_self as string) occupation_self, + safe_cast(grade_compared as int64) grade_compared, + safe_cast(age as float64) age, + safe_cast(national_study_programme as string) national_study_programme, + safe_cast(country_birth_self as string) country_birth_self, + safe_cast(country_birth_mother as string) country_birth_mother, + safe_cast(country_birth_father as string) country_birth_father, + safe_cast(language_home as string) language_home, + safe_cast(isced_level as string) isced_level, + safe_cast(isced_designation as string) isced_designation, + safe_cast(isced_orientation as string) isced_orientation, + safe_cast(mother_isced as string) mother_isced, + safe_cast(father_isced as string) father_isced, + safe_cast(highest_parent_isced as string) highest_parent_isced, + safe_cast(highest_parent_years_schooling as int64) highest_parent_years_schooling, + safe_cast( + mother_isced_alternate_definition as string + ) mother_isced_alternate_definition, + safe_cast( + father_isced_alternate_definition as string + ) father_isced_alternate_definition, + safe_cast( + highest_parent_isced_alternate_definition as string + ) highest_parent_isced_alternate_definition, + safe_cast( + highest_parent_international_years_schooling as int64 + ) highest_parent_international_years_schooling, + safe_cast(mother_isei as float64) mother_isei, + safe_cast(father_isei as float64) father_isei, + safe_cast( + index_highest_parent_occupation as float64 + ) index_highest_parent_occupation, + safe_cast(index_immigration_status as string) index_immigration_status, + safe_cast( + duration_early_childhood_education_care as string + ) duration_early_childhood_education_care, + safe_cast(grade_repetition as string) grade_repetition, + safe_cast(student_occupational_status as float64) student_occupational_status, + safe_cast(learning_time_mathematics as int64) learning_time_mathematics, + safe_cast(learning_time_language as int64) learning_time_language, + safe_cast(learning_time_science as int64) learning_time_science, + safe_cast(learning_time_total as int64) learning_time_total, + safe_cast(school_change as string) school_change, + safe_cast(number_educational_change as int64) number_educational_change, + safe_cast(body_mass_index as float64) body_mass_index, + safe_cast( + index_economic_social_cultural_status as float64 + ) index_economic_social_cultural_status, + safe_cast( + meta_cognition_understanding_remembering as float64 + ) meta_cognition_understanding_remembering, + safe_cast(meta_cognition_summarising as float64) meta_cognition_summarising, + safe_cast( + meta_cognition_assess_credibility as float64 + ) meta_cognition_assess_credibility, + safe_cast(ict_home as int64) ict_home, + safe_cast(ict_school as int64) ict_school, + safe_cast(wle_home_possessions as float64) wle_home_possessions, + safe_cast(wle_cultural_possessions as float64) wle_cultural_possessions, + safe_cast(wle_home_educational_resources as float64) wle_home_educational_resources, + safe_cast(wle_family_wealth as float64) wle_family_wealth, + safe_cast(wle_ict_resources as float64) wle_ict_resources, + safe_cast(wle_teacher_support_language as float64) wle_teacher_support_language, + safe_cast(wle_perceived_feedback as float64) wle_perceived_feedback, + safe_cast( + wle_perceived_parents_emotional_support as float64 + ) wle_perceived_parents_emotional_support, + safe_cast( + wle_subjective_well_being_sense_belonging as float64 + ) wle_subjective_well_being_sense_belonging, + safe_cast( + wle_ict_use_outside_school_leisure as float64 + ) wle_ict_use_outside_school_leisure, + safe_cast( + wle_ict_use_outside_school_work as float64 + ) wle_ict_use_outside_school_work, + safe_cast(wle_ict_use_at_school as float64) wle_ict_use_at_school, + safe_cast(wle_ict_interest as float64) wle_ict_interest, + safe_cast(wle_ict_competence as float64) wle_ict_competence, + safe_cast(wle_ict_autonomy as float64) wle_ict_autonomy, + safe_cast(wle_ict_social_interaction as float64) wle_ict_social_interaction, + safe_cast(wle_parental_support_learning as float64) wle_parental_support_learning, + safe_cast(wle_parents_emotional_support as float64) wle_parents_emotional_support, + safe_cast( + wle_parents_perceived_school_quality as float64 + ) wle_parents_perceived_school_quality, + safe_cast( + wle_school_policies_parental_involvement as float64 + ) wle_school_policies_parental_involvement, + safe_cast( + wle_previous_parental_support_learning as float64 + ) wle_previous_parental_support_learning, + safe_cast( + wle_disciplinay_climate_specific_domain as float64 + ) wle_disciplinay_climate_specific_domain, + safe_cast( + wle_teacher_directed_instruction as float64 + ) wle_teacher_directed_instruction, + safe_cast( + wle_teacher_stimulation_reading as float64 + ) wle_teacher_stimulation_reading, + safe_cast(wle_adaptation_instruction as float64) wle_adaptation_instruction, + safe_cast( + wle_perceived_teachers_interest as float64 + ) wle_perceived_teachers_interest, + safe_cast(wle_joy_reading as float64) wle_joy_reading, + safe_cast( + wle_reading_self_concept_competence as float64 + ) wle_reading_self_concept_competence, + safe_cast( + wle_reading_self_concept_difficulty as float64 + ) wle_reading_self_concept_difficulty, + safe_cast( + wle_pisa_test_difficulty_perception as float64 + ) wle_pisa_test_difficulty_perception, + safe_cast(wle_competitiveness_perception as float64) wle_competitiveness_perception, + safe_cast(wle_cooperation_perception as float64) wle_cooperation_perception, + safe_cast( + wle_attitude_towards_school_learning_activities as float64 + ) wle_attitude_towards_school_learning_activities, + safe_cast(wle_competitiveness as float64) wle_competitiveness, + safe_cast(wle_work_mastery as float64) wle_work_mastery, + safe_cast(wle_general_fear_failure as float64) wle_general_fear_failure, + safe_cast(wle_eudaemonia as float64) wle_eudaemonia, + safe_cast( + wle_subjective_well_being_positive_affect as float64 + ) wle_subjective_well_being_positive_affect, + safe_cast(wle_resilence as float64) wle_resilence, + safe_cast(wle_mastery_goal_orientation as float64) wle_mastery_goal_orientation, + safe_cast( + wle_self_efficacy_regarding_global_issues as float64 + ) wle_self_efficacy_regarding_global_issues, + safe_cast( + wle_students_awareness_global_issues as float64 + ) wle_students_awareness_global_issues, + safe_cast( + wle_students_attitudes_towards_immigrants as float64 + ) wle_students_attitudes_towards_immigrants, + safe_cast( + wle_students_interest_learning_other_cultures as float64 + ) wle_students_interest_learning_other_cultures, + safe_cast(wle_perspective_taking as float64) wle_perspective_taking, + safe_cast(wle_cognitive_flexibility as float64) wle_cognitive_flexibility, + safe_cast( + wle_respect_people_from_other_cultures as float64 + ) wle_respect_people_from_other_cultures, + safe_cast( + wle_intercultural_communication_awareness as float64 + ) wle_intercultural_communication_awareness, + safe_cast(wle_global_mindedness as float64) wle_global_mindedness, + safe_cast( + wle_discriminating_school_climate as float64 + ) wle_discriminating_school_climate, + safe_cast( + wle_students_experience_being_bullied as float64 + ) wle_students_experience_being_bullied, + safe_cast(wle_ict_use_during_lessons as float64) wle_ict_use_during_lessons, + safe_cast(wle_ict_use_outside_lessons as float64) wle_ict_use_outside_lessons, + safe_cast(wle_carrer_information as float64) wle_carrer_information, + safe_cast( + wle_labour_market_information_by_school as float64 + ) wle_labour_market_information_by_school, + safe_cast( + wle_labour_market_information_outside_school as float64 + ) wle_labour_market_information_outside_school, + safe_cast( + wle_financial_matters_confidence as float64 + ) wle_financial_matters_confidence, + safe_cast( + wle_financial_matters_confidence_digital_devices as float64 + ) wle_financial_matters_confidence_digital_devices, + safe_cast( + wle_financial_education_school_lessons as float64 + ) wle_financial_education_school_lessons, + safe_cast( + wle_parents_involvement_financial_literacy as float64 + ) wle_parents_involvement_financial_literacy, + safe_cast(wle_parents_reading_enjoyment as float64) wle_parents_reading_enjoyment, + safe_cast( + wle_parents_attitudes_towards_immigrants as float64 + ) wle_parents_attitudes_towards_immigrants, + safe_cast( + wle_parents_interest_learking_other_cultures as float64 + ) wle_parents_interest_learking_other_cultures, + safe_cast( + wle_parents_awareness_global_issues as float64 + ) wle_parents_awareness_global_issues, + safe_cast(wle_body_image as float64) wle_body_image, + safe_cast(wle_parents_social_connections as float64) wle_parents_social_connections, + safe_cast( + consider_perspective_before_position as string + ) consider_perspective_before_position, + safe_cast(understand_classmates_thinking as string) understand_classmates_thinking, + safe_cast(view_things_different_angles as string) view_things_different_angles, + safe_cast(imagine_in_somebody_place as string) imagine_in_somebody_place, + safe_cast( + one_correct_position_disagreement as string + ) one_correct_position_disagreement, + safe_cast(understand_why_people_behave as string) understand_why_people_behave, + safe_cast( + difficult_anticipate_others_think as string + ) difficult_anticipate_others_think, + safe_cast( + envision_friends_points_of_view as string + ) envision_friends_points_of_view, + safe_cast(final_student_weight as float64) final_student_weight, + safe_cast(student_weight_1 as float64) student_weight_1, + safe_cast(student_weight_2 as float64) student_weight_2, + safe_cast(student_weight_3 as float64) student_weight_3, + safe_cast(student_weight_4 as float64) student_weight_4, + safe_cast(student_weight_5 as float64) student_weight_5, + safe_cast(student_weight_6 as float64) student_weight_6, + safe_cast(student_weight_7 as float64) student_weight_7, + safe_cast(student_weight_8 as float64) student_weight_8, + safe_cast(student_weight_9 as float64) student_weight_9, + safe_cast(student_weight_10 as float64) student_weight_10, + safe_cast(student_weight_11 as float64) student_weight_11, + safe_cast(student_weight_12 as float64) student_weight_12, + safe_cast(student_weight_13 as float64) student_weight_13, + safe_cast(student_weight_14 as float64) student_weight_14, + safe_cast(student_weight_15 as float64) student_weight_15, + safe_cast(student_weight_16 as float64) student_weight_16, + safe_cast(student_weight_17 as float64) student_weight_17, + safe_cast(student_weight_18 as float64) student_weight_18, + safe_cast(student_weight_19 as float64) student_weight_19, + safe_cast(student_weight_20 as float64) student_weight_20, + safe_cast(student_weight_21 as float64) student_weight_21, + safe_cast(student_weight_22 as float64) student_weight_22, + safe_cast(student_weight_23 as float64) student_weight_23, + safe_cast(student_weight_24 as float64) student_weight_24, + safe_cast(student_weight_25 as float64) student_weight_25, + safe_cast(student_weight_26 as float64) student_weight_26, + safe_cast(student_weight_27 as float64) student_weight_27, + safe_cast(student_weight_28 as float64) student_weight_28, + safe_cast(student_weight_29 as float64) student_weight_29, + safe_cast(student_weight_30 as float64) student_weight_30, + safe_cast(student_weight_31 as float64) student_weight_31, + safe_cast(student_weight_32 as float64) student_weight_32, + safe_cast(student_weight_33 as float64) student_weight_33, + safe_cast(student_weight_34 as float64) student_weight_34, + safe_cast(student_weight_35 as float64) student_weight_35, + safe_cast(student_weight_36 as float64) student_weight_36, + safe_cast(student_weight_37 as float64) student_weight_37, + safe_cast(student_weight_38 as float64) student_weight_38, + safe_cast(student_weight_39 as float64) student_weight_39, + safe_cast(student_weight_40 as float64) student_weight_40, + safe_cast(student_weight_41 as float64) student_weight_41, + safe_cast(student_weight_42 as float64) student_weight_42, + safe_cast(student_weight_43 as float64) student_weight_43, + safe_cast(student_weight_44 as float64) student_weight_44, + safe_cast(student_weight_45 as float64) student_weight_45, + safe_cast(student_weight_46 as float64) student_weight_46, + safe_cast(student_weight_47 as float64) student_weight_47, + safe_cast(student_weight_48 as float64) student_weight_48, + safe_cast(student_weight_49 as float64) student_weight_49, + safe_cast(student_weight_50 as float64) student_weight_50, + safe_cast(student_weight_51 as float64) student_weight_51, + safe_cast(student_weight_52 as float64) student_weight_52, + safe_cast(student_weight_53 as float64) student_weight_53, + safe_cast(student_weight_54 as float64) student_weight_54, + safe_cast(student_weight_55 as float64) student_weight_55, + safe_cast(student_weight_56 as float64) student_weight_56, + safe_cast(student_weight_57 as float64) student_weight_57, + safe_cast(student_weight_58 as float64) student_weight_58, + safe_cast(student_weight_59 as float64) student_weight_59, + safe_cast(student_weight_60 as float64) student_weight_60, + safe_cast(student_weight_61 as float64) student_weight_61, + safe_cast(student_weight_62 as float64) student_weight_62, + safe_cast(student_weight_63 as float64) student_weight_63, + safe_cast(student_weight_64 as float64) student_weight_64, + safe_cast(student_weight_65 as float64) student_weight_65, + safe_cast(student_weight_66 as float64) student_weight_66, + safe_cast(student_weight_67 as float64) student_weight_67, + safe_cast(student_weight_68 as float64) student_weight_68, + safe_cast(student_weight_69 as float64) student_weight_69, + safe_cast(student_weight_70 as float64) student_weight_70, + safe_cast(student_weight_71 as float64) student_weight_71, + safe_cast(student_weight_72 as float64) student_weight_72, + safe_cast(student_weight_73 as float64) student_weight_73, + safe_cast(student_weight_74 as float64) student_weight_74, + safe_cast(student_weight_75 as float64) student_weight_75, + safe_cast(student_weight_76 as float64) student_weight_76, + safe_cast(student_weight_77 as float64) student_weight_77, + safe_cast(student_weight_78 as float64) student_weight_78, + safe_cast(student_weight_79 as float64) student_weight_79, + safe_cast(student_weight_80 as float64) student_weight_80, + safe_cast(randomly_assigned_unit_number as int64) randomly_assigned_unit_number, + safe_cast( + randomized_final_variance_stratum as int64 + ) randomized_final_variance_stratum, + safe_cast(plausible_value_1_mathematics as float64) plausible_value_1_mathematics, + safe_cast(plausible_value_2_mathematics as float64) plausible_value_2_mathematics, + safe_cast(plausible_value_3_mathematics as float64) plausible_value_3_mathematics, + safe_cast(plausible_value_4_mathematics as float64) plausible_value_4_mathematics, + safe_cast(plausible_value_5_mathematics as float64) plausible_value_5_mathematics, + safe_cast(plausible_value_6_mathematics as float64) plausible_value_6_mathematics, + safe_cast(plausible_value_7_mathematics as float64) plausible_value_7_mathematics, + safe_cast(plausible_value_8_mathematics as float64) plausible_value_8_mathematics, + safe_cast(plausible_value_9_mathematics as float64) plausible_value_9_mathematics, + safe_cast(plausible_value_10_mathematics as float64) plausible_value_10_mathematics, + safe_cast(plausible_value_1_reading as float64) plausible_value_1_reading, + safe_cast(plausible_value_2_reading as float64) plausible_value_2_reading, + safe_cast(plausible_value_3_reading as float64) plausible_value_3_reading, + safe_cast(plausible_value_4_reading as float64) plausible_value_4_reading, + safe_cast(plausible_value_5_reading as float64) plausible_value_5_reading, + safe_cast(plausible_value_6_reading as float64) plausible_value_6_reading, + safe_cast(plausible_value_7_reading as float64) plausible_value_7_reading, + safe_cast(plausible_value_8_reading as float64) plausible_value_8_reading, + safe_cast(plausible_value_9_reading as float64) plausible_value_9_reading, + safe_cast(plausible_value_10_reading as float64) plausible_value_10_reading, + safe_cast(plausible_value_1_science as float64) plausible_value_1_science, + safe_cast(plausible_value_2_science as float64) plausible_value_2_science, + safe_cast(plausible_value_3_science as float64) plausible_value_3_science, + safe_cast(plausible_value_4_science as float64) plausible_value_4_science, + safe_cast(plausible_value_5_science as float64) plausible_value_5_science, + safe_cast(plausible_value_6_science as float64) plausible_value_6_science, + safe_cast(plausible_value_7_science as float64) plausible_value_7_science, + safe_cast(plausible_value_8_science as float64) plausible_value_8_science, + safe_cast(plausible_value_9_science as float64) plausible_value_9_science, + safe_cast(plausible_value_10_science as float64) plausible_value_10_science, + safe_cast(senate_weight as float64) senate_weight, + safe_cast( + case + when regexp_contains(date_database_creation, r'^\d{2}[A-Z]{3}\d{2}$') + then parse_timestamp('%d%b%y', date_database_creation) + when + regexp_contains( + date_database_creation, r'^\s*\d{2}[A-Z]{3}\d{2}:\d{2}:\d{2}:\d{2}$' + ) + then parse_timestamp('%d%b%y:%H:%M:%S', trim(date_database_creation)) + else null + end as date + ) as date_database_creation +from `basedosdados-staging.world_oecd_pisa_staging.student` as t