SQLITE

{
  "iq":[{"id":"1",
    "q":"what is SQLite?",
    "answer":"SQLite is a mostly ACID compliant relational database management system contained in a relatively small C programming library."
  },
    {"id":"2",
      "q":"List out the standard SQLite commands?",
      "answer":"The standard SQLite commands interact with relational databases are similar to SQL.  They are\n\nSELECT\n\nCREATE\n\nINSERT\n\nUPDATE\n\nDROP\n\nDELETE "
    },
    {"id":"3",
      "q":"Explain what is SQLite transactions?",
      "answer":"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.\n\nAtomicity: It ensures that all work unit are successfully completed\n\nConsistency: It ensures that the database changes states upon a successfully committed transaction\n\nIsolation: It enables transactions to operate independently of and transparent to each other\n\nDurability: It ensures that the result or effect of a committed transaction persists in case of a system failure"
    },

    {"id":"4",
      "q":"What Data Types Does Sqlite Support?",

      "answer":"SQLite uses dynamic typing. Content can be stored as INTEGER, REAL, TEXT, BLOB, or as NULL."
    },
    {"id":"5",
      "q":"List Out The Areas Where Sqlite Works Well?",
      "answer":"Embedded devices and the internet of things.\n\nApplication file format.\n\nData Analysis.\n\nWebsites.\n\nCache for enterprise data.\n\nServer side database.\n\nFile archives.\n\nInternal or temporary databases.\n\nReplacement for ad hoc disk files.\n\nExperimental SQL language extensions.\n\nStand-in for an enterprise database during demos or testing."
    },
    {"id":"6",
      "q":"What Is The Difference Between Sql And Sqlite?",
      "answer":"\n\nSQL :\n\nSQL is a Structured Query Language.\n\nSQL support stored procedures\n\nSQL is server based\n\n\nSQLite :\n\nSQLite is a powerful, embedded  relational database management system mostly used in mobile devices for data storage\n\nSQLite does not support stored procedures\n\nSQLite is file based\n\nsqlite-183454_640."
    },

    {"id":"7",
      "q":" List Out The Advantages Of Sqlite?",
      "answer":"It does not require separate server processor system to operate\n\nNo setup or administration required SQlite comes with zero-configuration\n\nAn SQLite database can be stored in a single cross-platform disk file\n\nSQLite is very compact less than 400 KiB\n\nSQLite is self-contained, which means no external dependencies\n\nIt supports almost all types of O.S\n\nIt is written in ANSI-C and provides easy to use API"
    },

    {"id":"8",
      "q":"Mention What Are The Sqlite Storage Classes?",
      "answer":"SQLite storage classes include :\n\nNull: The value is a NULL value\n\nInteger: The value is a signed integer (1,2,3, etc.)\n\nReal: The value is a floating point value, stored as an 8 byte IEEE floating point number\n\nText: The value is a text string, stored using the database encoding ( UTF-8, UTF-16BE)\n\nBLOB (Binary Large Object): The value is a blob of data, exactly stored as it was input."
    },
    {"id":"9",
      "q":"Explain How Boolean Values In Sqlite Are Stored?",
      "answer":"Boolean values in SQLite are stored as integers 0 (false) and 1 (true).  SQLite does not have a separate Boolean storage class."
    },

    {"id":"10",
      "q":"Explain What Is The Use Of Sqlite Group By Clause?",
      "answer":"The SQLITE group by clause is used in collaboration with the SELECT statement to arrange identical data into groups."
    },

    {"id":"11",
      "q":"When Indexes should be avoided?",

      "answer":"Indexes should be avoided when\n\nTables are small\n\nTables that changes frequently\n\nColumns that are frequently manipulated or having a high number of NULL values"
    },

    {"id":"12",
      "q":" Explain what are SQL Lite Indexes?",
      "answer":"SQL Lite indexes are special lookup tables that the database search engine use to speed up data retrieval. In simple words, it is a pointer to data in a table."
    },
    {"id":"13",
      "q":"Explain what is view in SQL Lite?",
      "answer":"In SQL Lite, a view is actually a composition of a table in the form of pre-defined SQL Lite Query. A view can consist of all rows of a table or selected rows from one or more tables.."
    },

    {"id":"14",
      "q":"Mention what is the Export Control Classification Number (EECN) for SQLite?",
      "answer":"The core public domain SQLite source code is not described by any ECCN. Hence, the ECCN should be reported as EAR99. But if you are adding new code or linking SQL Lite with the application, then it might change the EECN number."
    },

    {"id":"15",
      "q":"When can you get an SQLITE_SCHEMA error?",
      "answer":"The SQLITE_SCHEMA error is returned when a prepared SQL statement is not valid and cannot be executed. Such type occurs only when using the sqlite3 prepare() and sqlite3 step() interfaces to run SQL."
    },

    {"id":"16",
      "q":"Why is SQLite preferred over any other database management system?",
      "answer":"SQLite supports almost all Operating Systems.\n\nIt is free of cost and flexible.\n\nIt is very compact less than 400KiB.\n\nIt requires no setup or administration as it comes with zero-configuration.\n\nNo separate server processor system is required to operate.\n\nAn SQLite database can be stored in a single cross-platform disk file.\n\nIt is self-contained that means no external dependencies.\n\nIt provides easy access to API as it is written in ANSI-C."
    },

    {"id":"17",
      "q":"Describe some SQLite aggregate functions?",
      "answer":"The SQLite aggregate functions are the functions where values of multiple rows and columns are grouped as input and form a single value as output.\n\nBelow is the list of SQLite aggregate functions:\n\nSQLite MIN function: It is used to select a minimum value for a column.\n\nSQLite MAX function: It is used to select a maximum value for a column.\n\nSQLite SUM function: It is used to select the total for a numeric column.\n\nSQLite AVG function: It is used to select the average value for a table column.\n\nSQLite COUNT function: It is used to count the number of rows in a database table.\n\nSQLite UPPER function: It is used to convert a string into upper-case letters.\n\nSQLite LOWER function: It is used to convert a string into lower-case letters.\n\nSQLite LENGTH function: It is used get the length of a string."
    },
    {"id":"18",
      "q":"Explain SQLite transactions and its properties?",
      "answer":"The transaction is actually referred to the unit of work that is performed against a database. The SQLite transactions are the propagation of one or more changes to the database.\n\nThe properties of transactions are determined by ACID compliance.\n\nAtomicity: This property ensures that the entire work unit is completed successfully.\n\nConsistency: This property ensures that the database changes its state upon a successfully committed transaction.\n\nIsolation: This property ensures that the transactions are operated independently and are transparent to each other.\n\nDurability: This property ensures that the result or effect of a committed transaction will persist in case of system failure. "
    },

    {"id":"19",
      "q":"How can you recover the deleted information from the SQLite database?",
      "answer":"In order to recover the data that you deleted from the SQLite database; you can use the backup copy of your database file.\n\nIn case you do not have a backup copy, then the recovery of the information is impossible. The SQLite uses SQLite SECURE DELETE option which overwrites the deleted content in zeroes."
    },

    {"id":"20",
      "q":"What can you say about SQLite supporting foreign keys?",
      "answer":"As of the latest version, SQLite supports foreign key constraints. But the enforcement of the foreign key constraints is turned off by default (backward compatibility).\n\nIn order to enable foreign key constraint enforcement, run trending foreign_keys=ON command or you can also compile with DSQLITE_DEFAULT_FOREIGN_KEYS=1."
    },
    {"id":"21",
      "q":"Mention What Is The Command Used To Create A Database In Sqlite?",
      "answer":"To create a database in SQLite- command “sqlite3” is used.  The basic syntax to create a database is $sqlite3 DatabaseName.db ."
    },
    {"id":"22",
      "q":"Mention What Is .dump Command Is Used For? ",
      "answer":"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."
    },

    {"id":"23",
      "q":" Explain How Can You Delete Or Add Columns From An Existing Table In Sqlite?",
      "answer":" 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."
    },{"id":"24",
      "q":"Mention What Is The Maximum Size Of A Varchar In Sqlite?",
      "answer":"SQLite 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."
    },{"id":"25",
      "q":"Explain How To Recover Deleted Data From My Sqlite Database?",
      "answer":"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.  SQLite uses SQLITE SECURE DELETE option which overwrites all deleted content with zeroes."
    },{"id":"26",
      "q":"Mention What Is The Export Control Classification Number (eecn) For Sqlite?",
      "answer":"The core public domain SQLite source code is not described by any ECCN. Hence, the ECCN should be reported as EAR99. But if you are adding new code or linking SQLite with the application, then it might change the EECN number."
    },{"id":"27",
      "q":"Explain what is view in SQLite?",
      "answer":"In SQLite, a view is actually a composition of a table in the form of pre-defined SQLite Query.  A view can consist of all rows of a table or selected rows from one or more tables."
    },{"id":"28",
      "q":"Explain what are SQLite Indexes?",
      "answer":" SQLite indexes are special lookup tables that the database search engine use to speed up data retrieval.  In simple words, it is a pointer to data in a table."
    },{"id":"29",
      "q":" When Indexes Should Be Avoided?",
      "answer":"indexes should be avoided when :\n\nTables are small.\n\nTables that changes frequently.\n\nColumns that are frequently manipulated or having a high number of NULL values." } ,{"id":"30",
      "q":"Why Doesn't Sqlite Allow Me To Use '0' And '0.0' As The Primary Key On Two Different Rows Of The Same Table?",
      "answer":"This problem occurs when your primary key is a numeric type.\n\nChange the datatype of your primary key to TEXT and it should work.\n\nEvery row must have a unique primary key.\n\nFor a column with a numeric type, SQLite thinks that '0' and '0.0' are the same value because they compare equal to one another numerically.\n\nHence the values are not unique."
    },{"id":"31",
      "q":"Explain how to recover deleted data from my SQL Lite database?",
      "answer":"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."
    },{"id":"32",
      "q":"Explain what is the use of SQLITE group by clause?",
      "answer":"The SQLITE group by clause is used in collaboration with the SELECT statement to arrange identical data into groups."
    },{"id":"33",
      "q":"Mention what are the SQL lite storage classes?",
      "answer":"SQL lite storage classes include\n\nNull: The value is a NULL value\n\nInteger: The value is a signed integer (1,2,3, etc.)\n\nReal: The value is a floating point value, stored as an 8 byte IEEE floating point number\n\nText: The value is a text string, stored using the database encoding ( UTF-8, UTF-16BE)\n\nBLOB (Binary Large Object): The value is a blob of data, exactly stored as it was input "
    },{"id":"34",
      "q":" List out the areas where SQL Lite works well?",
      "answer":"SQL lite works well withEmbedded devices and the internet of things\n\nApplication file format\n\nData Analysis\n\nWebsites\n\nCache for enterprise data\n\nServer side database\n\nFile archives\n\nInternal or temporary databases\n\nReplacement for ad hoc disk files\n\nExperimental SQL language extensions\n\nStand-in for an enterprise database during demos or testing"
    },{"id":"35",
      "q":"My query does not return the column name that I expect. Is this a bug?",
      "answer":"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."
    },{"id":"36",
      "q":"I get a compiler error if I use the SQLITE_OMIT_... compile-time options when building SQLite.",
      "answer":"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.\n\nIt 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."
    },{"id":"37",
      "q":"Explain how Boolean values in SQL Lite are stored?",
      "answer":"Boolean values in SQL lite are stored as integers 0 (false) and 1 (true). SQL Lite does not have a separate Boolean storage class."
    },{"id":"38",
      "q":"Mention When To Use Sqlite And When Not To Use Sqlite?",
      "answer":"SQLite can be used in following conditions\n\nEmbedded applications: Does not require expansion like mobile applications or games\n\nDisk assess replacement: Application that require to write or read files to disk directly\n\nTesting: When testing business application logic When not to use SQLite\n\nMulti-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"
    },{"id":"39",
      "q":"Is Sqlite Thread Safe?",
      "answer":"SQLite is threadsafe. We make this concession since many users choose to ignore the advice given in the previous paragraph. But in order to be thread-safe, SQLite must be compiled with the SQLITE_THREADSAFE preprocessor macro set to 1. Both the Windows and Linux precompiled binaries in the distribution are compiled this way. If you are unsure if the SQLite library you are linking against is compiled to be threadsafe you can call the sqlite3_threadsafe() interface to find out.\n\nSQLite is threadsafe because it uses mutexes to serialize access to common data structures. However, the work of acquiring and releasing these mutexes will slow SQLite down slightly. Hence, if you do not need SQLite to be threadsafe, you should disable the mutexes for maximum performance. See the threading mode documentation for additional information.\n\nUnder Unix, you should not carry an open SQLite database across a fork() system call into the child process."
    },{"id":"40",
      "q":"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?",
      "answer":"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.\n\nThat statement is ambiguous, having at least two possible interpretations:\n\nA 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.\n\nA 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.\n\nSQLite 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."
    }
  ]
}