Presentation is loading. Please wait.

Presentation is loading. Please wait.

DBMS Questions and Answers.

Similar presentations


Presentation on theme: "DBMS Questions and Answers."— Presentation transcript:

1 DBMS Questions and Answers

2 What is DBMS? DBMS is the acronym of Database Management System. A system or software which keeps information of data and to perform several operations on data stored within the database. What is database? This is the design for storing, designing, retrieving the information and data. What is the advantage of DBMS? Advantages of DBMS Redundancy Control Restrict Unauthorized Access Providing Multiple User Interfaces Enforcing Integrity Constant Provide Backup and Recovery.

3 What is three level of data abstraction?
a) Physical level: Lower Level b) Logical level: Next Higher Level c) View level: Highest Level What are the types of data independence? The independence means manipulating the one other should not be impacted. For this DATABASE these are of two types. These are as follows- Physical independence: the changes occur in physical layer of DBA and due to that the logical level should not effected. Logical independence: the changes occur in logical layer of DBA and due to that the view level should not effected. What is a view? This is the virtual table. It is virtual as because this need no space for this. Application user or developer can’t modify the table by this way.

4 What is data model? This concept to describing data, data relationships data semantics and constraints. There uses some graphical representation to implement the concept. Such as- ER diagram. What is an entity? It is a ‘thing’ in the real world with an independent existence. This is the characteristics represented in ER model by rectangle in ER model. What is an attribute? It is a particular property, which describes the entity. It is representing by oval shape in ER model. What is weak entity? An entity set may not have sufficient attributes to form a primary key, and its primary key compromises of its partial key and primary key of its parent entity, then it is said to be Weak Entity set.

5 What are the Properties of the Relational Tables?
Relational tables have six properties which are as follows: - Values are atomic. Column values are of the same kind. Each row is unique. The sequence of columns is insignificant. The sequence of rows is insignificant. Each column has a unique name. What is Normalization? In relational database design, the process to organize data in order to minimize redundancy is called normalization. In normalization we generally divide a database into two or more tables and define relationships between the tables. The main motive is to isolate data so that additions, deletions, and modifications of a field can be made in just one table.

6 What is De-normalization?
De-normalization is the process to optimize the performance of a database by adding redundant data or a technique inorder to move from higher to lower normal forms of database modeling to speed up database access. How is ACID property related to Database? ACID (Atomicity Consistency Isolation Durability) is a concept that database professionals generally look for while evaluating any databases and application architectures. For a reliable database, all this four attributes must be present. Atomicity is an all-or-none proposition. Consistency means a transaction never leaves a database in a half- finished state. Isolation keeps transactions separated from each other unless and until they are finished Durability means the database will keep track of changes that are pending in such a manner such that the server can recover from an abnormal termination.

7 Explain in brief the different Normalization forms?
1NF: Repeating groups are eliminated Make a separate table for each set of related attributes. Each field contains only one value from its attribute domain. o 2NF: Eliminate Redundant Data If an attribute depends on only part of a multi-valued key, then it should be remove to a separate table. 3NF: Eliminate Columns which are not dependent on key If attributes do not contribute to a description of the key, then remove them to a separate table. All attributes must be directly dependent on the primary key.

8 BCNF: Boyce-Codd Normal Form
If there are non-trivial dependencies between candidate key attributes, then separate them out into distinct tables. 4NF: Isolate independent multiple relationships No table will contain two or more 1:n or n:m relationships that are not directly related. 5NF: Isolate related multiple relationships Remember, these normalization guidelines are cumulative. For a database to be in 3NF, it must first fulfill all the criteria of a 2NF and 1NF database.

9 State Difference between simple file and database?
Main difference between a simple file and database that database has independent way of accessing information while simple files do not. File can store, manage and retrieve part of a database but not the independent way of accessing data. File do not provide multi-user capabilities while a DBMS can provide multi-user capabilities. State difference between DBMS and RDBMS? DBMS provides a systematic and organized way to store, manage and retrieve from collection of logically related information. RDBMS provides extra feature that is relationship integrity. So in short, RDBMS = DBMS + REFERENTIAL INTEGRITY What are E-R diagrams? E-R diagram is Entity-Relationship diagram which shows relationship between various tables in the database.

