What is DBMS?
DBMS is a collection of programs that facilitates users to create and maintain a database. In other words, DBMS provides us an interface or tool for performing different operations such as the creation of a database, inserting data into it, deleting data from it, updating the data, etc.
What is a database?
A Database is a logical, consistent and organized collection of data that it can easily be accessed, managed and updated.
What are the advantages of DBMS?
DBMS is a collection of programs that facilitates users to create and maintain a database. In other words, DBMS provides us an interface or tool for performing different operations such as the creation of a database, inserting data into it, deleting data from it, updating the data, etc.
What is a database?
A Database is a logical, consistent and organized collection of data that it can easily be accessed, managed and updated.
What are the advantages of DBMS?
- Redundancy control
- Restriction for unauthorized access
- Provides multiple user interfaces
- Provides backup and recovery
- Enforces integrity constraints
- Ensure data consistency
- Easy accessibility
- Easy data extraction and data processing due to the use of queries
What is RDBMS?
RDBMS stands for Relational Database Management Systems. It is used to maintain the data records and indices in tables. RDBMS is the form of DBMS which uses the structure to identify and access data concerning the other piece of data in the database. RDBMS is the system that enables you to perform different operations such as- update, insert, delete, manipulate and administer a relational database with minimal difficulties.
What is DDL (Data Definition Language)?
Data Definition Language (DDL) is a standard for commands which defines the different structures in a database. Most commonly DDL statements are CREATE, ALTER, and DROP. These commands are used for updating data into the database.
What is DML (Data Manipulation Language)?
DData Manipulation Language (DML) is a language that enables the user to access or manipulate data as organized by the appropriate data model. For example- SELECT, UPDATE, INSERT, DELETE.
How many types of database languages are?
There are four types of database languages:
Data Definition Language (DDL) e.g., CREATE, ALTER, DROP, TRUNCATE, RENAME, etc. All these commands are used for updating the data that?s why they are known as Data Definition Language.
Data Manipulation Language (DML) e.g., SELECT, UPDATE, INSERT, DELETE, etc. These commands are used for the manipulation of already updated data that's why they are the part of Data Manipulation Language.
DATA Control Language (DCL) e.g., GRANT and REVOKE. These commands are used for giving and removing the user access on the database. So, they are the part of Data Control Language.
Transaction Control Language (TCL) e.g., COMMIT, ROLLBACK, and SAVEPOINT. These are the commands used for managing transactions in the database. TCL is used for managing the changes made by DML.
Define a Relation Schema and a Relation.
A Relation Schema is specified as a set of attributes. It is also known as table schema. It defines what the name of the table is. Relation schema is known as the blueprint with the help of which we can explain that how the data is organized into tables. This blueprint contains no data.
A relation is specified as a set of tuples. A relation is the set of related attributes with identifying key attributes
See this example:
Let r be the relation which contains set tuples (t1, t2, t3, ..., tn). Each tuple is an ordered list of n-values t=(v1,v2, ...., vn).
What is a degree of Relation?
The degree of relation is a number of attribute of its relation schema. A degree of relation is also known as Cardinality it is defined as the number of occurrence of one entity which is connected to the number of occurrence of other entity. There are three degree of relation they are one-to-one(1:1), one-to-many(1:M), many-to-one(M:M).
What is the Relationship?
The Relationship is defined as an association among two or more entities. There are three type of relationships in DBMS-
One-To-One: Here one record of any object can be related to one record of another object.
One-To-Many (many-to-one): Here one record of any object can be related to many records of other object and vice versa.
Many-to-many: Here more than one records of an object can be related to n number of records of another object.
What is Relational Algebra?
Relational Algebra is a Procedural Query Language which contains a set of operations that take one or two relations as input and produce a new relationship.
There are few fundamental operations of relational algebra:
- select
- project
- set difference
- union
- rename,etc.
What is Relational Calculus?
Relational Calculus is a Non-procedural Query Language which uses mathematical predicate calculus instead of algebra.
There is two type of relational calculus:
- Tuple relational calculus
- Domain relational calculus
Describe the types of keys?
There are following types of keys:
Primary key: The Primary key is an attribute in a table that can uniquely identify each record in a table. It is compulsory for every table.
Candidate key: The Candidate key is an attribute or set of an attribute which can uniquely identify a tuple. The Primary key can be selected from these attributes.
Super key: The Super key is a set of attributes which can uniquely identify a tuple. Super key is a superset of the candidate key.
Foreign key: The Foreign key is a primary key from one table, which has a relationship with another table. It acts as a cross-reference between tables.
What is normalization?
Normalization is a process of analysing the given relation schemas according to their functional dependencies. It is used to minimize redundancy and also used to minimize insertion, deletion and update distractions. Normalization is considered as an essential process as it is used to avoid data redundancy, insertion anomaly, updation anomaly, deletion anomaly.
There most commonly used normal forms are:
- First Normal Form(1NF)
- Second Normal Form(2NF)
- Third Normal Form(3NF)
- Boyce & Codd Normal Form(BCNF)
What is 1NF?
1NF is the First Normal Form. It is the simplest type of normalization that you can implement in a database. The primary objectives of 1NF are to:
- Every column must have atomic (single value)
- To Remove duplicate columns from the same table
- Create separate tables for each group of related data and identify each row with a unique column
What is 2NF?
2NF is the Second Normal Form. A table is said to be 2NF if it follows the following conditions:
The table is in 1NF, i.e., firstly it is necessary that the table should follow the rules of 1NF.
Every non-prime attribute is fully functionally dependent on the primary key, i.e., every non-key attribute should be dependent on the primary key in such a way that if any key element is deleted, then even the non_key element will still be saved in the database.
What is 3NF?
3NF stands for Third Normal Form. A database is called in 3NF if it satisfies the following conditions:
It is in second normal form.
There is no transitive functional dependency.
For example: X->Z
What is BCNF?
BCMF stands for Boyce-Codd Normal Form. It is an advanced version of 3NF, so it is also referred to as 3.5NF. BCNF is stricter than 3NF.
A table complies with BCNF if it satisfies the following conditions:
It is in 3NF.
For every functional dependency X->Y, X should be the super key of the table. It merely means that X cannot be a non-prime attribute if Y is a prime attribute.
What is Denormalization?
Denormalization is the process of boosting up database performance and adding of redundant data which helps to get rid of complex data. Denormalization is a part of database optimization technique. This process is used to avoid the use of complex and costly joins.
What is functional Dependency?
Functional Dependency is the starting point of normalization. It exists when a relation between two attributes allow you to determine the corresponding attribute's value uniquely. The functional dependency is also known as database dependency and defines as the relationship which occurs when one attribute in a relation uniquely determines another attribute. It is written as A->B which means B is functionally dependent on A.
What is the E-R model?
E-R model is a short name for the Entity-Relationship model. This model is based on the real world. It contains necessary objects (known as entities) and the relationship among these objects. Here the primary objects are the entity, attribute of that entity, relationship set, an attribute of that relationship set can be mapped in the form of E-R diagram.
In E-R diagram, entities are represented by rectangles, relationships are represented by diamonds, attributes are the characteristics of entities and represented by ellipses, and data flow is represented through a straight line.
What is an entity?
The Entity is a set of attributes in a database. An entity can be a real-world object which physically exists in this world. All the entities have their attribute which in the real world considered as the characteristics of the object.
For example: In the employee database of a company, the employee, department, and the designation can be considered as the entities. These entities have some characteristics which will be the attributes of the corresponding entity.
What is an attribute?
An attribute refers to a database component. It is used to describe the property of an entity. An attribute can be defined as the characteristics of the entity. Entities can be uniquely identified using the attributes. Attributes represent the instances in the row of the database.
For example: If a student is an entity in the table then age will be the attribute of that student.
What is Data Independence?
Data independence specifies that "the application is independent of the storage structure and access strategy of data." It makes you able to modify the schema definition at one level without altering the schema definition in the next higher level.
It makes you able to modify the schema definition in one level should not affect the schema definition in the next higher level.
There are two types of Data Independence:
Physical Data Independence: Physical data is the data stored in the database. It is in the bit-format. Modification in physical level should not affect the logical level.
For example: If we want to manipulate the data inside any table that should not change the format of the table.
Logical Data Independence: Logical data in the data about the database. It basically defines the structure. Such as tables stored in the database. Modification in logical level should not affect the view level.
For example: If we need to modify the format of any table, that modification should not affect the data inside it.
What is Join?
The Join operation is one of the most useful activities in relational algebra. It is most commonly used way to combine information from two or more relations. A Join is always performed on the basis of the same or related column. Most complex queries of SQL involve JOIN command.
There are following types of join:
Inner joins: Inner join is of 3 categories. They are:
- Theta join
- Natural join
- Equi join
Outer joins: Outer join have three types. They are:
- Left outer join
- Right outer join
- Full outer join
What is the difference between a DELETE command and TRUNCATE command?
DELETE command: DELETE command is used to delete rows from a table based on the condition that we provide in a WHERE clause.
DELETE command delete only those rows which are specified with the WHERE clause.
DELETE command can be rolled back.
DELETE command maintain a log, that's why it is slow.
DELETE use row lock while performing DELETE function.
TRUNCATE command: TRUNCATE command is used to remove all rows (complete data) from a table. It is similar to the DELETE command with no WHERE clause.
The TRUNCATE command removes all the rows from the table.
The TRUNCATE command cannot be rolled back.
The TRUNCATE command doesn't maintain a log. That's why it is fast.
TRUNCATE use table log while performing the TRUNCATE function.
What is the use of DROP command and what are the differences between DROP, TRUNCATE and DELETE commands?
DROP command is a DDL command which is used to drop/delete the existing table, database, index or view from the database.
The major difference between DROP, TRUNCATE and DELETE commands are:
DROP and TRUNCATE commands are the DDL Commands which are used to delete tables from the database and once the table gets deleted, all the privileges and indexes that are related to the table also get deleted. These 2 operations cannot be rolled back and so should be used with great care.
DELETE Command, on the other hand, is a DML Command which is also used to delete rows from the table and this can be rolled back.
Note: It is recommended to use ‘Where’ clause along with the DELETE command else the complete table will get deleted from the database.
Explain the concept of ACID properties in DBMS?
Ans: ACID properties is the combination of Atomicity, Consistency, Isolation, and Durability properties. These properties are very helpful in allowing a safe and secure way of sharing the data among multiple users.
Atomicity: This is based on the concept of “either all or nothing” which basically means that if any update occurs inside the database then that update should either be available to all the others beyond user and application program or it should not be available to anyone beyond the user and application program.
Consistency: This ensures that the consistency is maintained in the database before or after any transaction that takes place inside the database.
Isolation: As the name itself suggests, this property states that each transaction that is occurring is in isolation with others i.e. a transaction which has started but not yet completed should be in isolation with others so that the other transaction does not get impacted with this transaction.
Durability: This property states that the data should always be in a durable state i.e. any data which is in the committed state should be available in the same state even if any failure or restart occurs in the system.
What is the use of DROP command and what are the differences between DROP, TRUNCATE and DELETE commands?
DROP command is a DDL command which is used to drop/delete the existing table, database, index or view from the database.
The major difference between DROP, TRUNCATE and DELETE commands are:
DROP and TRUNCATE commands are the DDL Commands which are used to delete tables from the database and once the table gets deleted, all the privileges and indexes that are related to the table also get deleted. These 2 operations cannot be rolled back and so should be used with great care.
DELETE Command, on the other hand, is a DML Command which is also used to delete rows from the table and this can be rolled back.
Note: It is recommended to use ‘Where’ clause along with the DELETE command else the complete table will get deleted from the database.
Explain the concept of ACID properties in DBMS?
Ans: ACID properties is the combination of Atomicity, Consistency, Isolation, and Durability properties. These properties are very helpful in allowing a safe and secure way of sharing the data among multiple users.
Atomicity: This is based on the concept of “either all or nothing” which basically means that if any update occurs inside the database then that update should either be available to all the others beyond user and application program or it should not be available to anyone beyond the user and application program.
Consistency: This ensures that the consistency is maintained in the database before or after any transaction that takes place inside the database.
Isolation: As the name itself suggests, this property states that each transaction that is occurring is in isolation with others i.e. a transaction which has started but not yet completed should be in isolation with others so that the other transaction does not get impacted with this transaction.
Durability: This property states that the data should always be in a durable state i.e. any data which is in the committed state should be available in the same state even if any failure or restart occurs in the system.
MORE VIVA QUESTIONS
DBMS VIVA Questions
Reviewed by admin
on
October 21, 2019
Rating:
No comments: