0% found this document useful (0 votes)
90 views

SQLite Database

The document provides 50 multiple choice questions and answers about listing tables, indices, and other metadata in an SQLite database. It covers SQL statements, pragma statements, and SQLite C/C++ API functions for obtaining lists of tables, indices, column names and types, primary keys, foreign keys, and SQL CREATE statements. The questions address how to retrieve this information both using the SQLite command line tool and programmatically through the SQLite C/C++ API.

Uploaded by

Ashley Jaswal
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views

SQLite Database

The document provides 50 multiple choice questions and answers about listing tables, indices, and other metadata in an SQLite database. It covers SQL statements, pragma statements, and SQLite C/C++ API functions for obtaining lists of tables, indices, column names and types, primary keys, foreign keys, and SQL CREATE statements. The questions address how to retrieve this information both using the SQLite command line tool and programmatically through the SQLite C/C++ API.

Uploaded by

Ashley Jaswal
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 6

Certainly!

Here are 50 multiple-choice questions with answers related to listing tables and indices in
an SQLite database:

1. Which SQL statement can be used to list all tables in an SQLite database?

Answer: c) SELECT name FROM sqlite_master WHERE type='table';

2. In SQLite, the system catalog table that stores information about database objects is called:

Answer: c) sqlite_master;

3. Which SQLite command-line tool command is used to list all tables in a database?

Answer: c) .tables;

4. How can you obtain a list of tables using the SQLite C/C++ API?

Answer: c) Use the sqlite_master table with a SELECT statement;

5. To list all indices in an SQLite database, which SQL statement would you use?

Answer: c) SELECT name FROM sqlite_master WHERE type='index';

6. In SQLite, the system catalog table that stores information about indices is called:

Answer: c) sqlite_master;

7. Which SQLite command-line tool command is used to list all indices in a database?

Answer: c) .indices;

8. How can you obtain a list of indices using the SQLite C/C++ API?

Answer: c) Use the sqlite_master table with a SELECT statement;

9. Which of the following is a valid SQL statement to list all tables and indices in an SQLite database?

Answer: c) SELECT name, type FROM sqlite_master WHERE type IN ('table', 'index');

10. In SQLite, which pragma statement can be used to list all table names in a database?
Answer: b) PRAGMA table_info(table_name);

11. To list all tables and their corresponding schemas, you can use:

Answer: c) PRAGMA table_info(table_name);

12. Which of the following SQLite commands can be used to list all table names in a database?

Answer: a) .tables;

13. How can you obtain a list of tables and their schemas using the SQLite C/C++ API?

Answer: b) Use the sqlite3_table_column_metadata() function.

14. Which SQLite command-line tool command is used to list all tables and their schemas in a
database?

Answer: a) .schema;

15. In SQLite, which pragma statement can be used to list all index names in a database?

Answer: a) PRAGMA index_list(table_name);

16. To list all indices and their corresponding tables in an SQLite database, you can use:

Answer: b) PRAGMA index_info(index_name);

17. Which of the following SQLite commands can be used to list all index names in a database?

Answer: c) .indices;

18. How can you obtain a list of indices and their corresponding tables using the SQLite C/C++ API?

Answer: a) Use the sqlite3_index_info() function.

19. Which SQLite command-line tool command is used to list all indices and their corresponding
tables in a database?

Answer: c) .indices;

20. In SQLite, which pragma statement can be used to list all column names of a table?
Answer: b) PRAGMA table_info(table_name);

21. To list all columns of a table in an SQLite database, you can use:

Answer: b) PRAGMA table_info(table_name);

22. Which of the following SQLite commands can be used to list all column names of a table?

Answer: a) .schema table_name;

23. How can you obtain a list of column names of a table using the SQLite C/C++ API?

Answer: c) Use the sqlite3_table_column_metadata() function.

24. Which SQLite command-line tool command is used to list all column names of a table?

Answer: a) .schema table_name;

25

. In SQLite, which pragma statement can be used to retrieve the SQL CREATE statement for a specific
table?

Answer: b) PRAGMA table_info(table_name);

26. To obtain the SQL CREATE statement for a specific table in an SQLite database, you can use:

Answer: b) PRAGMA table_info(table_name);

27. Which of the following SQLite commands can be used to retrieve the SQL CREATE statement for a
specific table?

Answer: a) .schema table_name;

28. How can you obtain the SQL CREATE statement for a specific table using the SQLite C/C++ API?

Answer: c) Use the sqlite3_table_column_metadata() function.

29. Which SQLite command-line tool command is used to retrieve the SQL CREATE statement for a
specific table?
Answer: a) .schema table_name;

30. In SQLite, which pragma statement can be used to retrieve the SQL CREATE statement for a
specific index?

Answer: a) PRAGMA index_info(index_name);

31. To obtain the SQL CREATE statement for a specific index in an SQLite database, you can use:

Answer: a) PRAGMA index_info(index_name);

32. Which of the following SQLite commands can be used to retrieve the SQL CREATE statement for a
specific index?

Answer: b) .indices index_name;

33. How can you obtain the SQL CREATE statement for a specific index using the SQLite C/C++ API?

Answer: c) Use the sqlite3_index_info() function.

34. Which SQLite command-line tool command is used to retrieve the SQL CREATE statement for a
specific index?

Answer: b) .indices index_name;

35. In SQLite, which pragma statement can be used to retrieve the column names and types of a
table?

Answer: b) PRAGMA table_info(table_name);

36. To obtain the column names and types of a table in an SQLite database, you can use:

Answer: b) PRAGMA table_info(table_name);

37. Which of the following SQLite commands can be used to retrieve the column names and types of
a table?

Answer: a) .schema table_name;

38. How can you obtain the column names and types of a table using the SQLite C/C++ API?

Answer: c) Use the sqlite3_table_column_metadata() function.


39. Which SQLite command-line tool command is used to retrieve the column names and types of a
table?

Answer: a) .schema table_name;

40. In SQLite, which pragma statement can be used to retrieve the table's primary key column(s)?

Answer: d) PRAGMA table_info(table_name);

41. To obtain the primary key column(s) of a table in an SQLite database, you can use:

Answer: d) PRAGMA table_info(table_name);

42. Which of the following SQLite commands can be used to retrieve the table's primary key
column(s)?

Answer: a) .schema table_name;

43. How can you obtain the primary key column(s) of a table using the SQLite C/C++ API?

Answer: b) Use the sqlite3_table_column_metadata() function.

44. Which SQLite command-line tool command is used to retrieve the table's primary key column(s)?

Answer: a) .schema table_name;

45. In SQLite, which pragma statement can be used to retrieve the foreign key information of a table?

Answer: a) PRAGMA foreign_key_list(table_name);

46. To obtain the foreign key information of a table in an SQLite database, you can use:

Answer: a) PRAGMA foreign_key_list(table_name);

47. Which of the following SQLite commands can be used to retrieve the foreign key information of a
table?

Answer: b) .schema table_name;

48. How can you


obtain the foreign key information of a table using the SQLite C/C++ API?

Answer: b) Use the sqlite3_table_column_metadata() function.

49. Which SQLite command-line tool command is used to retrieve the foreign key information of a
table?

Answer: b) .schema table_name;

50. In SQLite, which pragma statement can be used to retrieve the SQL CREATE statement for a
specific view?

Answer: c) PRAGMA view_info(view_name);

I hope these questions and answers are helpful to you!

You might also like