Sie sind auf Seite 1von 3

>> What is the difference among "dropping a table", "truncating a table" and

"deleting all records" from a table.


Answer: Dropping : (Table structure + Data are deleted), Invalidates the dependent
objects ,Drops the indexes Truncating: (Data alone deleted), Performs an automatic
commit, Faster than deleteDelete : (Data alone deleted), Doesn't perform automatic
commit
>> maximum number of columns in a table or view is 1000

>> What are the Large object types suported by Oracle?


Answer: Blob and Clob
>> Difference between a "where" clause and a "having" clause.
Answer: Having clause is used only with group functions whereas Where is not used
with.

What is the difference between


>>

VARCHAR, VARCHAR2 and CHAR


data types?
Submitted by admin on Sat, 2005-11-26 08:30
Both CHAR and VARCHAR2 types are used to store character string values, however,
they behave very differently. The VARCHAR type should not be used:

CHAR
CHAR should be used for storing fix length character strings. String values will be
space/blank padded before stored on disk. If this type is used to store varibale length
strings, it will waste a lot of disk space.
SQL> CREATE TABLE char_test (col1 CHAR(10));

Table created.

SQL> INSERT INTO char_test VALUES ('qwerty');

1 row created.

SQL> SELECT col1, length(col1), dump(col1) "ASCII Dump" FROM char_test;

COL1 LENGTH(COL1) ASCII Dump


---------- ------------
------------------------------------------------------------
qwerty 10 Typ=96 Len=10:
113,119,101,114,116,121,32,32,32,32
Note: ASCII character 32 is a blank space.

VARCHAR
Currently VARCHAR behaves exactly the same as VARCHAR2. However, this type
should not be used as it is reserved for future usage.
SQL> CREATE TABLE varchar_test (col1 VARCHAR2(10));

Table created.

SQL> INSERT INTO varchar_test VALUES ('qwerty');

1 row created.

SQL> SELECT col1, length(col1), dump(col1) "ASCII Dump" FROM


varchar_test;

COL1 LENGTH(COL1) ASCII Dump


---------- ------------
------------------------------------------------------------
qwerty 6 Typ=1 Len=6: 113,119,101,114,116,121

VARCHAR2
VARCHAR2 is used to store variable length character strings. The string value's length
will be stored on disk with the value itself.
SQL> CREATE TABLE varchar2_test (col1 VARCHAR2(10));

Table created.

SQL> INSERT INTO varchar2_test VALUES ('qwerty');

1 row created.

SQL> SELECT col1, length(col1), dump(col1) "ASCII Dump" FROM


varchar2_test;

COL1 LENGTH(COL1) ASCII Dump


---------- ------------
------------------------------------------------------------
qwerty 6 Typ=1 Len=6: 113,119,101,114,116,121

>> How would you determine the time zone under which a database was operating?
select DBTIMEZONE from dual;
>> Explain the difference between a FUNCTION, PROCEDURE and PACKAGE.
A function and procedure are the same in that they are intended to be a collection of
PL/SQL code that carries a single task. While a procedure does not have to return any
values to the calling application, a function will return a single value. A package on the
other hand is a collection of functions and procedures that are grouped together based on
their commonality to a business function or application.
>> Name a tablespace automatically created when you create a database.
The SYSTEM tablespace.
>> When creating a user, what permissions must you grant to allow them to connect to
the database?
Grant the CONNECT to the user
>> Explain what partitioning is and what its benefit is.
Partitioning is a method of taking large tables and indexes and splitting them into smaller,
more manageable pieces.

Das könnte Ihnen auch gefallen