2013-07-18

SQL四種語言:DDL,DML,DCL,TCL

1.DDLData Definition Language)數據庫定義語言statements are used to define the database structure or schema.
DDLSQL語言的四大功能之一。
用於定義數據庫的三級結構,包括外模式、概念模式、內模式及其相互之間的映像,定義數據的完整性、安全控制等約束
DDL不需要commit.
CREATE
ALTER
DROP
TRUNCATE
COMMENT
RENAME

2.DMLData Manipulation Language)數據操縱語言statements are used for managing data within schema objects.
DBMS提供,用於讓用戶或程序員使用,實現對數據庫中數據的操作。
DML分成交互型DML和嵌入型DML兩類。
依據語言的級別,DML又可分成過程性DML和非過程性DML兩種。
需要commit.
SELECT
INSERT
UPDATE
DELETE
MERGE
CALL
EXPLAIN PLAN
LOCK TABLE

3.DCLData Control Language)數據庫控制語言授權,角色控制等
GRANT 授權
REVOKE 取消授權

4.TCLTransaction Control Language)事務控制語言
SAVEPOINT 設置保存點
ROLLBACK 回滾
SET TRANSACTION
SQL主要分成四部分:
1)數據定義。 SQL DDL)用於定義SQL模式、基本表、視圖和索引的創建和撤消操作。
2)數據操縱。 SQL DML)數據操縱分成數據查詢和數據更新兩類。數據更新又分成插入、刪除、和修改三種操作。
3)數據控制。包括對基本表和視圖的授權,完整性規則的描述,事務控制等內容。

4)嵌入式SQL的使用規定。涉及到SQL語句嵌入在宿主語言程序中使用的規則。

2013-05-31

Windows Vista/ Windows 7/ Windows 8 上使用 WebDAV

Use WebDav in Windows Vista/ Windows 7/ Windows 8

1) Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WebClient\Parameters

2) Modify BasicAuthLevel value to 2

3) Go to Control Panel\All Control Panel Items\Administrative Tools\Services

4) Restart WebClient

5) Connect WebDav
a) Use net use command
b) Right click computer -> add a network location

2013-04-09

重設Linux密碼

Reset Password in GRUB bootloader (CentOS)

  1. Select the kernel
  2. Press "e" key to edit the entry
  3. Select the line starting with the word "kernel"
  4. Press "e" key to edit kernel entry
  5. Append the letter "s" (or "Single") to the end of the line
  6. Press "ENTER" key
  7. Press the "b" key to boot the Linux kernel into single user mode
  8. type "passwd" with user name to change password
  9. type "sync"
  10. type "reboot"

2013-01-24

Get 2 Digits Hour in Dos Command



set hh=%TIME: =0%
set hh=%hh:~0,2%
echo %hh%

MySQL5.0 UTF8 Setting


Edit /etc/my.cnf


[mysqld] max_allowed_packet=64M
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

2012-11-13

複製轉移Putty個人設定檔

Copy / Transfer Putty Configuration File / Profile

首先,你必需有權限執行登錄檔編輯程式。
First of all, You may have both computers administrative right to execute registry editor.

開始 -> 執行 -> 輸入 "regedit.exe" -> OK
Windows + R -> input "regedit.exe" -> OK

前往
Go to HKEY_CURRENT_USER\Software\SimonTatham

右擊"SimonTatham" -> 輸出 -> 儲存
Right Click on "SimonTatham" -> Export -> save

複製輸出的登錄檔到另一部電腦,然後開啟/執行
Copy the output file to other computer, and then double click to import it.

現在你成功地將Putty的設定轉移到另一部電腦!
Now, you putty setting is transfer to another computer!

2012-10-24

Enable Root Login in Fedora GUI

1. Open terminal
2. su - root
3. vi /etc/pam.d/gdm-password
4. add ## to comment auth required pam_succeed_if.so user != root quiet

2012-09-06

Excel圖表顯示隱藏的列欄儲存格

Microsoft Excel Display Hidden Row Column Cell data in Chart

Office 2003
Tools --> Options --> Charts --> Active chart --> uncheck "Plot visible cells only"
工具 --> 選項 --> 圖表 --> 使用中圖表 --> 剔除 「只繪製可見儲存格」

Office 2007
Right click the chart --> Select Data --> Click "Hidden and Empty Cell Settings" --> Check "Show data in hidden rows and columns"

在圖表上用滑鼠單擊右鍵 --> 選取資料

點擊「隱藏和空白儲存格」

剔選「顥示隱藏列和欄中的資料」-->確定

2012-07-27

開啓/關閉網際網路選項的「連線」選項

Enable/Disable Connection Tab in Internet Options

首先你使用的帳戶是本機系統管理員的身份才可以做到開關網際網路選項。
First of all, you make sure your account under administrator group of local machine, so that you can enable or disable internet options

一) 首先執行登錄檔修改器,按"Windows + R" -> 輸入"regedit.exe"


二) 前往 "Computer -> HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel"
三) 建立一個叫 "ConnectionsTab" 的 DWORD 檔
四) 0 -> 開,1->關

1) Execute registry editor, press "Windows + R" -> Input "regedit.exe"
2) Go to "Computer -> HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel"
3) Create a DWORD file named "ConnectionsTab"
4) 0 -> Enable, 1 -> Disable


Result:
0 - Enable

1 - Disable

如何修改Windows7的hosts table

How to modify hosts table in Windows 7?

Windows 7 hosts table location 位置:
C:\Windows\System32\drivers\etc\hosts


如何直接開啓檔案修改,儲存的時候就會出現存取被拒
IF you are modify the hosts table file directly, windows will warn you "Access is denied".


因此你需要先用系統管理員權限執行一些可以修改 hosts table 的程式,例如 Notepad。
用滑鼠右擊一下一個該程式,然後點「以系統管理員身份執行」。
Therefore you should use administrator right to run editor. For example, right click notepad and then choose "Run as administrator".

Finally, you can save now.

2012-06-18

如何在Windows7開啟HP打印機自動雙面列印功能

How to enable HP printer automatic duplex printing function in Windows 7

1) Go to Control Panel -> Devices and Printers -> Double HP Printer

2) Click "Customize your printer" in Printer Actions
2a) Or right click printer -> click "Printer properties"


3) Click the tab "Device Settings" -> Expand "Installable Options" -> Select "Installed" in "Duplex Unit (for 2-Sided Printing)

4) Now you can "Print on Both Sides"


Review Who is Connected to Windows Shared Folder

  1. Open Computer Management Console     Windows Key + R -> compmgmt.msc      2. Expand System Tools -> Shared Folder -> Sessions ...