
















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

















































































Question 1. Which of the following byte sequences identifies the SQLite magic header at the beginning of every database file? A) 0x53 0x51 0x4C 0x B) 0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x C) 0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x D) 0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x20 0x Answer: C Explanation: The first 16 bytes of a SQLite file contain the ASCII string âSQLite format 3\000â. The first 8 bytes are âSQLite â (0x53 0x51 0x4C 0x69 0x74 0x65 0x20 0x20). Question 2. In the SQLite file header, which twoâbyte field specifies the size of a database page? A) Bytes 16â 17 B) Bytes 18â 19 C) Bytes 20â 21 D) Bytes 22â 23 Answer: B Explanation: Bytes 16â17 of the header store the page size as a bigâendian 16âbit integer. Typical values are 1024, 4096, etc. Question 3. What does a value of 0xFFFFFFFF in the âFile Change Counterâ field of the header indicate? A) The database is readâonly B) No changes have ever been made C) The counter has overflowed D) The database is corrupted Answer: C
Explanation: The change counter increments with each commit; when it exceeds the maximum 32 âbit value it wraps to 0xFFFFFFFF, signalling overflow. Question 4. Which SQLite page type stores only key/value cells and never has child pointers? A) Interior Bâtree page B) Leaf Bâtree page C) Overflow page D) Freelist page Answer: B Explanation: Leaf pages contain the actual table or index entries and have no child page numbers. Question 5. In a Bâtree index page, what does the âpayload sizeâ field of a cell represent? A) Length of the key only B) Length of the rowid only C) Combined size of the key and the rowid D) Size of the overflow data pointer Answer: C Explanation: Index cells store the key (indexed column) plus the rowid that points back to the table row; the payload size covers both. Question 6. Which SQLite version introduced the âWALâ (WriteâAhead Logging) mode? A) 2. B) 3. C) 3. D) 3. Answer: C
Answer: A Explanation: SQLite supports âLIMIT n OFFSET mâ. âLIMIT 10 OFFSET 0â returns the first ten rows. Question 10. Which operator allows pattern matching of any number of characters in a WHERE clause? A) % B) * C)? D) # Answer: A Explanation: In SQLiteâs LIKE operator, â%â matches zero or more characters. Question 11. Which of the following expressions evaluates to TRUE for rows where column x is either 5, 7, or 9? A) x = 5 OR 7 OR 9 B) x IN (5,7,9) C) x BETWEEN 5 AND 9 D) x LIKE â[5,7,9]â Answer: B Explanation: The IN operator checks membership against a list of values. Question 12. To group rows by a column and calculate the total of another column, which clause must appear after GROUP BY? A) HAVING B) ORDER BY C) WHERE
Answer: A Explanation: HAVING filters aggregated groups and must follow GROUP BY. Question 13. Which aggregate function returns the maximum value of a numeric column? A) MAX() B) BIGGEST() C) HIGH() D) TOP() Answer: A Explanation: MAX() is the standard SQLite aggregate for the largest value. Question 14. In a relational join, which keyword specifies that all rows from the left table must appear, even if there is no matching row on the right? A) INNER B) LEFT OUTER C) CROSS D) NATURAL Answer: B Explanation: LEFT OUTER JOIN (or simply LEFT JOIN) preserves all leftâtable rows. Question 15. Which join type produces a Cartesian product of two tables? A) INNER JOIN B) LEFT JOIN C) CROSS JOIN
Answer: B Explanation: Cocoa/Apple timestamps count seconds since 2001â 01 â01 00:00:00 UTC. Question 19. In Chromeâs âWebKitâ timestamp format, the unit is: A) Seconds B) Milliseconds C) Microseconds D) Nanoseconds Answer: B Explanation: WebKit timestamps store milliseconds since 1601â 01 â01. Question 20. Which SQLite function extracts a substring starting at position 3 with length 5? A) substr(column,3,5) B) substring(column,3,5) C) mid(column,3,5) D) left(column,5) Answer: A Explanation: SQLiteâs substr(X,Y,Z) returns Z characters beginning at offset Y (1âbased). Question 21. To remove leading and trailing spaces from a text column, which function is used? A) trim() B) strip() C) ltrim() only D) rtrim() only
Answer: A Explanation: trim() removes both leading and trailing whitespace. Question 22. Which CASE expression correctly maps a numeric status column (0 = Unread, 1 = Read) to text? A) CASE status WHEN 0 THEN âUnreadâ WHEN 1 THEN âReadâ END B) CASE WHEN status = 0 THEN âUnreadâ WHEN status = 1 THEN âReadâ END C) Both A and B are valid D) Neither A nor B are valid Answer: C Explanation: SQLite supports both simple CASE and searched CASE syntaxes. Question 23. The purpose of the -journal file in rollback mode is to: A) Store all committed transactions permanently B) Hold pages that are being written before the commit completes C) Keep a copy of the entire database for backup D) Record only schema changes Answer: B Explanation: The rollback journal contains âhotâ pages that have been modified but not yet committed, enabling rollback on failure. Question 24. In WAL mode, which file contains the sharedâmemory map used for coordinating readers and writers? A) databaseâwal B) databaseâshm C) databaseâjournal
C) Transaction logs from the WAL file D) Encryption keys Answer: B Explanation: Deleted rows leave their payload in freeblocks or unallocated space until overwritten. Question 28. Which of the following best describes an âoverflow pageâ in SQLite? A) A page that contains the Bâtree root B) A page that stores large column values which do not fit on the original leaf page C) A page that holds the journal data D) A page used exclusively for freeblock tracking Answer: B Explanation: When a cellâs payload exceeds the space on its leaf page, the excess is stored on overflow pages chained together. Question 29. In Androidâs sms.db, which table typically stores the actual text messages? A) messages B) sms C) conversations D) threads Answer: B Explanation: The sms table holds each SMS record; the threads table manages conversation grouping. Question 30. Which column in iOS CallHistory.db indicates whether a call was incoming, outgoing, or missed? A) direction
B) type C) flags D) status Answer: B Explanation: The type column uses numeric codes (1 = incoming, 2 = outgoing, 3 = missed). Question 31. Chromiumâs History database stores URLs in which table? A) urls B) visits C) downloads D) favicons Answer: A Explanation: The urls table contains each distinct URL with metadata; the visits table links timestamps to URLs. Question 32. To retrieve the most recent 5 Chrome history entries, which ORDER BY clause is appropriate? A) ORDER BY last_visit_time ASC B) ORDER BY last_visit_time DESC C) ORDER BY url ASC D) ORDER BY title DESC Answer: B Explanation: DESC sorts from newest to oldest; combined with LIMIT 5 yields the latest entries. Question 33. Which SQLite function can be used to convert a Chromium WebKit timestamp to a readable date?
Question 36. When a row is deleted, SQLite may leave a âpointer mapâ entry. What does this map point to? A) The location of the deleted rowâs payload in the freeblock list B) The parent page of the deleted cell C) The overflow page chain start D) The next free page number Answer: D Explanation: In WAL mode, the pointer map tracks free pages for reuse; a deleted pageâs entry points to the next free page. Question 37. Which SQLite keyword is used to rename a column without altering the data? A) ALTER TABLE ⌠RENAME COLUMN ⌠TO ⌠B) MODIFY COLUMN ⌠C) CHANGE COLUMN ⌠D) UPDATE COLUMN NAME ⌠Answer: A Explanation: SQLite supports ALTER TABLE ⌠RENAME COLUMN ⌠TO ⌠syntax. Question 38. The sqlite_sequence table is automatically created when which feature is used? A) WITHOUT ROWID tables B) AUTOINCREMENT primary key C) Triggers D) Virtual tables Answer: B Explanation: AUTOINCREMENT creates sqlite_sequence to keep track of the largest ROWID.
Question 39. Which of the following statements about SQLiteâs âWITHOUT ROWIDâ tables is true? A) They store the primary key in the Bâtree leaf payload instead of a hidden ROWID column B) They cannot have any indexes C) They are always stored in a separate file D) They require the use of the WAL journal mode Answer: A Explanation: WITHOUT ROWID tables use the primary key as the Bâtree key, eliminating the hidden ROWID. Question 40. In forensic analysis, why is it important to examine the -shm file when a database is in WAL mode? A) It contains encrypted copies of the database pages B) It holds the lock table that reveals concurrent reader/writer activity C) It stores the entire transaction log for the last 24 hours D) It lists all deleted rows explicitly Answer: B Explanation: The - shm file includes the sharedâmemory lock table, which can show whether readers were active while a write occurred. Question 41. Which SQLite function can be used to concatenate two text strings? A) concat() B) || (double pipe) operator C) join() D) plus() Answer: B Explanation: The || operator concatenates strings in SQLite.
Question 45. In SQLite, which data type affinity will store a numeric value as text if the value cannot be losslessly represented as an integer or real? A) INTEGER B) REAL C) NUMERIC D) TEXT Answer: C Explanation: NUMERIC affinity attempts to store as INTEGER or REAL; if conversion fails, it stores the original text. Question 46. Which SQLite function can be used to test whether a column contains a JSON object? A) json_valid() B) json_is_object() C) is_json() D) json_check() Answer: A Explanation: json_valid() returns 1 if the argument is wellâformed JSON. Question 47. When a Bâtree leaf page becomes empty after deletions, SQLite may perform which operation? A) Page splitting B) Page merging (coalescing) with a sibling C) Page promotion to the root D) Page reallocation to the freelist only after a checkpoint Answer: B
Explanation: SQLite merges underfull leaf pages with neighboring siblings to maintain balance. Question 48. Which pragma returns the current schema version number stored in the database header? A) PRAGMA schema_version; B) PRAGMA user_version; C) PRAGMA database_version; D) PRAGMA file_version; Answer: A Explanation: PRAGMA schema_version reports the version stored in the header, incremented by ALTER statements. Question 49. The user_version pragma is typically used by applications to: A) Store the SQLite engine version B) Record a custom version number for the applicationâs data model C) Indicate the number of active connections D) Track the number of WAL checkpoints performed Answer: B Explanation: Applications set PRAGMA user_version to embed their own schema version. Question 50. In a forensic timeline, why is it important to convert timestamps from the Cocoa epoch to UTC? A) Cocoa timestamps are stored in local time, causing ambiguity across time zones B) Converting to UTC normalizes data from multiple devices for correlation C) SQLite cannot compare Cocoa timestamps without conversion D) Cocoa timestamps include daylightâsaving offsets automatically
D) PRAGMA db_info; Answer: A Explanation: PRAGMA database_list returns name, file, and other info for each attached DB. Question 54. In a forensic context, why might an investigator examine the sqlite_stat1 table? A) It contains the original CREATE statements B) It holds statistics used by the query planner that can reveal typical query patterns C) It logs every INSERT operation performed on the database D) It stores the list of deleted rows Answer: B Explanation: sqlite_stat1 contains histogram data that can indicate column value distributions, useful for understanding data usage. Question 55. Which of the following best describes a âpartial indexâ in SQLite? A) An index that only includes rows satisfying a WHERE clause B) An index that spans multiple tables C) An index that is stored on overflow pages D) An index that is automatically dropped after a checkpoint Answer: A Explanation: Partial indexes index only rows meeting a specified predicate. Question 56. To retrieve the schema definition of a table named contacts, which query is correct? A) SELECT sql FROM sqlite_master WHERE type='table' AND name='contacts'; B) PRAGMA table_schema('contacts'); C) SELECT * FROM sqlite_schema WHERE tbl_name='contacts';
D) Both A and C (SQLite 3.33+ supports sqlite_schema) Answer: D Explanation: Both sqlite_master and sqlite_schema (an alias) store the CREATE statement. Question 57. Which SQLite function can be used to compute the MD5 hash of a string? A) md5() B) hash_md5() C) There is no builtâin MD5 function; a userâdefined function is required D) crypto_md5() Answer: C Explanation: SQLite does not include MD5; you must load an extension or implement a custom function. Question 58. When a database is opened with the PRAGMA journal_mode = MEMORY, where is the rollback journal stored? A) In a temporary file on disk B) In RAM only, disappearing when the connection closes C) In the - wal file D) In the - shm file Answer: B Explanation: MEMORY mode keeps the journal in volatile memory. Question 59. Which SQLite pragma can be used to set the maximum size of the WAL file before an automatic checkpoint is forced? A) PRAGMA wal_autocheckpoint; B) PRAGMA max_wal_size;