= 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''', 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''') 10. '''PC_Case''' ('''**__component_id__**'''* (Components), '''cooler_max_height''', '''gpu_max_length''') 11. '''Case_Storage_Form_Factors''' ('''**__case_id__**''', '''**__form_factor__**''') 12. '''Case_PS_Form_Factors''' ('''**__case_id__**''', '''**__form_factor__**''') 13. '''Case_Mobo_Form_Factors''' ('''**__case_id__**''', '''**__form_factor__**''') 14. '''Cooler''' ('''**__component_id__**'''* (Components), '''type''', '''height''', '''max_tdp_supported''') 15. '''Cooler_CPU_Sockets''' ('''**__cooler_id__**''', '''**__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''') 19. '''Sound_Card_Channels''' ('''**__sound_card_id__**''', '''**__channel__**''') 20. '''Cables''' ('''**__component_id__**'''* (Components), '''length_cm''', '''type''') 21. '''Network_Adapter''' ('''**__component_id__**'''* (Components), '''wifi_version''', '''interface''', '''num_antennas''') 22. '''Network_Card''' ('''**__component_id__**'''* (Components), '''num_ports''', '''speed''', '''interface''') 23. '''Build''' ('''**__id__**''', '''user_id'''* (Users), '''name''', '''created_at''', description, '''total_price''', '''is_approved''') 24. '''Build_Component''' ('''**__build_id__**''', '''**__component_id__**''') 25. '''Favorite_Build''' ('''**__build_id__**''', '''**__user_id__**''') 26. '''Rating_Build''' ('''**__build_id__**''', '''**__user_id__**''', '''value''') 27. '''Review''' ('''**__id__**''', '''build_id'''* (Build), '''user_id'''* (Users), '''content''', '''created_at''') 28. '''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(relational-diagram.png)]]