= Relational Design = == Notation == * Primary keys are bolded and underlined. * Foreign keys are marked with `*` at the end of their name and the referenced entity is written in parentheses. * Required (not optional) attributes are bolded. == Tables == 1. '''users''' ('''**__id__**''', '''username''', '''password''', '''email''') 2. '''admins''' ('''**__user_id__**'''* (Users)) 3. '''components''' ('''**__id__**''', '''name''', '''brand''', '''price''', '''type''', img_url) 4. '''cpu''' ('''**__component_id__**'''* (Components), '''socket''', '''cores''', '''threads''', '''base_clock''', boost_clock, '''tdp''') 5. '''gpu''' ('''**__component_id__**'''* (Components), '''vram''', '''tdp''', base_clock, boost_clock, '''chipset''', '''length''') 6. '''memory''' ('''**__component_id__**'''* (Components), '''type''', '''speed''', '''capacity''', '''modules''') 7. '''storage''' ('''**__component_id__**'''* (Components), '''type''', '''capacity''', '''form_factor''') 8. '''power_supply''' ('''**__component_id__**'''* (Components), '''type''', '''wattage''', '''form_factor''') 9. '''motherboard''' ('''**__component_id__**'''* (Components), '''socket''', '''chipset''', '''form_factor''', '''ram_type''', '''num_ram_slots''', '''max_ram_capacity''', '''pci_express_slots''') 10. '''pc_case''' ('''**__component_id__**'''* (Components), '''cooler_max_height''', '''gpu_max_length''') 11. '''case_storage_form_factors''' ('''**__case_id__**'''*(PC_Case), '''**__form_factor__**''', **num_slots**) 12. '''case_ps_form_factors''' ('''**__case_id__**'''*(PC_Case), '''**__form_factor__**''') 13. '''case_mobo_form_factors''' ('''**__case_id__**'''*(PC_Case), '''**__form_factor__**''') 14. '''cooler''' ('''**__component_id__**'''* (Components), '''type''', '''height''', '''max_tdp_supported''') 15. '''cooler_cpu_sockets''' ('''**__cooler_id__**'''*(Cooler), '''**__socket__**''') 16. '''memory_card''' ('''**__component_id__**'''* (Components), '''num_slots''', '''interface''') 17. '''optical_drive''' ('''**__component_id__**'''* (Components), '''form_factor''', '''type''', '''interface''', '''write_speed''', '''read_speed''') 18. '''sound_card''' ('''**__component_id__**'''* (Components), '''sample_rate''', '''bit_depth''', '''chipset''', '''interface''', '''channel''') 19. '''cables''' ('''**__component_id__**'''* (Components), '''length_cm''', '''type''') 20. '''network_adapter''' ('''**__component_id__**'''* (Components), '''wifi_version''', '''interface''', '''num_antennas''') 21. '''network_card''' ('''**__component_id__**'''* (Components), '''num_ports''', '''speed''', '''interface''') 22. '''build''' ('''**__id__**''', '''user_id'''* (Users), '''name''', '''created_at''', description, '''total_price''', '''is_approved''') 23. '''build_component''' ('''**__build_id__**'''*(Build), '''**__component_id__**'''*(Component), num_components) 24. '''favorite_build''' ('''**__build_id__**'''*(Build), '''**__user_id__**'''*(Users)) 25. '''rating_build''' ('''**__build_id__**'''*(Build), '''**__user_id__**'''*(Users), '''value''') 26. '''review''' ('''**__id__**''', '''build_id'''* (Build), '''user_id'''* (Users), '''content''', '''created_at''') 27. '''suggestions''' ('''**__id__**''', '''user_id'''* (Users), admin_id* (Admins), '''link''', admin_comment, description, '''status''', '''component_type''') == DDL script for creating the database schema == [attachment:schema_creation.sql] == DML script for filling tables with data == [attachment:data_load.sql] == Relational diagram == [[Image(image.png, width=1000, height=620)]]