Database Related Interview Questions

This is useful for advanced level Database Test Professional and Database Developer and DBA beginner. All questions-answers are based on Oracle Database Management System.

1. What is a Database?
An organized collection, storage of information.

2. What is DBMS?
To manage database, you need some type of system which, that system in Database Management System(DBMS). So, it is a program that stores, retrieves, and modifies data in database based on request.

3. Name some types of databases.
There are four main type of databases: hierarchical, network, relational, and object relational (this type is a new one).

4. What is Data Models?
It is a model developed before building a database system to explore the ideas, improve and understand overall database design. A data model should contains details for database developers, Database Administrators to build and maintain a database system.

5. What is a unique identifiers(UID)?
UID is any combination of attributes or relationships, or both that serves to distinguish entity. Each entity occurrence must be uniquely identifiable. Each attributes that is part of UID is tagged with #, secondary UID with(#).


6.What is primary key and foreign key?
here
7. How do you operate relational database?
By using SQL language. To access database, you can use SQL statements. There are other application programs and tools are also available. But these also use SQL language based on user's request.


8. Tell me about different types of SQL statements.
Data Manipulation Language(DML) ----- SELECT, INSERT,UPDATE,DELETE, MERGE
Data Definition Language(DML) ----- CREATE, ALTER, DROP, RENAME, TRUNCATE, COMMENT
Data Control Language(DCL)----- GRANT, REVOKE
Transaction Control----- COMMIT, ROLLBACK, SAVEPOINT


9. What is table join,  which SQL statement do you use to join tables?
Joining brings together data that is stored in different tables by specifying the link between them. It helps to display data from multiple tables. SELECT statement is used to join tables.


10. What is a Null value?
If a row lacks a data value for particular column, that is called a null. Null value means value is unavailable or inapplicable. It is not a zero or blank space. Some constraints  like NOT NULL or PRIMARY KEY prevent null value being used in the column.


11. What is Concatenation Operator?
It is used to link columns to another columns, arithmetic  expressions, constant value to make a single output column. Operator sign is - || and it is used with select statement where output column name comes after AS keyword. For example:
SELECT column1||column2 AS "OutputColumnName" from table


12. What is a Literal Character Strings ?
A literal is a character, a number, or a date that is included in a SELECT statement. It is not a column name or alias, it is something you use between || and || which will be displayed with query result. ' ' is used for date and character literal. It is used with select statement.


13. What is 'Rules of Precedence'?
It determines the order in which expression are evaluated and calculated. You can override the default order by using parentheses around the calculation that you want to calculate first.


14.How do you display the Table structure?
You can display table structure by using DESCRIBE command.It will display the column names, the data types and constraints(if any).


15: what is SQL Function?
 here


16: what is RR Date Format?
It is the default date format of some database including Oracle.The default date format is: DD-MON-RR. RR date is similar to YY but it also specify century. RR determines the default value for century in INSERT.


17. Explain about different types of joins in brief.
Natural joins:The NATURAL JOIN clause is based on the all columns in the two tables that have the same name and data types.
Self Join: Joins a table to itself.
Nonequijoins: A join condition containing something other then an equality(=) operator.
Outer Joins: returning results with no direct match.
  LEFT OUTER JOINS
  RIGHT OUTER JOINS
CROSS JOINS


18. What is a schema?
A schema is a collection of objects such as table, views, indexes, clusters, stored procedures and database links. 


19. What are the frequently used data-types in SQL(Oracle)?
Some frequently used data-types are:

Varchar2(max size specified) - Variable-length character data.
char(size) - Fixed length character data.
Number(precision, scale) - Variable-length numeric data.
date, timestamp - date and time

20 Tell me about database constraints.
Database constrains are the restrictions, that prevents the invalid data entry to the table. Constraints enforces the rules on the data and constraints must be satisfied  for the any operation to be succeed
PRIMARY KEY, UNIQUE, NULL, NOT NULL, FOREIGN KEY, CHECK are the major constraints. Constrains can be applied when creating a table or can be added later on with the alter statement.

21. What is NOT NULL constraint ?
NOT NULL constraint ensure that a NULL value is not permitted.




1 comment:

Jobs In India said...

Thanks for sharing "Database Related Interview Questions".

Jobs In India