The largest Interview Solution Library on the web


Interview Questions
« Previous | 0 | 1 | 2 | 3 | 4 | Next »

21.I get a compiler error if I use the SQLITE_OMIT_... compile-time options when building SQLite.

The SQLITE_OMIT_... compile-time options only work when building from canonical source files. They do not work when you build from the SQLite amalgamation or from the pre-processed source files.
It is possible to build a special amalgamation that will work with a predetermined set of SQLITE_OMIT_... options. Instructions for doing so can be found with the SQLITE_OMIT_... documentation.

22.My WHERE clause expression column1="column1" does not work. It causes every row of the table to be returned, not just the rows where column1 has the value "column1".?

Use single-quotes, not double-quotes, around string literals in SQL. This is what the SQL standard requires. Your WHERE clause expression should read: column1='column1'
SQL uses double-quotes around identifiers (column or table names) that contains special characters or which are keywords. So double-quotes are a way of escaping identifier names. Hence, when you say column1="column1" that is equivalent to column1=column1 which is obviously always true.

23.The SQL standard requires that a UNIQUE constraint be enforced even if one or more of the columns in the constraint are NULL, but SQLite does not do this. Isn't that a bug?

Perhaps you are referring to the following statement from SQL92:
A unique constraint is satisfied if and only if no two rows in a table have the same non-null values in the unique columns.
That statement is ambiguous, having at least two possible interpretations:

  • A unique constraint is satisfied if and only if no two rows in a table have the same values and have non-null values in the unique columns.

  • A unique constraint is satisfied if and only if no two rows in a table have the same values in the subset of unique columns that are not null.
SQLite follows interpretation (1), as does PostgreSQL, MySQL, Oracle, and Firebird. It is true that Informix and Microsoft SQL Server use interpretation (2), however we the SQLite developers hold that interpretation (1) is the most natural reading of the requirement and we also want to maximize compatibility with other SQL database engines, and most other database engines also go with (1), so that is what SQLite does.

24.What is the Export Control Classification Number (ECCN) for SQLite?

After careful review of the Commerce Control List (CCL), we are convinced that the core public-domain SQLite source code is not described by any ECCN, hence the ECCN should be reported as EAR99.
The above is true for the core public-domain SQLite. If you extend SQLite by adding new code, or if you statically link SQLite with your application, that might change the ECCN in your particular case.

25.My query does not return the column name that I expect. Is this a bug?

If the columns of your result set are named by AS clauses, then SQLite is guaranteed to use the identifier to the right of the AS keyword as the column name. If the result set does not use an AS clause, then SQLite is free to name the column anything it wants. See the sqlite3_column_name() documentation for further information.

26.Explain what is SQL LITE?

SQL LITE is a mostly ACID compliant relational database management system contained in a relatively small C programming library.

27.List out the standard SQL Lite commands?

The standard SQL Lite commands interact with relational databases are similar to SQL. They are

  • SELECT
  • CREATE
  • INSERT
  • UPDATE
  • DROP
  • DELETE
Based on their operational nature these commands can be classified.

28.Explain what is SQLite transactions?

The transaction is referred as a unit of work that is performed against a database. It is the propagation of one or more changes to the database. Properties of transactions are determined by ACID.

  • Atomicity:It ensures that all work unit are successfully completed
  • Consistency:It ensures that the database changes states upon a successfully committed transaction
  • Isolation:It enables transactions to operate independently of and transparent to each other
  • Durability:It ensures that the result or effect of a committed transaction persists in case of a system failure

29.List out the areas where SQL Lite works well?

SQL lite works well with

  • Embedded devices and the internet of things
  • Application file format
  • Data Analysis
  • Websites
  • Cache for enterprise data
  • Server side database
  • File archives
  • Internal or temporary databases
  • Replacement for ad hoc disk files
  • Experimental SQL language extensions
  • Stand-in for an enterprise database during demos or testing

30.What is the difference between SQL and SQL Lite?

SQLSQL Lite
SQL is a Structured Query Language SQL lite is a powerful, embedded relational database management system mostly used in mobile devices for data storage
SQL support stored procedures SQL lite does not support stored procedures
SQL is server based SQL lite is file based

31.List out the advantages of SQL Lite?

  • It does not require separate server processor system to operate
  • No setup or administration required SQlite comes with zero-configuration
  • An SQL Lite database can be stored in a single cross-platform disk file
  • SQL Lite is very compact less than 400 KiB
  • SQL Lite is self-contained, which means no external dependencies
  • It supports almost all types of O.S
  • It is written in ANSI-C and provides easy to use API

32.Mention what are the SQL lite storage classes?

SQL lite storage classes include

  • Null: The value is a NULL value
  • Integer: The value is a signed integer (1,2,3, etc.)
  • Real: The value is a floating point value, stored as an 8 byte IEEE floating point number
  • Text: The value is a text string, stored using the database encoding ( UTF-8, UTF-16BE)
  • BLOB (Binary Large Object): The value is a blob of data, exactly stored as it was input

33.Explain how Boolean values in SQL Lite are stored?

Boolean values in SQL lite are stored as integers 0 (false) and 1 (true). SQL Lite does not have a separate Boolean storage class.

34.Explain what is the use of SQLITE group by clause?

The SQLITE group by clause is used in collaboration with the SELECT statement to arrange identical data into groups.

35.Mention what is the command used to create a database in SQL lite?

To create a database in SQL lite- command “sqlite3” is used. The basic syntax to create a database is $sqlite3 DatabaseName.db .

36.Mention what is .dump command is used for?

The .dump command is used to make an SQLite database dump, remember once you use the dump command all your data will be dumped forever and cannot be retrieved.

37.Explain how can you delete or add columns from an existing table in SQLite?

There is a very limited support for alter ( add or delete ) table. In case if you want to delete or add columns from an existing table in SQLite you have to first save the existing data to a temporary table, drop the old table or column, create the new table and then copy the data back in from the temporary table.

38.Mention what is the maximum size of a VARCHAR in SQL Lite?

SQL Lite does not have any specific length for VARCHAR. For instance, you can declare a VARCHAR (10) and SQLite will store a 500 million character string there. It will keep all 500 characters intact.

39.Mention when to use SQLite and when not to use SQLite?

SQLite can be used in following conditions

  • Embedded applications: Does not require expansion like mobile applications or games
  • Disk assess replacement: Application that require to write or read files to disk directly
  • Testing: When testing business application logic When not to use SQL Lite
  • Multi-user applications: Where multiple client needs to access and use same database
  • Applications requiring high write volumes:It enables you to use only one single write operation to take place at any given time

40.Explain how to recover deleted data from my SQL Lite database?

To recover the information you can use your backup copy of your database file, but if you do not have a backup copy, then recovery is impossible. SQL Lite uses SQLITE SECURE DELETE option which overwrites all deleted content with zeroes.

« Previous | 0 | 1 | 2 | 3 | 4 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com