lOMoARcPSD|49325232
lOMoARcPSD|49325232
DBMS LAB VIVA QUESTIONS
1. What is DBMS?
• Software that manages data
• Allows user to DEFINE datatypes and constraints, CONSTRUCT
(store) data and MAINPULATE data through queries.
Hierarchical, Network, RDBMS, OODBMS NOSQL
2. Advantages of DBMS
• Redundancy of data avoided.
• Restricted and protected access to data.
• Permanent/Persistent storage for program objects.
• Back up recovery services. Efficient query processing.
• Storage structure and indices for efficient query processing and
retrieval.
3. What is DML?
• Data Manipulation Language.
• High level non procedural language (SQL).
• Can be embedded into programming languages.
• CRUD operations to create, read, update, and delete data
4. Commands of DML
• INSERT, SELECT, UPDATE and Delete commands.
• SELECT, INSERT, UPDATE, DELETE, MERGE in SQL
5. What is primary key?
• If a relation has many candidate keys, one is chosen arbitrarily to
be the primary key.
• Primary key attributes are underlined. PK used to identify tuple
uniquely.
6. What are the types of databases?
Structured, Unstructured, semi-structured.
lOMoARcPSD|49325232
7. Types of abstraction
• Internal Level or Physical Level- Physical storage structure of
the database
• Conceptual or Logical Level- Describes the Database structure of
the whole database
• External or View level- related to the data, which is viewed by
specific end users, nearest to the user.
8. What is a candidate key?
• A relational schema may have > 1 key. Each of these keys is called
candidate key. 9. What is the use of DBMS?
• optimize and manage the storage and retrieval of data from
databases
• Business, Social network, Science and research, Finance,
Airline…
10. What are the types of relationships?
• 1:1One-to-one relationship.
• 1:N One-to-many relationship.
• M:N Many-to-many relationship.
11. What is a relation schema?
• Description of a relation.
• consists of the relation’s name, set of attributes/field names/column
names.
• set of relational tables and associated items that are related to one
another.
12. What is an entity?
Basic concept of ER Model.
3
lOMoARcPSD|49325232
• Refers to each specific object in the mini world.
• Physical or conceptual.
• Entities have attributes. Weak or Strong entity.
13.Types of attributes.
• Simple and composite.
• Single values and multivalued.
• Stored or derived – dotted line. (age derived from DOB)
Complex attributes.
14. What is entity set?
• Collection of similar entities. (Same type: either strong or weak)
15. What is weak entity set?
• An entity set that does not have a primary key.
• does not contain sufficient attributes to uniquely identify its
entities
16. Types of inner and outer join (explain too)?
• Inner Join- Natural Join and EQUI Join
• Outer Join- full outer join, left outer, right outer join
17. Difference between primary and unique key?
• Unique key is same as that of PK except PK will not accept NULL
values whereas Unique key can accept NULL values
4
lOMoARcPSD|49325232
18. What is normalization?
• Reducing Null entries. Can’t achieve through ER Diagram.
OR
• Splitting a single table DB (flat file) into multiple tables (relational
DB)
19. What is view?
• A view is the result set of a stored query on the data.
• hide the complexity that exists in a multiple table join.
• User can select and perform join without knowing how it actually
works.
• Views can join and simplify multiple tables into a single virtual
table.
20.What are commands in DCL?
• GRANT REVOKE
21. What is DCL?
• Data control language (DCL)
• Similar to a computer programming language used to control
access to data stored in a database (Authorization). (SQL).
22. Why does a database use Inner join types?
• Returns only those results from the tables that match the specified
condition and hides other rows and columns.
23. what are entity types?
• Strong entity type – has key attribute.
• Weak entity type – no key attribute.
• Intangible entity type- exists logically not physically.
5
lOMoARcPSD|49325232
24. Drop vs truncate
• DROP - remove table definition and its contents TRUNCATE-
delete all the rows from the table
25. What relationship in database model?
a situation that exists between two relational database tables when
one table has a foreign key that references the primary key of the
other table
26. What are foreign keys?
• refers to the field in a table which is the primary key of another
table.
• provides a link between data in two tables.
27. What is DDL interpreter and DDL Compiler?
• INTERPRETER- interprets the DDL statements and records the
generated statements in the table.
• COMPILER- processes schema definitions specified in the DDL
28. Disadvantages of query?
• No indexes
• Excessive compiling of stored procedures
• Complicated joins
• Cursors and temporary tables showcase a bad presentation.
29. Disadvantage of DBMS?
• Too huge
• Complexity
• Costly
• Database failure
30. Can views have constraints?
• Check
• Read only
6
lOMoARcPSD|49325232
• Primary key
• Unique key
• Foreign key
31. Advantages of DBMS over file system
• Flat file system has modification errors because single table.
Also, flat file has duplication causing these errors ^ Relational DB
stores data in >1 table => prevents duplication and hence less
storage required as well.
• Relational DB: updates less prone to errors.
32. What is unique key?
• Set of one or more than one fields/columns of a table that uniquely
identify a record in a database table. Allows null constraint.
33. What are different DBMS languages?
• DDL – Data definition Language
1. CREATE
2. ALTER
3. DROP
• DML – Data Manipulation Language
1. SELECT
2. INSERT
3. UPDATE
4. DELETE
5. MERGE
• DCL – Data Control Language
1. GRANT
2. REVOKE
• TCL – Transaction Control Language
34.What is database?
• Collection of data
• Logically coherent collection Specific purpose
7
lOMoARcPSD|49325232
35. What is superkey?
Set of attributes with:
1. No 2 tuples having same value for SK.
8
lOMoARcPSD|49325232
2. This condition must hold good in any state.
36.What is key?
A minimal SK such that removing any one attribute from its set,
destroys the uniqueness property.
KEY IS SUPERKEY NOT VICE VERSA.
37. What is drop?
• delete a whole database or just a table.
• The DROP statement destroys the objects
38. What is SQL?
• Sequential Query Language.
• RDBMS
39. What are integrity constraints?
• Set of rules that ensure data insertion, updating… maintain data
integrity.
• guard against accidental damage to the database.