Oracle Database: Constraints, Data Types, and SQL Functions
Test your knowledge of Oracle database concepts including unique constraints, foreign keys, deferred constraints, VARCHAR/VARCHAR2 data types, NUMBER precision, DATE storage, optimizer hints, interval literals, table constraints, COUNT function with NULLs, LENGTH function, and subquery clause restrictions.
Questions
Sub query cannot have which clause defined for it
- where
- having
- order by
- none of the above
Select length(-1) from dual What is the output of the above sql stmt
- 2
- 1
- 0
- error
The standard EMP table contains 14 records corresponding to the employess of the corporation.One of those records has a NULL value stored in the MGR column.If Issue the following command on the table: select count(mgr) from emp; What is the count?
- 14
- >14
- error
- <14
You can declare this only by using table contraint syntax
- Composite primarykey
- Not null
- unique
- check
An interval literal specifies
- a period of time
- a numerical difference
- a descriptive number
- a floating point number
You use comments in a SQL statement to pass hints to the Oracle optimizer.
- False
- This is hard to determine
- True
- None of the choices
For each DATE value in an Oracle database, which of the following information is stored (choose all that apply):
- second
- century
- hour
- year
- date
- month
Sub query cannot have which clause defined for it
- where
- having
- order by
- none of the above
Select length(-1) from dual What is the output of the above sql stmt
- 2
- 1
- 0
- error
The standard EMP table contains 14 records corresponding to the employess of the corporation.One of those records has a NULL value stored in the MGR column.If Issue the following command on the table: select count(mgr) from emp; What is the count?
- 14
- >14
- error
- <14
You can declare this only by using table contraint syntax
- Composite primarykey
- Not null
- unique
- check
An interval literal specifies
- a period of time
- a numerical difference
- a descriptive number
- a floating point number
You use comments in a SQL statement to pass hints to the Oracle optimizer.
- False
- This is hard to determine
- True
- None of the choices
For each DATE value in an Oracle database, which of the following information is stored (choose all that apply):
- second
- century
- hour
- year
- date
- month
Which of the following are the correct value for the column whose data type is declared as number(3,4)
- 123.21
- 0.001
- 0.01
- 123.01
Which of the following describes the difference between varchar and varchar2 data types
- varchar is used to store fixed length character data, varchar2 is for variable length character data
- varchar data type is not supported in oracle
- varchar data type is applicable only to PL/SQL
- maximum length for varchar is 2000 bytes and for varchar2 is 4000 bytes
What is true in case of deferred constraints in Oracle?
- The Constraint condition is never checked
- The Constraint condition is checked only at the time of commiting the transaction
- The Constraint condition is checked only for newly inserted rows and will not be checked for already existing rows in the table
- The constraint condition is checked after a predefined time interval
Which of the following clause enables to drop the foreign key constraints of the child table while dropping the parent table?
- drop foreign keys
- cascade constraints
- this is not possible in oracle
- clear references
The table employee contains 20 records. What is the output of the query " Select 8 from Employee"?
- No Rows retrieved
- 8 is displayed 20 times
- 8 is displayed 1 time
- error message
The columns with unique constraint allows more than one null values to be inserted.
- True
- False