Oracle Database Fundamentals
Covers Oracle database concepts including SQL syntax, indexes, views, constraints, user privileges, and database administration
Questions
Which constraint can be defined only at column level?
- unique
- not null
- check
- primary key
Which SELECT statement will get the result 'elloworld' from the string 'HelloWorld'?
- SELECT SUBSTR ('HelloWorld',1) FROM dual;
- SELECT LOWER (TRIM ('H' FROM 'Hello World')) FROM dual
- SELECT LOWER (SUBSTR('HellowWorld', 2,1) FROM dual
- SELECT INITCAP(TRIM('HellowWorld', 1,1) FROM dual
Which substitution variable would you use if you want to reuse the variable without prompting the user each time
- &
- accept
- prompt
- &&
CREATE USER sh IDENTIFIED BY sh; GRANT CREATE ANY MATERIALIZED VIEW CREATE ANY DIMENSION , DROP ANY DIMENSION , QUERY REWRITE , GLOBAL QUERY REWRITE TO dw_manager WITH ADMIN OPTION; GRANT dw_manager TO sh WITH ADMIN OPTION; Which action the user SH cannot perform?
- Create and drop a materialized view
- Grant and revoke the role to and from other users
- Enable the role and exercise any privileges in the role's privilege domain
- Select from a table
Which type of index does this syntax create? CREATE INDEX hr.employees_last_name_idx ON hr.employees(last_name) PCTFREE 30 STORAGE(INITIAL 200K NEXT 200K PCTINCREASE 0 MAXEXTENTS 50) TABLESPACE indx;
- Bitmap
- B-Tree
- Partitioned
- Reverse key
You need to create an index on the PASSPORT_RECORDS table. It contains 10 million rows of data. The key columns have low cardinality. The queries generated against this table use a combination of multiple WHERE conditions involving the OR operator. Which type of index would be best for this type of table?
- Bitmap
- Btree
- Unique
- partitioned
Which statement about the shared pool is true?
- The shared pool CANNOT be dynamically resized.
- The shared pool contains only fixed structures
- The shared pool consists of the library cache and buffer cache.
- The shared pool stores the most recently executed SQL statements and the most recently
Which action will cause a log switch?
- A transaction completes.
- The instance is started.
- The instance is shut down
- The current online redo log group is filled
You examine the alert log file and notice that errors are being generated from a SQL*Plus session. Which files are best for providing you with more information about the nature of the problem?
- Control file
- User trace files
- Background trace files
- Initialization parameter files
Which is a valid CREATE TABLE statement?
- CREATE TABLE EMP9$# AS (empid number(2));
- CREATE TABLE EMP*123 AS (empid number(2));
- CREATE TABLE PACKAGE AS (packid number(2));
- CREATE TABLE 1EMP_TEST AS (empid number(2));
A SELECT statement can be to perform these three functions: -Choose rows from a table -Choose columns from a table -Bring together data that is stored in different tables by creating a link between them. Which set of keywords describe these capabilities?
- difference,projection,join
- selection.projection,join
- selection,intersection,join
- intersection,projection,join
- difference,projection,product
Which four are types of functions available in SQL?
- string
- character
- integer
- numeric
- date
- conversion
Which object privileges can be granted on a VIEW?
- DELETE,INSERT,SELECT
- ALTER,DELETE,INSERT,SELECT
- DELETE,INSERT,SELECT,UPDATE
- none
Which iSQL*PLUS feature can be used to replace values in the WHERE clause?
- Substitution variables
- Replacement variables
- Prompt variables
- Instead-of variables
- This feature cannot be implemented through iSQL*PLUS
You want to display the titles of books that meet these criteria: 1. Purchased before January 21,2001 2. Price is less than $500 and greater than $900 You want to sort the results by thier date of purchase, starting with the most recently bought book. Which statement should you use?
- SELECT book_title FROM books WHERE price between 500 and 900 AND puchase_date < '21-JAN-2001' ORDER BY purchase_date;
- SELECT book_title FROM books WHERE price IN (500,900) AND puchase_date < '21-JAN-2001' ORDER BY purchase_date ASC;
- SELECT book_title FROM books WHERE price <500 or >900 AND puchase_date < '21-JAN-2001' ORDER BY purchase_date DESC;
- SELECT book_title FROM books WHERE (price<500 OR price>900) AND puchase_date < '21-JAN-2001' ORDER BY purchase_date DESC;
Examine the SQL statements that creates ORDERS table: CREATE TABLE orders (SER_NO NUMBER UNIQUE, ORDER_ID NUMBER, ORDER_DATE DATE NOT NULL, STATUS VARCHAR2(10) CHECK (status IN('CREDIT','CASH')), PROD_ID NUMBER REFERENCES PRODUCTS(PRODUCT_ID), ORD_TOTAL NUMBER, PRIMARY KEY (order_id,order_date)); For which column would an index be automatically created when you execute the above SQL statement?(Choose two)
- SER_NO
- ORDER_ID
- STATUS
- PROD_ID
- ORD_TOTAL
- Composite index on ORDER_ID and ORDER_DATE
In a SELECT statement that includes a WHERE clause, where is teh GROUP BY clause placed in the SELECT statement?
- Immediately after the SELECT clause
- Before the WHERE clause
- Before the FROM clause
- After the ORDER BY clause
- After the WHERE clause
In which case would you use a FULL OUTER JOIN?
- Both tables have NULL values
- You want all unmatched data from one table
- You want all matched data from both tables
- You want all unmatched data from both tables
- One of the tables has more data than the other
- You want all matched and unmatched data from only one table
Which two statements accurately describes a role?(Choose two)
- A role can be given to a maximum of 1000 users
- A user can have access to a maximum of 10 roles
- A role can have a maximum of 100 privileges contained in it
- Privileges are given to a role by using the CREATE ROLE statement
- A role is a named group of related privileges that can be granted to the user
- A user can have access to several roles, and several users can be assigned to the same role
what are the three main components in Hibernate architecture?
- Connection Management
- Bean Management
- Transaction Management
- Object relational mapping
- Relational Management