Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 DATABASE


  SQL Grammar Summary

整理了一下,希望对大家有用SQL语句大全  --语 句 功 能--数据操作SELECT --从数据库表中检索数据行和列INSERT --向数据库表添加新数据行DELETE --从数据库表中删除数据行UPDATE --更新数据库表中的数据--数据定义CREATE TABLE --创建一个数据库...

4,034 1       SQL QUERY SUMMARY SELECT UPDATE DELETE I


  <=> operator in MySQL

Have you ever seen "<=>" in a SQL query while using MySQL? Does it mean less and equals to and greater than? Actually if you consider it as the union of <= and =>, great, you are close to it. This is one form of equal operator in MySQL, it has the similar meaning to the = operator with some subtle difference.According to MySQL documentation, <=> is NULL-safe equal. This operator performs an equality comparison like the = operator, but returns 1 rather than NULL if both operands are NULL, and 0 rather than NULL if one operand is NULL.For example:mysql> SELECT 1 <=> 1,...

3,977 2       MYSQL NULL SAFE <=>


  20 Database Design Best Practices

Use well defined and consistent names for tables and columns (e.g. School, StudentCourse, CourseID ...).Use singular for table names (i.e. use StudentCourse instead of StudentCourses). Table represents a collection of entities, there is no need for plural names.Don’t use spaces for table names. Otherwise you will have to use ‘{‘, ‘[‘, ‘“’ etc. characters to define tables (i.e. for accesing table Student Course you'll write “Student Course”. StudentCourse is much better).Don’t use unnecessary prefixes or suffixes for table nam...

3,899 0       DATABASE DESIGN 20 TIPS WELL DEFINED NAME DESIGN PATTERN


  Guide on recovering data in MySQL

In our daily work, there might be mistakes made which got some data or even databases deleted in MySQL. If this happens on production, it would be a nightmare. In case this happens, normally DBA would jump in to save the world. And they would try to recover the data from the backup if there is any. But if there is no backup, then the show stops.Hence database backup is necessary on production environments to avoid such awkward situation. Also normally in MySQL, binlog should be enabled as well in ROW mode so that recovery can be replayed starting from the backup time point to the incident time...

3,593 0       BINLOG EXAMPLE DATABASE MYSQL BACKUP


  Database Testing – Practical Tips and Insight on How to Test Database

Database is one of the inevitable parts of a software application these days. It does not matter at all whether it is web or desktop, client server or peer to peer, enterprise or individual business, database is working at backend. Similarly, whether it is healthcare of finance, leasing or retail, mailing application or controlling spaceship, behind the scene a database is always in action.Moreover, as the complexity of application increases the need of stronger and secure database emerges. In the same way, for the applications with high frequency of transactions (e.g. banking or finance appli...

3,555 0       TIPS DATABASE PRACTICE


  Removing duplicates in sql

In modern web development, it’s standard practice to make use of a database abstraction layer, typically an Object-Relational Mapper based on either the Active Record pattern or the Data Mapper pattern. There are several pros and cons to this which are fairly well established, so I’ll spare us all from enumerating them all right now.One established pro worth mentioning is that these systems typically provide a high level interface for fetching data, often removing the need to ‘hand write’ SQL for anything but the most complex of query.As good as this sounds it h...

3,407 0       SQL WEB DESIGN DUPLICATE REMOVE


  Three things you should never put in your database

As I've said in a few talks, the best way to improve your systems is by first notdoing "dumb things". I don't mean you or your development staff is "dumb", it'seasy to overlook the implications of these types of decisions and not realize howbad they are for maintainability let alone scaling. As a consultant I see this stuffall of the time and I have yet to ever see it work out well for anyone.Images, files, and binary dataYour database supports BLOBs so it must be a good idea to shove your files in thereright? No it isn't! Hell it isn't even very convenient to use with many DB languagebindings...

3,297 0       DATABASE IMAGE LOG BLOB


  Do You Make These 5 Database Design Mistakes?

Look, everyone makes mistakes. It’s true. But not all of us have the chance to make mistakes that end up costing millions of dollars in hardware and production support costs.Any one of the following five mistakes listed below will add additional costs to your company. It’s guaranteed. The costs could be hardware related (extra disk space, network bandwidth), which tend to add up quickly. The costs are also support related (bad performance, database re-design, report creation, etc.), and they add up very quickly.Want to save your company some money, some headaches for yo...

3,266 0       ADVICE COMPATIBILITY DATABASE DESIGN MISTAKE DATA TYPE