Oracle Database Fundamentals and SQL
Test your knowledge of Oracle database concepts including SQL queries, triggers, normalization, tablespaces, date functions, and transaction management.
Questions
What conditions have to be met before dropping a tablespace?
- The tablespace must be offline
- The tablespace must be online
- The tablespace cannot have active segments
- The administrator NOT needs the correct system privilege
Which of the following events can be used to fire triggers?
- sysdate
- Truncate
- avg
- To_date
Which names are NOT appropriate database object names?
- "SELECT"
- "_Marketing"
- m364DaYs
- SELECT
Which of the following queries can you use to search for employees with the pattern 'A_B' in their names?
- SELECT last_name FROM employees WHERE last_name LIKE '%A_B%' ESCAPE '\';
- SELECT last_name FROM employees WHERE last_name LIKE '%A_B%' ESCAPE;
- SELECT last_name FROM employees WHERE last_name LIKE 'A_B%' ESCAPE '%';
- SELECT last_name FROM employees WHERE last_name LIKE '%A_B%' ESCAPE '';
To write a query that performs an outer join of tables A and B and returns all rows from B, You need to write
- any outer join
- a left outer join
- a cross join
- a right outer join
15 Examine the description of the STUDENTS table: STD_ID NUMBER (4) COURSE_ID VARCHAR2 (10) START_DATE DATE END_DATE DATE Which two aggregate functions are valid on the START_DATE column? (Choose two)
- SUM(start_date)
- AVG(start_date)
- COUNT(start_date)
- MIN(start_date)
You would like to display the system date in the format "Monday, 01 June, 2001". Which SELECT statement should you use?
- SELECT TO_DATE (SYSDATE, 'FMDAY, DD Month, YYYY') FROM dual;
- SELECT TO_CHAR (SYSDATE, 'FMDD, DY Month, YYYY') FROM dual;
- SELECT TO_CHAR (SYSDATE, 'FMDay, DD Month, YYYY') FROM dual;
- SELECT TO_CHAR (SYSDATE, 'FMDY, DDD Month, YYYY') FROM dual;
Which two statements complete a transaction? (Choose two.)
- DELETE employees;
- DESCRIBE employees;
- ROLLBACK TO SAVEPOINT C;
- ALTER TABLE employees SET UNUSED COLUMN sal;
- GRANT SELECT ON employees TO SCOTT;
Which object privileges can be granted on a view?
- none
- DELETE, INSERT, SELECT
- ALTER, DELETE, INSERT, SELECT
- DELETE, INSERT, SELECT, UPDATE
Which command will delete all data from a table and will not write to the rollback segment?
- DROP
- DELETE
- CASCADE
- TRUNCATE
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 character function can be used to return a specified portion of a character string?
- INSTR
- SUBSTR
- SUBSTRING
- POS
When a user creates an object without a TABLESPACE clause, where will Oracle store the segment?
- System tablespace
- Users tablespace
- Default tablespace for the user
- Oracle will give an error
- Undefined
Which character is used to continue a statement in SQL*Plus?
- *
- #
- /
- -
- @
Assuming today is Friday, 28 August 2009, what is returned by this statement: SELECT to_char(NEXT_DAY(sysdate, 'FRIDAY'), 'DD-MON-RR') FROM dual;
- 21-AUG-09
- 28-AUG-09
- 04-SEP-09
- 29-AUG-09
- 27-AUG-09
To produce a meaningful result set without any cartesian products, what is the minimum number of conditions that should appear in the WHERE clause of a four-table join?
- 8
- 3
- 5
- There is no such criteria
Which of the following can be a valid column name?
- Column
- 1966_Invoices
- Catch_#22
- #Invoices
- None of the above
Normalization is…
- the process of arranging information stored in a database in a way, which removes redundancy and ambiguity.
- a special way of selecting data
- the process of adding primary key to a table
- All the above
A trigger is…
- a special type of store procedure, executed when certain event occurs
- a special type of table
- a special type of view
- All the above
Which SQL statement selects all rows from table called Contest, with column ContestDate having values greater or equal to May 25, 20006?
- SELECT * FROM Contest WHERE ContestDate < '05/25/2006'
- SELECT * FROM Contest HAVING ContestDate >= '05/25/2006'
- SELECT * FROM Contest WHERE ContestDate >= '05/25/2006'
- none of the above