1 / 7

CREATE TABLE reports ( id INTEGER PRIMARY KEY , docid INTEGER, path TEXT,

CREATE TABLE reports ( id INTEGER PRIMARY KEY , docid INTEGER, path TEXT, val TEXT ); INSERT INTO reports ( 1 , 1, ‘/root/title’, ‘report A’); INSERT INTO reports ( 2 , 1, ‘/root/author’, ‘kaneko’); INSERT INTO reports ( 3 , 1, ‘/root/date’, ‘2009/11/29’);.

mingan
Télécharger la présentation

CREATE TABLE reports ( id INTEGER PRIMARY KEY , docid INTEGER, path TEXT,

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CREATE TABLE reports ( id INTEGER PRIMARY KEY, docid INTEGER, path TEXT, val TEXT ); INSERT INTO reports (1, 1, ‘/root/title’, ‘report A’); INSERT INTO reports (2, 1, ‘/root/author’, ‘kaneko’); INSERT INTO reports (3, 1, ‘/root/date’, ‘2009/11/29’); ■ The attribute ‘id’ is the PRIMARY KEY The ‘id’ is key that can be used to identify each row. Table ‘reports’ PRIMARY KEY Fig. Logical Structure of the Table

  2. Table ‘reports’ PRIMARY KEY Logical Structure Associated Records Keys link 1 Record(1, ‘/root/title’, ‘report A’, ‘2009-12-11 11:20:36’) link 2 Record(2, ‘/root/author’, ‘kaneko’, ‘2009-12-11 11:20:36’) link 3 Record(3, ‘/root/date’, ‘2009/11/29’, ‘2009-12-11 11:20:36’) Each key is associated with each record. Physical Structure Fig. Logical Structure and Physical Structure

  3. Record Header Record Data Database Image

  4. Database Header SQLite Database File

  5. SQLite 3 データベースヘッダ に格納されている情報の例 Page size: 04 00 Database encoding: 00 00 00 01 ※ UTF-8: 01 little-endian UTF-16: 02 big-endian UTF-16: 03

  6. Associated Records Keys link 1 Record(1, ‘/root/title’, ‘report A’) link 2 Record(2, ‘/root/author’, ‘kaneko’) link 3 Record(3, ‘/root/date’, ‘2009/11/29’) Each key is associated with each record. Fig. Physical Structure of the Table Record Length (Note that record length is variable) Fig. Database File Layout Example (SQLite 3)

More Related