摘要:
写代码时大家都会使用缩进(indentation)和对齐(alignment),这是两个相关而又不同的概念,两者都是为了提高代码的可读性。缩进出现在一行的最左边,目的是明显地区分开包含与被包含的代码;对齐则是为了使代码美观、整洁。下例中,类的两个成员变量相对于类名来说具有一级缩进;两个变量的注释部分采用了对齐显示。它使用了Tab(假设一个Tab等于8个空格的大小)来缩进和对齐,一块绿色表示一个Tab。同样的代码,在另一个开发人员的机器上(一个Tab等于4个空格的大小)打开可能就不再对齐:造成这一现象的原因是代码的对齐使用了Tab,而不同编辑器的Tab键大小设置不一样。因此下一个Tab stop
阅读全文
posted @ 2013-09-18 18:55
莫水千流
阅读(1814)
推荐(0)
编辑
摘要:
A primary key is defined as a column or a group of column that their value are always be unique. Normally, NULL value will never be allowed in this column to be part of this column’s records.EXAMPLE :Let’s say we want to create a table name Users. The PRIMARY KEY will be user_id for that table. SQL
阅读全文
posted @ 2013-09-18 14:48
莫水千流
阅读(1924)
推荐(0)
编辑
摘要:
ROUP BY clause is used to associate an aggregate function with groups of rows. The SQL GROUP BY clause is used along with the SQL aggregate functions like SUM, COUNT, MAX, MIN, and AVG to provide means of grouping the result by refer to certain database table column.The SQL syntax for GROUP BY ...
阅读全文
posted @ 2013-09-18 14:10
莫水千流
阅读(267)
推荐(0)
编辑
摘要:
The HAVING clause is used in combination with the GROUP BY clause and the SQL aggregate functions. HAVING clause allows us to call the data conditionally on the column that return from using the SQL aggregate functions.The SQL HAVING syntax is simple and looks like this:SELECT [COLUMN NAME 1] , AGG.
阅读全文
posted @ 2013-09-18 14:10
莫水千流
阅读(339)
推荐(0)
编辑
摘要:
After being learn through all the displaying data syntax. It’s time to learn how to sort data by using ORDER BY.Yes it is. ORDER BY clause allows you to sort the records in your result set. This clause can only be used in SELECT statements. The ORDER BY clause sorts the result set based on the colum
阅读全文
posted @ 2013-09-18 14:08
莫水千流
阅读(732)
推荐(0)
编辑
摘要:
n relational database, Index will be the important mechanism for boosting performance. Index is important like Index for a book that helps you quickly find the pages that you wanted to read, index on the column speeds data retrieval.CREATE INDEX Statement will look like this:CREATE [UNIQUE] INDEX [I
阅读全文
posted @ 2013-09-18 14:00
莫水千流
阅读(271)
推荐(0)
编辑
摘要:
There are two types of aliases that are used most frequently in SQL command: which is column alias and table alias.Why ALIAS? There is some reasons alias to be use when querying a SQL command.- alias in a long query can make your query easier to read and understand- alias table is use when using a s
阅读全文
posted @ 2013-09-18 13:59
莫水千流
阅读(491)
推荐(0)
编辑
摘要:
here are some additional clause in the SQL language that can be used to simplify queries by decrease the use of the single Operator repeatly. One of them is IN clause.IN clause is used to simplify the queries if you want to select data that meet a large number of options. That means IN function help
阅读全文
posted @ 2013-09-18 13:58
莫水千流
阅读(814)
推荐(0)
编辑