DB2 Interview questions
DB2 Interview questions 10-20
Q11: What is the difference between group by and order by?
- Answer : Group by controls the presentation of the rows, order by controls the presentation of the columns for the results of the SELECT statement.
- Answer : SUBSTR is used for string manipulation with column name, first position and string length used as arguments. E.g.SUBSTR (NAME, 1 3) refers to the first three characters in the column NAME.
- Answer : An alias is an alternative to a synonym, designed for a distributed environment to avoid having to use the location qualifier of a table or view. The alias is not dropped when the table is dropped.
- Answer : Never. New primary key values are not a problem. However, the values of foreign key inserts must have corresponding primary key values in their related tables. And updates of primary key values may require changes in foreign key values to maintain referential integrity.
- Answer : If there is an index on the attributes tested an IN is more efficient since DB2 uses the index for the IN. (IN for index is the mnemonic).
- Answer : A tuple is an instance of data within a relational database.
- Answer : It will grant privileges to a list of one or more users. If the GRANT option is used in conjunction with the “PUBLIC” option, then all users will be granted privileges. Also you can grant privileges by objects and types.
- Answer : A join is a relational operation that allows retrieval of data from two or more tables based on matching columns values
- Answer : Yes.
- Answer : To do partial search e.g. to search employee by name, you need not specify the complete name; using LIKE, you can search for partial string matches