explicit and implicit inner joins

http://stackoverflow.com/questions/44917/explicit-vs-implicit-sql-joins

  • Performance wise, they are exactly the same
  • the join syntax makes it clearer that the tables are joined and how they are joined

INNER JOIN: return rows when there is at least one match in both tables

LEFT JOIN: return ows from the left table, even there is no match in the right table

FULL JOIN: return rows where there is a match in one of the tables

SQL HAVING Syntax

SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name conditions
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
=================================

http://stackoverflow.com/questions/44917/explicit-vs-implicit-sql-joins

  • Performance wise, they are exactly the same
  • the join syntax makes it clearer that the tables are joined and how they are joined

INNER JOIN: return rows when there is at least one match in both tables

LEFT JOIN: return ows from the left table, even there is no match in the right table

FULL JOIN: return rows where there is a match in one of the tables

SQL HAVING Syntax

SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name conditions
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
=================================

http://stackoverflow.com/questions/44917/explicit-vs-implicit-sql-joins

  • Performance wise, they are exactly the same
  • the join syntax makes it clearer that the tables are joined and how they are joined

INNER JOIN: return rows when there is at least one match in both tables

LEFT JOIN: return ows from the left table, even there is no match in the right table

FULL JOIN: return rows where there is a match in one of the tables

SQL HAVING Syntax

SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name conditions
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
=================================
Advertisements

human communication

  • communication is the same important as work quality
  • Don’t focus on your narrowed space; Do think big, think deep, think more, think earlier
  • improve and solve problems rather than avoid them
  • if you made a mistake, just admit that you did by saying “got it and I will make the change”
  • Don’t judge a person even you don’t like him/her.
  • If the way of doing something is different from yours or even wrong, first ask “why are you doing this way”.

union in sql

The UNION operator is used to combine the result-set of two or more SELECT statements.

  • combine the results/rows; not the columns, so the columns must also have similar data types, and the columns in each SELECT statement must be in the same order.
  • use union all if allow duplicate values (same rows)

URL

In the World Wide Web, a query string is the part of a Uniform Resource Locator (URL) that contains data to be passed to web applications

A typical URL containing a query string is as follows:

The main use of query strings is to contain the content of an HTML form, also known as web form. In particular, when a form containing the fields field1, field2, field3 is submitted, the content of the fields is encoded as a query string as follows:

field1=value1&field2=value2&field3=value3...

Example

If a form is embedded in an HTML page as follows:

<form action="cgi-bin/test.cgi" method="get">
  <input type="text" name="first">
  <input type="text" name="second">
  <input type="submit">
</form>

and the user inserts the strings “this is a field” and “was it clear (already)?” in the two text fields and presses the submit button, the program test.cgi will receive the following query string:

first=this+is+a+field&second=was+it+clear+%28already%29%3F