10 What are DML and DDL statements?
DML stands for Data Manipulation Language Statements. They update data values in table. Some Important DML statements are given: - SELECT – will get data from a database table UPDATE – It updates data in a table DELETE – It deletes data from a database table INSERT INTO – will inserts new data into a database table DDL stands for Data Definition Language. They generally change structure of the database objects like table, index etc. Most important DDL statements are given below: - CREATE TABLE -It will create a new table in the database. ALTER TABLE – It will change table structure in database. DROP TABLE – It will delete a table from database CREATE INDEX – It will create an index DROP INDEX – It will delete an index

11 Can you explain Insert, Update and Delete query?
Insert statement is for inserting new rows in to table. Update is use to update existing data in the table. Delete statement to delete a record from the table. Explain is DML (Data Manipulation Language)? DBMS Interview questions This language enable user to access or manipulate data as organized by appropriate data model. Procedural DML or Low level: DML requires a user to indicate what data are needed and how to get those data. Non-Procedural DML or High level: DML requires a user to indicate what data are needed without the need of specifying how to get those data.

12 Explain Data Warehousing?
Data Warehousing is a technique in which the data is stored & accessed from central location & it will support some strategic decisions. Data Warehousing is not a requirement for data mining just to make it efficient. What is Data mining? Data mining is a technique by which one can analyze the current data from different perspectives and summarize the information in an effective manner. It’s generally used to derive some valuable information from the already existing data or to predict sales to increase customer market. There are two basic aims of Data mining: - Prediction Summarization

13 1.What is REDO in database?
Opposite of UNDO Re-does the previous operation on database again. REDO is used for ROLLBACK. None of the above. Answer: C The most important point to remember is REDO is not the opposite of UNDO. Whenever a DML transaction happens in database, the data to be updated goes to the DATABASE BUFFER CACHE. From here the data is written to REDO BUFFER and then to REDO Logs. These logs are saved for future use. Future ROLLBACK and DATA RECOVERY operations require these logs. Without these logs it is impossible to do DATA RECOVERY. If ARCHIVING is enabled then these logs are bundled or archived and stored.

14 2. COMMIT takes more time than ROLLBACK .
True False Answer: B COMMIT simply confirms the transaction and writes the committed data to disk and clears UNDO file. While ROLLBACK does the opposite transaction. ROLLBACK also clears UNDO file. ROLLBACK takes much longer time because it has to execute one full transaction (opposite) and COMMIT it. Hence COMMIT is faster than ROLLBACK. 3. What is the difference between ORDERBY and GROUPBY? ORDERBY performs sorting while GROUPBY AGGREGATES Data GROUPBY sorts data while ORDERBY puts data in order Both perform sorting. None of the above Answer: A

15 The ORDER BY performs a sort operation
The ORDER BY performs a sort operation. So think of a telephone phone directory. SELECT NAME FROM DIRECTORY ORDER BY NAME This would ensure that the result set would be sorted in (by default) ascending order. The GROUP BY operation aggregates data in your result set. Continuing the example of the telephone directory SELECT CITY, COUNT(CITY) FROM DIRECTORY GROUP BY CITY This would ensure that the result set would be grouped according to the city where the individual lives. The COUNT and GROUP BY works in conjunction.

16 4. Which of the following records all modifications to data?
UNDO file Alert Log file Archive file Both A & B Answer: C Alert log file records all modifications to the database but modifications to data alone is recorded by Archive files. UNDO file stores UNDO tables which have opposite transactions recorded. Archive files also help in recovery of data.

17 5. Which is better ? SQL Procedures Answer: SQL SQL is often much shorter to write - you can do an update or summary procedure in one line of code that would take you several lines of procedural. For set-based problems - SQL is much faster processor-wise and IO wise too because all the underlining looping iteration is delegated to a database server process that does it in a very low level way and uses IO/processor more efficiently and knows the current state of the data - e.g. what other processes are asking for the data If you were to update say a sales person of all customers in a particular region - your procedural way would look something like this do until eof

18 if rs("state") = "NH" then rs("salesperson") = "Mike" end if
rs.next loop The SQL way would be: UPDATE customers SET salesperson = "Mike" WHERE state = "NH" If you had, say 2 or 3 tables you need to check, your procedural quickly becomes difficult to manage as you pile on nested loop after loop.

19 Thanks….


Download ppt "DBMS Questions and Answers."

Similar presentations


Ads by Google