What's different between INDEX and KEY in database Tuesday, October 13, 2009

INDEX:
An index is a database feature used for locating data quickly within a table. Indexes are defined by selecting a set of commonly searched attribute(s) on a table and using the appropriate platform-specific mechanism to create an index.
for example, Personnel information may be store in a Human Resource department's employee table. Clerks find that they often search the table for employees by last name but get slow query responses. Defining an index on the table consisting of the last name attribute would speed up these queries.

KEY:
A database key is a attribute utilized to sort and/or identify data in some manner. Each table has a primary key which uniquely identifies records. Foriegn keys are utilized to cross-reference data between relational tables.



What means DDL, DML, TCL and DCL?

There're four catalogs in standard SQL language:

  1. DDL-----Data Defination Language
  2. DML-----Data Manipulation Language
  3. DCL------Data Control Language
  4. TCL------Transaction Language
The detaled information is as belowing 
1> The DDL includes
CREATE TABLE - creates new database table
ALTER TABLE - alters or changes the database table
DROP TABLE - deletes the database table
CREATE INDEX - creates an index or used as a search key
DROP INDEX - deletes an index 
2> The DML includes
SELECT - extracts data from the database
UPDATE - updates data in the database
DELETE - deletes data from the database
INSERT INTO - inserts new data into the database
3> The DCL includes
GRANT – gives access privileges to users for database
REVOKE – withdraws access privileges to users for database
4> The TCL includes
COMMIT – saves the work done
ROLLBACK - restore the database to original since the last COMMIT

Regarding how to use SQL, pls refer to this link. http://sql.1keydata.com/cn/  

使用Sqlitecc查看symbian sql 数据库

在symbian OS 9.5 上提供了sqlite api,用这些api 生成的数据库可以用sqlitecc打开。
sqlitecc是图形界面,可以在其中修改数据,很方便、直观

首先需要从sourceforge上下载sqlitecc,http://sqlitecc.sourceforge.net/
然后直接可以打开。打开后界面如下





listbox中使用svg图片

这些天尽管有源源不断的pr过来,但是还是有时间搞搞listbox。之所以搞这个是因为在NewLc上看到有不少人问类似的问题,而且我觉得在UI开发中Listbox经常用到。计划在一周内抽时间把S60上的所有标准listbox都深入研究一下。
今天在使用CAknSingleGraphicStyleListBox的时候,没有合适的icon用,正好手边有一些svg图片就试了一下,发现可以使用。这下好了svg图片可大可小,不用考虑尺寸问题。
如果用carbid c++ ide的话,可以直接用ide提供的功能编辑和创建mbm/mif文件。如下图所示启动编辑器















目前,我通过makefile文件生成mif文件。首先创建一个makefile文件icon.mk,然后在bld文件中加入
gnumakefile icon.mk

即可。 其实也可以在mmp文件中加入
prj_extensions
start extension s60/mifconc
option targetfile icon.mif
.....
option source ....
end
来替代那个makefile文件
SVG图片的使用方法不同于bmp。bmp通过bmpconv工具被整合为一个mbm(multi-bitmap)文件,这是symbian独有的文件格式。而svg通过mifconv工具整合为mif(MSX interchange format)文件,在Mif文件中也可以加入bmp。
由于mif的支持不是symbian提供的,所以用createiconl这样的方法只能加载mbm文件,不能加载mif文件,需要用aknsutils::creategulicon加载。加载后,使用方法跟通常一样。