Jiangws's Blog

  • About

How to clear dns cache? November 30th, 2011

In Microsoft Windows: In Microsoft Windows, you can use the command ipconfig /flushdns to flush the DNS resolver cache.
– Start -> Run -> type cmd – In command prompt, type C:>ipconfig /flushdns

In Mac OSX: In Mac OSX, you …

Posted in Web Hosting || Comments Off on How to clear dns cache?
Recursive Relationships November 15th, 2011

Recursive relationships: relationships exist between entity instances of the same type.

One-to-one: If we were to track which employees were married to other employees, we would expect each to be married to either zero or one other employee at any …

Posted in DATABASE, ORACLE, SQLSERVER || Comments Off on Recursive Relationships
多对多必须通过单独的一张表来表示 November 15th, 2011

如班级和教师的关系由三张表来表示:班级表,教师 及 班级教师表

In particular, the logical model does not contain any many-to-many relationships. There is a simple rationale for this difference – relational databases do not directly support many-to-many relationships, so they must be transformed using an intersection entity.…

Posted in DATABASE, ORACLE, SQLSERVER || Comments Off on 多对多必须通过单独的一张表来表示
About Count November 11th, 2011

select count(*) FROM [AdventureWorks].[Person].[Contact]

select COUNT(MiddleName) from [AdventureWorks].[Person].[Contact]

select COUNT(distinct MiddleName) from [AdventureWorks].[Person].[Contact]


Posted in ORACLE, SQLSERVER || Comments Off on About Count
Cursors in SQL November 6th, 2011

SQL was designed as a set-oriented processing language. Some business rules( or poor physical design) require performing actions on row-by-row basis. Consider the following example:
. Increase the price of books <=$15 by 15%
. Decrease the price of books …

Posted in DATABASE, ORACLE, SQLSERVER || Comments Off on Cursors in SQL
View – With Check Option November 2nd, 2011

Creating a view using With Check Option will restrict the queries to only those rows directly visible by the view.

It prevents row from dissappearing from the view implementing this option.
drop table  T100
drop view  VT100

Posted in DATABASE, ORACLE, SQLSERVER || Comments Off on View – With Check Option
Basic Rules of Normalization November 1st, 2011

Without going into a dissertation on data modeling(itself a subject of many full-length treatises), tables should follow basic rules of normalization:

Avoid duplicate data, avoid repeating groups in tables, and only put data in tables where the information is directly

Posted in DATABASE, ORACLE, SQLSERVER || Comments Off on Basic Rules of Normalization