REVIEW - CODING QUESTIONS Flashcards

1
Q

What are tablespaces?

A

A tablespace in Oracle is a storage location where the actual data associated with database objects like tables and indexes is stored.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How are users created in Oracle?

A

CREATE USER statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the syntax for creating a user?

A

CREATE USER user_name IDENTIFIED BY password
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp;

GRANT CREATE SESSION, CREATE TABLE TO user_name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is database authenticated?

A

Users are authenticated using a username and password that are stored and verified by the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the syntax for database authenticated?

A

CREATE USER db_user IDENTIFIED BY db_password;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is externally authenticated?

A

Users are authenticated externally, such as through the operating system or network services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the syntax for externally authenticated?

A

CREATE USER external_user IDENTIFIED EXTERNALLY;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a role in oracle?

A

A collection of privileges that can be granted to users or other roles, simplifying the management of user permissions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the characteristics of a role?

A
  1. Roles can be granted to users or other roles.
  2. Roles can be enabled or disabled.
  3. Roles can contain both system and object privileges.
  4. Roles simplify privilege management by grouping multiple privileges.
  5. Roles can be password-protected to restrict usage.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are some common predefined Oracle Roles?

A

CONNECT: Basic privileges for connecting to the database.

RESOURCE: Privileges for creating and managing schema objects.

DBA: All administrative privileges.

SELECT_CATALOG_ROLE: Allows querying data dictionary views.

EXP_FULL_DATABASE: Full database export privileges.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the types of privileges in Oracle?

A

System and object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are system privileges?

A

Allow users to perform actions on the database itself (e.g., CREATE TABLE, CREATE USER).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are object privileges?

A

Allow users to perform actions on database objects (e.g., SELECT, INSERT, UPDATE on a table).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the difference between CUBE and ROLLUP?

A

CUBE: Generates subtotals for all combinations of columns specified in the GROUP BY clause. It’s useful when you need a comprehensive breakdown of all possible aggregation levels.

ROLLUP: Generates subtotals for hierarchical levels. It’s useful when you want to aggregate data progressively across a defined hierarchy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the components of exception handling?

A

EXCEPTION: Marks the start of the exception block.

WHEN: Specifies the condition to handle specific exceptions.

RAISE: Used to explicitly raise an exception.

RAISE_APPLICATION_ERROR: Used to raise a user-defined error with a custom error code and message.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is SQLERRM?

A

Returns the error message for the most recent error.

17
Q

What is SQLCODE?

A

Returns the error code for the most recent error.