Computer Knowledge
Database and SQL
4,213 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
-
varchar2()
-
long
-
char()
-
lob()
B
Correct answer
Explanation
In Oracle's data dictionary views (such as USER_VIEWS), the 'TEXT' column, which stores the query defining the view, is defined with the LONG data type.
-
user_views
-
all_views
-
user_updatable_columns
-
dba_views
C
Correct answer
Explanation
The USER_UPDATABLE_COLUMNS data dictionary view specifically shows which columns in a view can be updated through DML operations. Other views (USER_VIEWS, ALL_VIEWS, DBA_VIEWS) contain view definitions, not updatability metadata.
-
inline view is a schema object
-
is a subquery used in where clause
-
inline view can't have group functions
-
none of the above
D
Correct answer
Explanation
Inline views are subqueries in the FROM clause (not WHERE clause), are NOT schema objects (they're temporary query constructs), and CAN contain group functions. Since A, B, and C are all incorrect, D (none of the above) is the correct answer.
A
Correct answer
Explanation
ORDER BY can be used in view creation in most databases (Oracle, PostgreSQL, etc.) to specify the default presentation order when querying the view, though some databases like SQL Server restrict it.
-
999
-
1000
-
1001
-
limit is only for tables....
B
Correct answer
Explanation
Oracle imposes a 1000-column limit on views (and tables). Options 999 and 1001 are wrong, and the limit applies to both tables and views.
-
drop the view and create a new one
-
use CREATE OR REPLACE syntax
-
use ALTER VIEW syntax
-
use UPDATE sytax
B
Correct answer
Explanation
CREATE OR REPLACE VIEW is the simplest way to modify a view definition - it preserves permissions and dependencies. Dropping and recreating loses permissions and requires re-granting. ALTER VIEW doesn't exist for redefining views in most databases. UPDATE syntax is for data, not DDL.
-
Form applet data comes from only one table
-
Form applet data may come from many tables and columns
-
Form applet data may come from many columns in a single table
-
Form applet data comes from only one column in a table
B
Correct answer
Explanation
Form applets display data from multiple tables through joins and business component layer abstraction. They're not limited to one table or one column - they aggregate related data. Option B correctly states they access data from many tables and columns.
A
Correct answer
Explanation
In NPS (database systems), ALTER DATABASE is a DDL operation that typically requires exclusive access to the database. Most database systems lock the database or prevent concurrent DML operations during structural changes to maintain data integrity and prevent corruption.
A,B,D
Correct answer
Explanation
When a subquery returns multiple rows, you must use set-based operators: IN checks membership in the result set, ALL compares against every value (e.g., salary > ALL means greater than the maximum), and ANY compares against any value (e.g., salary = ANY means equal to at least one, equivalent to IN). Standalone comparison operators like = or <> cannot directly handle multiple-row results.
-
SQL is a language for accessing data from an Oracle server
-
iSQL*Plus cannot be abbreviated
-
SQL cannot be abbreviated.
-
iSQL*Plus is a language for accessing data from an Oracle
A,C
Correct answer
Explanation
SQL is a query language for accessing and manipulating data in Oracle databases and other RDBMS. The name SQL itself is the standard, complete name used in practice - it's not typically abbreviated further in technical documentation. In contrast, iSQL*Plus is a client tool/interface for executing SQL, not a language itself.
-
Creation of a new table based off of the output of SELECT statements
-
Return information from specific columns
-
Return information from specific rows
-
The combination of values in different tables
A
Correct answer
Explanation
A SELECT statement returns a result set but does not create tables by itself - creating a table requires CREATE TABLE AS SELECT (CTAS) or SELECT INTO, which are DDL statements, not pure SELECT. Options B, C, and D are all capabilities of SELECT: specifying columns in the SELECT list, filtering rows with WHERE, and combining tables with JOIN.
-
Creation of a new table based off of the output of SELECT statements
-
Return information from specific columns
-
Return information from specific rows
-
The combination of values in different tables
-
Create another SELECT statement in a FROM clause
-
Create a WHERE statement in an UPDATE clause.
-
Create another SELECT statement in a HAVING clause.
-
Create an ALTER statement in a SET clause
A,B,C
Correct answer
Explanation
Subqueries can be placed in the FROM clause (inline views), the HAVING clause of a SELECT statement, and the WHERE clause of UPDATE/DELETE/SELECT statements. ALTER is a DDL command and cannot contain subqueries in a SET clause.
-
AR_PAYMENT_SCHEDULES_ALL
-
AP_PAYMENT_SCHEDULES_ALL
-
RA_CUSTOMER_TRX_ALL
-
RA_CUSTOMER_TRX_LINES_ALL
A
Correct answer
Explanation
When a transaction (invoice) is completed in Oracle Receivables, the system inserts or updates records in AR_PAYMENT_SCHEDULES_ALL to track the payment schedule and outstanding balance.
-
Display Set
-
Column Set
-
Row Set
-
Order Set
D
Correct answer
Explanation
In Oracle General Ledger Financial Statement Generator (FSG), valid components include Row Sets, Column Sets, and Display Sets. Order Set is not a valid FSG component.