Vous êtes sur la page 1sur 5

SQL Interview Questions

Database Programming FAQ


Topic: RDBMS
1. What is Database?
Ans: Database is an organized collection of related data which is designed for some specific
purpose.
2. What is Relational Database?
Ans: In a relational database relationship/association can be established among different
relations/tables. As a result of which, it is possible to fetch data from two or more tables by
joining.
3. What is Non-Relational Database?
Ans: In a non-relational database relationship/association can not be established (Referential
Integrity is not supported) among different relations/tables. As a result of which, it is not
possible to fetch data from two or more tables by joining.
4. What is DBMS?
Ans: It is a software that enables user to create and maintain non-relational database. Example:
FoxPro etc.
5. What is RDBMS?
Ans: It is a software that enables user to create and maintain relational database. Example:
Oracle, SQL Server, DB2 etc.
6. What is a Database System?
Ans: Database and DBMS/RDBMS software together is called as Database System.
44. What is a Flat File Database?
Ans: It's a database in which there are no programs or user access languages.
7. What are advantages of DBMS/RDBMS?
Ans:
Reduction of redundant data
Data Security
Data Integrity
Data Abstraction
Data Independence
Concurrent Access
SQL Interview Questions

Providing Backup and Recovery
8. What is Data Abstraction in RDBMS?
Ans: It is a property of RDBMS for ensuring that, only a certain level of details will be visible to a
certain level of user by hiding the implementation details.
9. What are three levels of Data Abstraction?
Ans: Three levels of abstraction are:
Physical level: The lowest level of abstraction describes how data are stored.
Logical level: The next higher level of abstraction, describes what data are stored in
database and what relationship among those data.
View level: The highest level of abstraction describes only part of entire database.
25. What is Data Independence?
Ans: The ability to modify a database definition in one level without affecting the
definition in a higher level is called data independence.
26. What is Physical Data Independence?
Ans: The ability to modify the database at physical level with less or no impact at
logical/conceptual level is called as physical data independence.
27. What is Logical Data Independence?
Ans: The ability to modify the database at logical/conceptual level with less or no impact
at view level is called as logical data independence.
28. Differentiate between Data and Information.
Ans: Any number or text or audio or video etc. which is stored in a database is called as Data
and as per the requirement which is retrieved/fetched from the database is called as Information.
56. What is Data Warehouse?
Ans: A data warehouse is a centralized database that captures information from various
parts of an organization's business processes.

29. How to communicate with DBMS/RDBMS?
SQL Interview Questions

Ans: By using SQL, it is possible to communicate with DBMS/RDBMS.
30. What is SQL?
Ans: It's a language used for accessing and manipulating database.
31. What is DDL?
Ans: Data Definition language (DDL) is a syntax for creating, modifying, renaming or dropping
database and database objects like table, index, view etc. Example: CREATE, ALTER, DROP,
RENAME, TRUNCATE etc.
32. What is DML?
Ans: Data Manipulation Language (DML) is a syntax for inserting, updating or deleting data in
a database. Example: INSERT, UPDATE, DELETE etc.
33. What is TCL?
Ans: Transaction Control Language (TCL) is a syntax for controlling transactional
processing in a database. Example: COMMIT, ROLLBACK, SAVEPOINT
34. What is DCL?
Ans: Data Control Language (DCL) is a syntax for controlling access to data stored in a
database. Example: GRANT, REVOKE
35. What is DQL?
Ans: Data Query Language (DQL) is a syntax for retrieving/fetching data stored in a database.
Example: SELECT
45. What is a Query?
Ans: A query relates to a user commands that are used to interact with database.
36. What is Transaction?
Ans: A transaction is a unit of work (one or more SQL statements) for retrieving data or
updating database.
37. How a transaction can be completed in Database?
Ans: Transaction can be completed either by COMMIT (Explicit or Implicit) or by ROLLBACK
(Explicit or Implicit).
SQL Interview Questions

38. Compare and contrast between COMMIT and ROLLBACK.
Ans:
Difference: COMMIT is used to make the last transaction permanent
whereas ROLLBACK is used to undo/cancel the last transaction.
Similarity: Both are used to complete a transaction.
40. In which situation an Implicit COMMIT occurs?
Ans: Implicit COMMIT occurs in following situations:
When any DDL/DCL command is issued.
User normally close the session.
41. In which situation an Implicit ROLLBACK occurs?
Ans: Implicit ROLLBACK occurs in following situations:
When user normally close the session.
When instance crashes.
89. What is index?
Ans: Index is a database object which improves query performance.
90. What is view and how it is advantageous?
Ans: A view is a named and query. Views do not contain any data - it is just a stored query in
the database that can be executed when called.
Some of the advantages of using views are as follows:
Reduce the complexity of SQL statements
Share only specific rows in a table with other users
Hide the NAME and OWNER of the base table
91. What is Metadata?
Ans: Metadata is data about data. It is descriptive information about a particular data set,
object, or resource, including how it is formatted, and when and by whom it was created and
maintained.
SQL Interview Questions

Vous aimerez peut-être aussi