0% found this document useful (0 votes)
29 views3 pages

Dba Questions

The document contains questions and answers about SQL and Oracle database concepts. It discusses data types like VARCHAR and VARCHAR2, the RAW datatype, DML statements, DISTINCT keyword, MERGE statement, NULL values, GROUP BY clause, CROSS JOIN, views, deleting duplicate rows, storing pictures in a database, constraints, SUBSTR and INSTR functions, parameter passing modes, Oracle database objects, privileges and grants, $ORACLE_BASE and $ORACLE_HOME, fastest query methods, maximum triggers per table, the DUAL table, Oracle database physical and logical structures, SYSTEM tablespace, hot and cold backups, relationships between databases, tablespaces and data files, and the two memory layers in the Oracle shared pool

Uploaded by

mahmoud010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views3 pages

Dba Questions

The document contains questions and answers about SQL and Oracle database concepts. It discusses data types like VARCHAR and VARCHAR2, the RAW datatype, DML statements, DISTINCT keyword, MERGE statement, NULL values, GROUP BY clause, CROSS JOIN, views, deleting duplicate rows, storing pictures in a database, constraints, SUBSTR and INSTR functions, parameter passing modes, Oracle database objects, privileges and grants, $ORACLE_BASE and $ORACLE_HOME, fastest query methods, maximum triggers per table, the DUAL table, Oracle database physical and logical structures, SYSTEM tablespace, hot and cold backups, relationships between databases, tablespaces and data files, and the two memory layers in the Oracle shared pool

Uploaded by

mahmoud010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

SQL QUESTIONS:

==============
1. Difference between varchar and varchar2 data types?
Varchar can store upto 2000 bytes and varchar2 can store upto 4000 bytes. Varchar
will occupy space for NULL values and Varchar2 will not occupy any space. Both are
differed with respect to space.

2. What is RAW datatype?


RAW datatype is used to store values in binary data format. The maximum size for a
raw in a table in 32767 bytes.

3. What is DML?
Data Manipulation Language (DML) is used to access and manipulate data in the
existing objects. DML statements are insert, select, update and delete and it
won’t implicitly commit the current transaction.

4. How do we display rows from the table without duplicates?


Duplicate rows can be removed by using the keyword DISTINCT in the select
statement.

5. What is the usage of Merge Statement?


Merge statement is used to select rows from one or more data source for updating
and insertion into a table or a view. It is used to combine multiple operations.

6. What is NULL value in oracle?


NULL value represents missing or unknown data. This is used as a place holder or
represented it in as default entry to indicate that there is no actual data
present.

7. What do you mean by GROUP BY Clause?


A GROUP BY clause can be used in select statement where it will collect data across
multiple records and group the results by one or more columns.

8. What is cross join?


Cross join is defined as the Cartesian product of records from the tables present
in the join. Cross join will produce result which combines each row from the first
table with the each row from the second table.

9. What is a View?
View is a logical table which based on one or more tables or views. The tables
upon which the view is based are called Base Tables and it doesn’t contain data.

10. How can we delete duplicate rows in a table?


Duplicate rows in the table can be deleted by using ROWID.

11. Can we store pictures in the database and if so, how it can be done?
Yes, we can store pictures in the database by Long Raw Data type. This datatype is
used to store binary data for 2 gigabytes of length. But the table can have only on
Long Raw data type.
to store the table for faster retrieval. Apply hash value on the table to retrieve
the rows from the table.

12. What are the various constraints used in Oracle?


Following are constraints used:

NULL – It is to indicate that particular column can contain NULL values


NOT NULL – It is to indicate that particular column cannot contain NULL values
CHECK – Validate that values in the given column to meet the specific criteria
DEFAULT – It is to indicate the value is assigned to default value
13. What is difference between SUBSTR and INSTR?
SUBSTR returns specific portion of a string and INSTR provides character position
in which a pattern is found in a string.
SUBSTR returns string whereas INSTR returns numeric.

14. What is the parameter mode that can be passed to a procedure?


IN, OUT and INOUT are the modes of parameters that can be passed to a procedure.

15. What are the different Oracle Database objects?


There are different data objects in Oracle –

Tables – set of elements organized in vertical and horizontal


Views – Virtual table derived from one or more tables
Indexes – Performance tuning method for processing the records
Synonyms – Alias name for tables
Sequences – Multiple users generate unique numbers
Tablespaces – Logical storage unit in Oracle

16. What are privileges and Grants?


Privileges are the rights to execute SQL statements – means Right to connect and
connect. Grants are given to the object so that objects can be accessed
accordingly. Grants can be provided by the owner or creator of an object.

17. What is the difference between $ORACLE_BASE and $ORACLE_HOME?


Oracle base is the main or root directory of an oracle whereas ORACLE_HOME is
located beneath base folder in which all oracle products reside.

18. What is the fastest query method to fetch data from the table?
Row can be fetched from table by using ROWID. Using ROW ID is the fastest query
method to fetch data from the table.

19. What is the maximum number of triggers that can be applied to a single table?
12 is the maximum number of triggers that can be applied to a single table.

20. What is the data type of DUAL table?


The DUAL table is a one-column table present in oracle database. The table has a
single VARCHAR2(1) column called DUMMY which has a value of ‘X’.

DATABASE QUESTIONS:
===================
1. What are the components of physical database structure of Oracle database?
Components of physical database structure are given below.
One or more data files.
Two or more redo log files.
One or more control files.

2. What are the components of logical database structure in Oracle database?


Components of logical database structure.
Tablespaces
Database's schema objects

3. What is a tablespace?
A database contains Logical Storage Unit called tablespaces. A tablespace is a set
of related logical structures. Actually a tablespace groups related logical
structures together.

4. What is a SYSTEM tablespace and when it is created?


When the database is created in Oracle database system, it automatically generate a
SYSTEM named SYSTEM tablespace. The SYSTEM tablespace contains data dictionary
tables for the entire database.

5. What is the difference between hot backup and cold backup in Oracle? Tell about
their benefits also.
Hot backup (Online Backup): A hot backup is also known as online backup because it
is done while the database is active. Some sites can not shut down their database
while making a backup copy, they are used for 24 hour a day, 7 days a week.
Cold backup (Offline Backup): A cold backup is also known as offline backup because
it is done while the database has been shutdown using the SHUTDOWN normal command.

6. What is the relationship among database, tablespace and data file?


An Oracle database contains one or more logical storage units called tablespaces.
These tablespaces collectively store whole data of databases and each tablespace in
Oracle database consists of one or more files called datafiles. These datafiles are
physical structure that confirm with the operating system in which Oracle is
running.

7. How many memory layers are in the Oracle shared pool?


Oracle shared pools contains two layers:
library cache
data dictionary cache

You might also like