====== Oracle PL/SQL Naming Conventions ====== - **Variables**: * Local: prefix with ''l_'' (e.g., ''l_counter''). * Global: prefix with ''g_'' (for those declared in a package specification). - **Parameters**: * Prefix with ''p_'' (e.g., ''p_emp_id''). - **Cursors**: * Prefix with ''cur_'' (e.g., ''cur_employee''). - **Constants**: * Prefix with ''c_'' (e.g., ''c_max_value''). * Uppercase for constants (e.g., ''MAX_VALUE''). - **Types**: * Prefix with ''t_'' (e.g., ''t_employee_table'' for a table type). - **Exception**: * Prefix with ''ex_'' or ''err_'' (e.g., ''ex_no_data''). - **Records**: * Suffix with ''_rec'' or ''_type'' (e.g., ''employee_rec''). - **Arrays/Collections**: * Suffix with ''_tbl'' or ''_list'' (e.g., ''employee_list'' or ''employee_tbl''). - **Procedures/Functions**: * Procedures: use verbs (e.g., ''update_employee'', ''calculate_bonus''). * Functions: names reflecting return value (e.g., ''get_employee_salary''). - **Boolean variables**: * Prefix with ''is_'', ''has_'', or ''can_'' (e.g., ''is_valid'', ''has_records''). - **Tables/Views**: * Tables: use plural names (e.g., ''employees''). * Views: prefix with ''v_'' or suffix with ''_view'' (e.g., ''v_active_employees'', ''employee_summary_view''). - **Indexes**: * Prefix with ''idx_'' (e.g., ''idx_emp_name''). - **Triggers**: * Reflect timing and event (e.g., ''before_insert_emp''). - **Packages**: * Name based on functionality (e.g., ''pkg_employee_operations''). **Note:** The key to effective naming is consistency. Always apply your chosen conventions uniformly.