SQL Functions, Indexing, and SQL*Loader Quiz
Test your knowledge of SQL character functions, DML/DDL commands, database indexing including Sybase IQ, and Oracle SQL*Loader data loading options and control files.
Questions
Pick the correct options about Control File
- The LOAD DATA statement is required at the beginning of the control file.
- The INFILE option specifies where the input file is located
- Specifying BADFILE, then bad records found during loading will be stored in this file.
- Specifying DISCARDFILE , then records which do not meet a WHEN condition will be written to this file.
- Field Seperator - how the fields are separated in input file.
Pick the correct options about Control File
- The LOAD DATA statement is required at the beginning of the control file.
- The INFILE option specifies where the input file is located
- Specifying BADFILE, then bad records found during loading will be stored in this file.
- Specifying DISCARDFILE , then records which do not meet a WHEN condition will be written to this file.
- Field Seperator - how the fields are separated in input file.
what are the loading options allowed in sqlldr
- INSERT
- APPEND
- REPLACE TRUNCATE
- DELETE UPDATE
Pick the correct options about loading parameters
- INSERT : Loads rows only if the target table is empty
- APPEND: Load rows if the target table is empty or not.
- REPLACE: First deletes all the rows in the existing table and then, load rows.
- TRUNCATE: First truncates the table and then load rows.
What are the two types of loads used by oracle sqldr
- Conventional
- Direct
- Indirect
- Insert
Conventional type is the default load type used by Sql Loader
- True
- False
Conventional path load (the default) uses the SQL INSERT statement and a bind array buffer to load data into database tables. When SQL*Loader performs a conventional path load, it wont competes equally with all other processes for buffer resources. This can slow the load significantly. Extra overhead is added as SQL statements are generated, passed to Oracle, and executed. Although appropriate during normal use, this can slow bulk loads dramatically.
- True
- False
In Direct Path Loading, Oracle will not use SQL INSERT statement for loading rows. It directly writes the rows, into fresh blocks beyond High Water Mark, in datafiles i.e. it does not scan for free blocks before high water mark. Direct Path load is very fast because Partial blocks are not used, so no reads are needed to find them, and fewer writes are performed. SQL*Loader need not execute any SQL INSERT statements; therefore, the processing load on the Oracle database is reduced. A direct path load calls on Oracle to lock tables and indexes at the start of the load and releases them when the load is finished. During a direct path load, processes perform their own write I/O, instead of using Oracle's buffer cache. This minimizes contention with other Oracle users.
- True
- False
What are the conditions must be satisfied to use the direct path load method
- Tables are not clustered.
- Tables to be loaded do not have any active transactions pending.
- Loading a parent table together with a child Table
- Loading BFILE columns
What is the default index that is being created when a table is created in Sybase IQ?
- LF
- HG
- HNG
- FP
LF index will be created by default when a FK is created.
- True
- False
As part of PK a unique non high group index will be created
- True
- False
Figure out the indexes which are not part of Sybase IQ?
- HG,LF,HNG
- DATE,DTTM,CMP,WD
- TIME
- None of the above
Give the number of distinct values that LF index can hold
- 5000
- 10000
- 3000
- 1500
The primary key on table EMP is the EMPNO column. Which of the following statements will not use the associated index on EMPNO?
- select * from EMP where nvl(EMPNO, '00000') = '59384';
- select * from EMP where EMPNO = '59384';
- select EMPNO, LASTNAME from EMP where EMPNO = '59384';
- select 1 from EMP where EMPNO = '59834';
SELECT address1||','||address2||','||address2 "Adress" FROM employee;
- 1
- 2
- 3
- 4
Which Oracle access method is the fastest way for Oracle to retrieve a single row?
- Primary key access
- Access via unique index
- Table access by ROWID
- Full table scan
Which of the following can be a valid column name?
- Column
- 1966_Invoices
- Catch_#22
- #Invoices
Which command will delete all data from a table and will not write to the rollback segment?
- DROP
- DELETE
- CASCADE
- TRUNCATE
Which character function can be used to return a specified portion of a character string?
- INSTR
- SUBSTRING
- SUBSTR
- POS