Presentation is loading. Please wait.

Presentation is loading. Please wait.

Table ‘reports’ id docid path val created_at 1 /root/title ‘report A’

Similar presentations


Presentation on theme: "Table ‘reports’ id docid path val created_at 1 /root/title ‘report A’"— Presentation transcript:

1 Table ‘reports’ id docid path val created_at 1 /root/title ‘report A’
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’ id docid path val created_at 1 /root/title ‘report A’ :20:36 2 /root/author ‘kaneko’ 3 /root/date ‘2009/11/29’ PRIMARY KEY Fig. Logical Structure of the Table

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

3

4 Record Header Record Data Database Image

5 Database Header SQLite Database File

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

7 Record(1, ‘/root/title’, ‘report A’)
Keys Associated Records 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)


Download ppt "Table ‘reports’ id docid path val created_at 1 /root/title ‘report A’"

Similar presentations


Ads by Google