Computer Knowledge
Database and SQL
3,929 Questions
Master structured query language commands, database joins, table constraints, and alias generation. This section covers relational database management concepts and query outputs essential for technical aptitude. These technical questions feature prominently in banking IT officer exams and computer knowledge sections.
SQL queries and aliasesDatabase table constraintsDatabase joins and transformationsStored procedures and functions
Database and SQL Questions
-
Format
-
Default Value
-
Required
-
Indexed
C
Correct answer
Explanation
The Required property forces users to enter a value in a field - it cannot be left blank. Format controls display appearance, Default Value provides an automatic value, and Indexed improves search performance but doesn't enforce data entry.
-
Default Value
-
Primary Key
-
Indexed
-
Required
B
Correct answer
Explanation
The Primary Key property uniquely identifies each record in a table - no two records can have the same primary key value. Default Value sets automatic values, Indexed speeds up searches, and Required prevents blank fields but doesn't guarantee uniqueness.
-
Format
-
Default Value
-
Validation Rule
-
Indexed
B
Correct answer
Explanation
The Default Value property automatically enters a specified value when a new record is created. Format controls display appearance, Validation Rule checks if entered data meets criteria, and Indexed improves search performance but doesn't auto-populate fields.
-
rowRefresh()
-
refreshRow()
-
refreshIt()
-
refreshAll()
-
refreshCurrentRow()
B
Correct answer
Explanation
This is the correct answer because refreshRow() method is defined in the ResultSet interface and it refreshes the current row with its most recent value in the database.
-
getMaxColumns()
-
getMaxColumnsInTable()
-
getMaxColsInTable()
-
getMaxCols()
-
None of these
B
Correct answer
Explanation
This is the correct option because getMaxColumnsInTable() method is defined in the DatabaseMetaData interface and it retrieves the maximum number of columns this database allows in a table.
-
getMaxColumnLength()
-
getMaxColumnNameLength()
-
getMaxColNameLength()
-
getMaxColLength()
-
getColumnNameLength()
B
Correct answer
Explanation
This is the correct option because getMaxColumnNameLength() method is defined in DatabaseMetaData interface and it retrieves the maximum number of characters this database allows for a column name.
-
Fill
-
GetFillParameters
-
GetHashCode
-
Equals
-
GetType
B
Correct answer
Explanation
It gets the attributes set by the user when executing an SQL SELECT statement.
-
candidate key
-
super key
-
composite key
-
primary key
-
foreign key
B
Correct answer
Explanation
Super key is the union of a set of attribute which are primary key.
-
parser
-
DBA
-
query optimizer
-
translator
-
compiler
A
Correct answer
Explanation
Parsing is the technique for syntax analysis.
-
uniquely identifies the data in a row
-
is also referred to as composite key
-
is a unique identifier in a column
-
must be accompanied by a corresponding foreign key
-
is always a super key
A
Correct answer
Explanation
Yes, it is correct by defination.
-
lock the DBMS
-
lock the database
-
lock one row
-
lock one column
-
lock a relation
B
Correct answer
Explanation
Lock will make it non-shareable.
-
To save information in a database after updation
-
To identify a point in a transaction to which you can later roll back
-
To save a table
-
To save after RENAME a table
-
None of these
B
Correct answer
Explanation
This is the function of a SAVEPOINT command.
-
Prime attribute
-
Primary key
-
Candidate key
-
Partial key
-
None of these
C
Correct answer
Explanation
Minimal super key is called as candidate key.
-
The primary key
-
The reference key
-
The candidate key
-
The foreign key
-
None of these
D
Correct answer
Explanation
A foreign key means that values in one table must also appear in another table.
-
Primary key
-
Secondary key
-
Super key
-
Both 1 and 2
-
None of these
A
Correct answer
Explanation
Part of primary key cannot contain a null value.