Category: SQL


SQL important concept (stay updating)


1. All record with null will not be a part of count.

2. Check if this value is null. Dont use null==null, use null is null.

3. The difference between IN and EXIST:

IN:

  • Works on List result set
  • Doesn’t work on subqueries resulting in Virtual tables with multiple columns
  • Compares every value in the result list
  • Performance is comparatively SLOW for larger resultset of subquery

EXISTS:

  • Works on Virtual tables
  • Is used with co-related queries
  • Exits comparison when match is found
  • Performance is comparatively FAST for larger resultset of subquery

4. What is Union and Union ALL

Union merges the contents of two structurally-compatible tables into a single combined table. The difference between Union and Union ALL is that Union will omit duplicate records whereas Union ALL will include duplicate records.

It is important to note that the performance of Union ALL will typically be better than Union , since Union requires the server to do the additional work of removing any duplicates. So, in cases where is is certain that there will not be any duplicates, or where having duplicates is not a problem, use of Union ALL would be recommended for performance reasons.

Learning from tasks and Merge Sort JavaScript


Do not use html tag to bind event straightaway. It will cause serious problem. Try to use class or Id

For writing JavaScript method or Jquery method, if we want to pass a element to a method, we use this.

Example:

function hello(element){

//do something with the element we just passes in we can use dom or jquery to have the access to this element

$(element).color(“red”)

//or

element.innerHTML = “Hi”

}

<button onclick=”hello(this)”>hello</button>

 

Also, for any ajax call (.get,.post,.ajax), we have to make sure all data we want to pass into a action in a controller should match the parameters of an action. Otherwise, the routing mechanism cannot locate that url.

 

Database design!- FamBam


Part of this database diagram is from my design! What a great achievement.

 

Social Media


Categories



All Posts



Contact Info