Skip to main content

Posts

Showing posts from March, 2017

Writing A Good Query

When it comes to reading code no body will like to read a wall of text specially in programming. Some of the best practices to make query code readable, as well as easier to understand, is to follow clean formatting rules throughout your SQL query. Some good practices to write a good query is:  - Use comments to describe what SQL does. If you’re modifying existing SQL, add the author’s name, the date, describe the modifications, and avoid questions. Don’t overdo it and comment on the obvious - Put each major SQL statement on a new line - Use CamelCase capitalization and do not separate name parts with underscores: TableName, instead of Table_name, or use lower case and underscores to separate name parts: table_name - Set standard abbreviations for frequently used objects, such as tbl for tables, or sp for stored procedures - Use single quotation for characters, strings, binary and Unicode – - Use indenting to align wrapped long lines - Use parentheses in complex mathemati

Importance of Database Security

Database security is highly important because it prevents data loss, leakage, or unauthorized access to sensitive data. A few of many ways to secure a database is by making sure the hosting machine is housed, secured, locked and monitored to prevent unauthorized entry, access or theft. Apart from physical security the database should have firewalls implemented with default rules to deny all traffic, only opened to specific applications or web servers. User database roles and management is another security need of a database system. This implements access to only authorized users, and minimal permissions are given to each job function. Database backup and recovery is another important piece of database security. This prevents data loss keeping a copy of the database when in need. Keeping backup and recovery procedures documented and periodically is a good practice. Another security need of a database is encryption and key management,  allowing data to be encrypted during transmission