InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What is a CTID of PostgreSQL? |
|
Answer» In POSTGRESQL, the CTID field is one that exists in each and EVERY PostgreSQL table, and it is unique for all RECORDS inside a table, which is USED to denote the LOCATION of the tuples. |
|
| 2. |
How to take the backup of PostgreSQL? |
|
Answer» Here are the steps to back up a SINGLE database in PostgreSQL. We shall be using the pg_dump tool as it dumps out the content of all the objects in the database to a single file. Step 1: First of all, navigate to the PostgreSQL BIN FOLDER: C:\>cd C:\Program Files\PostgreSQL\9.2\bin Step 2: Now, we shall execute the pg_dump program and use the following method to back up the EXAMPLES database to the example.tar file to the c:\pgbackup\ folder. pg_dump -U postgres -W -F t examples > c:\pgbackup\examples.tar Step 3: Here is your backed up database c:\pgbackup\dvdrental.tar |
|
| 3. |
How to enable debug mode in PostgreSQL? |
|
Answer» PgAdmin comes with built-in support to DEBUG your Pl/PgSQL codes. However, in order to enable this, you need to compile and INSTALL a SEPARATE plug-in for PostgreSQL Now, once you have set up a proper environment for debugging, GO to EDIT /etc/postgresql/9.4/main/postgresql.conf and enable the debugger plugin. |
|
| 4. |
How to check status of PostgreSQL server running or not? |
|
Answer» The SIMPLEST way to CHECK whether your SERVER in PostgreSQL is running or not: ps auxwww | grep postgres In versions other than 8.3 you need to run this command /Library/PostgreSQL/8.3/bin/postgres -D /Library/PostgreSQL/8.3/data |
|
| 5. |
What are the ODBC drivers that are available for PostgreSQL? |
|
Answer» plsqlODBC is the official POSTGRESQL DRIVER. Besides that, there are other third-party ODBC drivers such as Devart, which shall COST you some MONEY. |
|
| 6. |
What is the command that can be used to allocate memory in postgreSQL? |
|
Answer» The PostgreSQL FUNCTIONS palloc and MALLOC are USED for ALLOCATING memory. |
|
| 7. |
How many byte Unique integers does OIDs in PostgreSQL? |
|
Answer» In POSTGRESQL, there are 4 bytes of UNIQUE INTEGERS by DEFAULT. |
|
| 8. |
What is inverted file in PostgreSQL? |
|
Answer» In POSTGRESQL, an Inverted file is basically an index data STRUCTURE used for mapping content to its location to a database file, WITHIN a document, or in sets of documents. It is usually composed of all the distinct words found in a text and a list containing the occurrences of a WORD in the text. The inverted file is widely used in a data structure for document retrieval systems in supporting a full-text SEARCH. |
|
| 9. |
What is the operator that is used for case-insensitive regular expression searches in PostgreSQL? |
|
Answer» To MATCH a regular EXPRESSION that is CASE insensitive, you can use the POSIX regular expression (~*) from the pattern MATCHING operators. Example'umesh' ~* '.*Umesh.*' |
|
| 10. |
What is purpose of overlay function in PostgreSQL? |
|
Answer» In PostgreSQL, the Overlay function allows users to replace a SUBSTRING, which is starting at a specific position and having a specified length. Here is the syntax for the Overlay Function: Exampleoverlay(<main_string> placing <replaced_string> <br> To find the cube root of ant given NUMBER in PostgreSQL, you can USE the CBRT() function. Example |
|
| 11. |
What is sequence in PostgreSQL? |
|
Answer» A SEQUENCE in PostgreSQL is a special form of data that is created to GENERATE multiple numeric identifiers in the PostgreSQL database. It is most often USED to create sequences and artificial primary keys SIMILAR to Auto_Increment in MySQL. The basic role of sequences in PostgreSQL is to create UNIQUE identifiers between multiple rows inside a table. |
|
| 12. |
How to change user's password in PostgreSQL? |
|
Answer» Follow these steps to CAREFULLY change the user password Postgres in Laravel:
It should look something like this: |
|
| 13. |
What is reserved words in PostgreSQL? |
|
Answer» RESERVED WORDS in PostgreSQL are ACTUALLY SQL keywords and other SYMBOLS having some SORT of special meaning when being processed by the Relational Engine. |
|
| 14. |
What are tokens in PostgreSQL? |
|
Answer» A TOKEN can be a keyword, an identifier, a quoted identifier, a literal (or constant), or a distinctive personality symbol. TOKENS are generally separated with the AID of whitespace (SPACE, tab, newline), however, need not be if there is no ambiguity (which is usually only the case if an exceptional persona is adjoining to some other token type). |
|
| 15. |
How to create a database in PostgreSQL pgAdmin? |
|
Answer» Follow these steps to successfully create a DATABASE in PostgreSQL USING PgAdmin:
|
|
| 16. |
What types of indexes are supported in PostgreSQL? |
|
Answer» PostgreSQL provides several INDEX types like HASH, B-tree, SP-GiST, BRIN, and GIN. All these types USES a separate ALGORITHM that is best suited to queries. |
|
| 17. |
What is indexes in PostgreSQL? |
|
Answer» In PostgreSQL, the index is a common way for DATABASE performance ENHANCEMENT. It allows the database server to FIND the retrieve specific rows faster compared to without index. It also adds overhead to the database system as a whole, so users have to IMPLEMENT them sensibly. Indexes are special lookup tables that are used by the database search engine to SPEED up data retrieval. Simply defining, an index is a pointer to a specific data in a table. |
|
| 18. |
How to stats update in PostgreSQL? |
|
Answer» An EXPLICIT 'vacuum' call is made to update STATISTICS in POSTGRESQL. Users can ALSO use the ANALYZE to perform so. |
|
| 19. |
What is table partitioning in PostgreSQL? |
|
Answer» In PostgreSQL, table partitioning REFERS to splitting a large table into smaller SECTIONS. PostgreSQL supports LIST and range partitioning via table heritance. Users have to CREATE each partition as a child table of the master table. |
|
| 20. |
What is a child in PostgreSQL? |
|
Answer» The ctid field exists in every PostgreSQL table. It is UNIQUE for every record in a table and denotes the turple location. It can be used to delete records. The THING to REMEMBER, we should only use ctid if we have ABSOLUTELY no other unique IDENTIFIER to use. |
|
| 21. |
List data type in PostgreSQL? |
Answer» POSTGRESQL SUPPORTS VARIOUS DATA types, which includes:
|
|
| 22. |
How to install PostgreSQL on Ubuntu? |
|
Answer» As the DEFAULT repositories of Ubuntu contain Postgres packages, we can install it easily USING the apt packaging SYSTEM. Refresh the local PACKAGE index and then install the Postgres packages and a -contrib package which adds additional functionality and utilities. The PostgreSQL SOFTWARE installation process is finished now. |
|
| 23. |
How to install PostgreSQL on windows? |
Answer»
|
|
| 24. |
What are the difference between PostgreSQL and Oracle? |
||||||||||||||||||
Answer»
|
|||||||||||||||||||
| 25. |
Explain PostgreSQL vs. MongoDB? |
|||||||||
Answer»
|
||||||||||
| 26. |
What is Multi Version Concurrency Control in PostgreSQL? |
|
Answer» Multi-Version Concurrency Control (MVCC) is an advanced method used in PostgreSQL for improving the performance of a database in a multi-user environment. Unlike lock MODELS in other DATABASES, PostgreSQL uses a multi-version environment in which locks that are acquired for reading data don’t conflict with locks acquired for writing the data. HENCE, making the process more compartmentalized and a LOT faster. |
|
| 27. |
Which is better MySQL or PostgreSQL? |
|
Answer» In terms of learning DATABASES, MYSQL is perfect. It is the first choice for web-based projects merely requiring a database for transactions and nothing else. But, PostgreSQL is better in terms of FUNCTIONALITIES and performance. It is more used in the execution of COMPLEX queries, data WAREHOUSING, and data analysis. |
|
| 28. |
What is the Maximum size for a database in PostgreSQL? |
|
Answer» PostgreSQL has no maximum database size, so USERS can put unlimited data into it. But, the table, row, and field size are limited. The row and INDEXES are also universal for its users. PostgreSQL usually stores its desk facts in CHUNKS of 8KB. The quantity of these blocks is confined to a 32-bit signed integer, GIVING the most desk dimension of 16TB. |
|
| 29. |
What does GEQO stands for in PostgreSQL? |
|
Answer» In PostgreSQL, GEQO stands for Genetic Query Optimization. It allows the PostgreSQL search QUERY optimizer to SUPPORT LARGE joined QUERIES in an effective manner using a non-exhaustive search technique. |
|
| 30. |
What is pgAdmin and how do you set up pgAdmin? |
|
Answer» PgAdmin is a free, open-source PostgreSQL database administration GUI that is used in Microsoft WINDOWS, MAC OS X, and Linux systems. PgAdmin is used for database server information retrieval, development process, Quality testing, and other ONGOING maintenance. Follow these steps to install PgAdmin:
|
|
| 31. |
What are the features of PostgreSQL? |
|
Answer» PostgreSQL has many exciting features added to it. Here are a few of them:
|
|
| 32. |
What is the Maximum size for a table in PostgreSQL? |
|
Answer» EVEN though PostgreSQL has UNLIMITED DATABASE size for users, but it has a LIMIT for maximum table size. The maximum table size is set to 32 TB. Note: This is very essential PostgreSQL interview questions. |
|
| 33. |
How to change the datatype of a column in PostgreSQL? |
|
Answer» To change the records TYPE of a column, you USE the ALTER TABLE ASSERTION as FOLLOWS: ExampleALTER TABLE users |
|
| 34. |
What is base directory in PostgreSQL? |
|
Answer» The base directory in PostgreSQL (data_dir/base) is the folder is where PostgreSQL stores all the data you have INSERTED in your DATABASES. It contains all the sub-directories which are USED by a DATABASE in your CLUSTERS. |
|
| 35. |
How to select first 10 records in PostgreSQL? |
|
Answer» To get the first 10 records from a database in PostgreSQL, USE the LIMIT command. Here is an example of PICKING the first 10 records from a database CALLED Example: Example |
|
| 36. |
What is PostgreSQL and why it is used for? |
|
Answer» It’s a GENERAL purposed and advance object-relational database MANAGEMENT system used to add custom functions developed using a various programming LANGUAGE such as C, C++, Java, etc. Designed to be extensible, PostgreSQL IMPLEMENTS MVCC or multi-version concurrency control. |
|