Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Database Management System

1.Define DBMS.
→ A Database Management System (DBMS) is software designed to store, retrieve,
define, and manage data in a database.
OR
→ A database management system (DBMS) is a collection of programs enabling
users to create and maintain a database.

2.Define Data Model. List categories.


→ Data modelling is the process of diagramming data flows. When creating a new
or alternate database structure, the designer starts with a diagram of how data
will flow into and out of the database.

3.Define Data Independence. Mention their types.


→ Data independence is the ability to modify one level of a DBMS without
affecting the next higher level's data structure or access methods. It's of two
types, physical and logical.

4.Who is end users? Mention their categories.


→ End users are the people whose jobs require access to a database for querying,
updating and generating reports.
→ Database Administrators (DBA)
→ Database Designers.
→ System Analysts.
→ Application Programmers / Back-End Developers.
→ Naive Users / Parametric Users.
→ Sophisticated Users.
→ Casual Users / Temporary Users.

5.What is the role played by DBA?


→ A Database Administrator (DBA) is an individual or person responsible
for controlling, maintaining, coordinating, and operating a database management
system. Managing, securing, and taking care of the database systems is a prime
responsibility.

6.What is schema and instance?


→ A database schema defines how data is organized within a relational database; this
is inclusive of logical constraints such as, table names, fields, ...
→ Schema refers to the overall description of any given database. Instance basically
refers to a collection of data and information that the database stores at any
particular moment.
www.ourcreativeinfo.in
Database Management System

6.Define Metadata ?
→ Metadata is simply defined as data about data. It means it is a description and
context of the data. It helps to organize, find and understand data.

7.Define data and database.


→ Data : means known facts that can be recorded and that have implicit meaning.
→ Database : It is a collection of logically related data.
→ Database example: MySQL, SQL Server, MongoDB, Oracle Database,
PostgreSQL, Informix, Sybase, etc.

9.What are the basic task of DBMS?


→ Data Dictionary Management,
→ Data Storage Management,
→ Data Transformation and Presentation,
→ Security Management,
→ Multi user Access Control,
→ Backup and Recovery Management,
→ Data Integrity Management,
→ Database Access Languages and Application Programming Interfaces and
→ Database Communication interfaces

What are database system utilities? Give example.


→ A DBMS also provides a set of utilities for managing and controlling database
activities. Examples of database utilities include reorganization, runstats,
backup and copy, recover, integrity check, load data, unload data and repair
database.

11.List the responsibilities of DBA.


→ Creating and maintaining database standards and policies.
→ Supporting database design, creation, and testing activities.

www.ourcreativeinfo.in
Database Management System

→ Managing the database availability and performance, including incident and


problem management.
→ Administering database objects to achieve optimum utilization.

12.Mention , when it is not suitable to use DBMS.


→ Small scale application
→ Real time data processing
→ Static data
→ Budget constraints
→ Single user application

Unit -2
1. Define attribute and entity and give example.
(i) entity

www.ourcreativeinfo.in
Database Management System

→ In a database management system (DBMS), an entity is a piece of data that is stored


in the database. An entity can be a person, place, thing, or even an event.

(ii) Attribute
→ In a database management system (DBMS), an attribute is a piece of data that
describes an entity. For example, in a customer database, the attributes might be
name, address, and phone number.

2. Define primary key and foreign key.

Primary key :
→ A primary key is used to ensure that data in the specific column is unique. A column
cannot have NULL values.
→ Domain integrity constraint contains a certain set of rules or conditions to restrict
the kind of attributes or values a column can hold in the database table.
→ The data type of a domain can be string, integer, character, DateTime, currency,
etc.
→ STUD_NO, as well as STUD_PHONE both, are candidate keys for relation STUDENT
but STUD_NO can be chosen as the primary key (only one out of many candidate
keys).

Foreign key :
→ A foreign key is a column or group of columns in a relational database table that
provides a link between data in two tables. It is a column (or columns) that
references a column (most often the primary key) of another table.
→ STUD_NO in STUDENT_COURSE is a foreign key to STUD_NO in STUDENT relation.

Types of keys (refer book for easy reference)

3.How primary key is useful ?


→ A primary key is used to ensure that data in the specific column is unique. A
column cannot have NULL values.

What is weak entity? Give an example.


→ The weak entity in DBMS do not have a primary key and are dependent on the
parent entity. It mainly depends on other entities.

→ Continuing our previous example, Professor is a strong entity, and the primary key
is Professor_ID. However, another entity is Professor_Dependents, which is our
Weak Entity.
www.ourcreativeinfo.in
Database Management System

What is an entity type? Give an example.


→ Entity type. A person, organization, object type, or concept about which
information is stored.
→ Describes the type of the information that is being mastered. An entity type
typically corresponds to one or several related tables in database.
→ Examples of an entity are a single person, single product, or single
organization.

What is relation and tuple? Give example.


→ A relational database includes tables containing rows and columns.
→ A tuple, also known as a record or row, is a basic unit of data in a relational
database management system (DBMS).

Define the term entity give example.


→ Entity. A single unique object in the real world that is being mastered. Examples
of an entity are a single person, single product, or single organization. Entity
type. A person, organization, object type, or concept about which information
is stored.

Strong v/s weak entity type.

Give different DBMS languages.


→ Data definition language (DDL) ...

www.ourcreativeinfo.in
Database Management System

→ Data manipulation language (DML) ...


→ Data control language (DCL) ...
→ Transaction control language (TCL)

21. Write syntax and example of CREATE TABLE command.


→ Syntax. CREATE TABLE table_name( column1 datatype, column2 datatype, column3
datatype, ..... columnN datatype, PRIMARY KEY( one or more columns ) ); CREATE
TABLE is the keyword telling the database system what you want to do. In this case,
you want to create a new table.

What is domain of relation? Give example.


→ A domain is a unique set of values that can be assigned to an attribute in a
database. For example, a domain of strings can accept only string values.

Explain Projection in Relational algebra.


→ Relational algebra refers to a procedural query language that takes relation
instances as input and returns relation instances as output. It performs queries
with the help of operators. A binary or unary operator can be used.

What is SQL? Write a syntax for DELETE command.


→ SQL stands for Structured Query Language. It is used for storing and managing data
in relational database management system (RDBMS). It is a standard language for
Relational Database System. It enables a user to create, read, update and delete
relational databases and tables.

Explain COMMIT & ROLL BACK.


The COMMIT statement lets a user save any changes or alterations on the current
transaction. These changes then remain permanent.
The ROLLBACK statement lets a user undo all the alterations and changes that
occurred on the current transaction after the last COMMIT.

What is domain integrity constraints?


→ Domain integrity constraint contains a certain set of rules or conditions to restrict
the kind of attributes or values a column can hold in the database table.
→ The data type of a domain can be string, integer, character, DateTime, currency,
etc.

Write a syntax for UPDATE command.


Syntax : UPDATE table_name SET column1 = value1, column2 = value2....,
columnN = valueN WHERE [condition];

www.ourcreativeinfo.in
Database Management System

What is PL/SQL? Write a basic structure of Pl/SQL.


PL/SQL is a procedural language designed specifically to embrace SQL statements
within its syntax. PL/SQL program units are compiled by the Oracle Database server
and stored inside the database. And at run-time, both PL/SQL and SQL run within
the same server process, bringing optimal efficiency
Syntax :
Declare
<declaration section>
Begin
<executable section>
Exception
<exception handling>
End;

Commit v/s rollback.

What is relationship type? What are their types.


→ A Relationship Type is a type of association that can exist between two different
(or same) entity types.

List various aggregate function with example in SQL.


→ COUNT FUNCTION : COUNT function is used to Count the number of rows in a
database table.
→ SUM FunctionSum function is used to calculate the sum of all selected columns. ...
→ AVG function : The AVG function is used to calculate the average value of the
numeric type.
→ MAX Function
→ MIN Function

What is query? Give example.


→ A query can either be a request for data results from your database or for action
on the data, or for both. A query can give you an answer to a simple question,
perform calculations, combine data from different tables, add, change, or delete
data from a database.
What is the use of commit and rollback commands.
Name the built-in functions of SQL.
String Functions (LEN, SUBSTRING, REPLACE, CONCAT, TRIM) Date and Time
Functions (datetime, datetime2, smalldatetime) Aggregate Functions (COUNT, MAX,
MIN, SUM, AVG).

www.ourcreativeinfo.in
Database Management System

Define domain. Give example.


→ domain defines the permitted range of values for an attribute of an entity.
→ For example, let's consider a database for a university that stores information
about students. One of the tables in the database might be called "Students" and
could have an attribute called "Major" that stores the student's declared major.
→ The domain for the "Major" attribute could be a set of allowable values, such as
"Computer Science," "Biology," "Mathematics," "English," etc. This domain
specifies the range of values that can be stored in the "Major" column for any
given row in the "Students" table.

What are domain constraints ? Give example.


In database management, a domain constraint is a type of data validation rule that defines
the allowable values for a particular attribute or column in a database table. Domain
constraints help to ensure the accuracy and integrity of data stored in a database by
enforcing rules that prevent the entry of invalid or inappropriate data.
Here's an example of a domain constraint for a database table called "Employees" that
stores information about the employees of a company:
Attribute: Gender Domain Constraint: The only allowable values for the "Gender" attribute
are "Male" or "Fem

Define the terms domains ad atomic in relational data model terminology.


List the datatypes in SQL.
→ string, numeric, and date and time. Exact numerics, Unicode character strings.
→ Approximate numerics, Binary strings.
→ Date and time, Other data types.
→ Character strings.
→ Bigint, numeric.
→ Bit, smallint.
→ Decimal, smallmoney.
→ Int, tinyint

Define Cursor.
→ Whenever DML statements are executed, a temporary work area is created in
the system memory and it is called a cursor.
→ Cursors are used by database programmers to process individual rows returned
by database system querie
1.Define functional dependencies.
→ Functional dependency in DBMS refers to a relationship that is present between
attributes of any table that are dependent on each other.

www.ourcreativeinfo.in
Database Management System

Define 1 NF , 2NF , 3NF and BCNF.


In DBMS (Database Management System), 1NF (First Normal Form) is the first level of
normalization that a database must adhere to.
→ A relation will be 1NF if it contains an atomic value. · It states that an attribute of a
table cannot hold multiple values. It must hold only single-valued.

→ A relation is said to be in the 2nd Normal Form in DBMS (or 2NF) when it is in the First
Normal Form but has no non-prime attribute functionally dependent on any candidate
key's proper subset in a relation.
→ A relation will be in 3NF if it is in 2NF and not contain any transitive partial
dependency.3NF is used to reduce the data duplication. It is also used to achieve the
data integrity
→ BCNF(Boyce Codd Normal Form) in DBMS is an advanced version of 3NF (third
normal form). A table or a relation is said to be in BCNF in DBMS if the table or the
relation is already in 3NF

3.Define the term normalization.


→ Normalization is the process of organizing data in a database. This includes creating
tables and establishing relationships between those tables according to rules designed
both to protect the data and to make the database more flexible by eliminating
redundancy and inconsistent dependency

4.What are different cases of NULL values.


→ The value unknown (value exists but is not known)
→ Value not available (exists but is purposely withheld)
→ Attribute not applicable (undefined for this tuple)

5.What is the advantages of normalization.


→ Reduces redundant data. Provides data consistency within the database. More
flexible database design. Higher database security.

List the ACID properties of Transaction.


→ ACID refers to the four key properties of a transaction: atomicity, consistency,
isolation, and durability.

Define transaction. Give example.

www.ourcreativeinfo.in
Database Management System

→ The transaction is a set of logically related operation. It contains a group of tasks.


→ A transaction is an action or series of actions. It is performed by a single user to
perform operations for accessing the contents of the database
→ Examples of Transactions are making a purchase, bill pay, money transfer, stock
trade, address change, and others. With each type of Transaction, different type of
details are involved.

List the types of locks.


→ Shared Lock.
→ Exclusive Lock.

What do you mean by redundancy? Why is must be controlled.


→ controlled redundancy is necessary technique to use redundant fields in a database
→ Redundancy is controlled when the DBMS ensures that multiple copies of the same
data are consistent.

Define database recovery?


→ Recovery is the rebuilding of a database or table space after a problem such as
media or storage failure, power interruption, or application failure.

What is deadlock?
→ In a database, a deadlock is a situation in which two or more transactions are
waiting for one another to give up locks.

What do you mean by controlled redundancy?


→ controlled redundancy is necessary technique to use redundant fields in a database
→ Redundancy is controlled when the DBMS ensures that multiple copies of the same
data are consistent.
Expand A.C.I.D.
→ ACID (atomicity, consistency, isolation, and durability)

Explain the reason for failure of transaction.


→ database failures such as network failure, system crash, natural disasters,
carelessness, sabotage(corrupting the data intentionally), software errors, etc.

www.ourcreativeinfo.in
Database Management System

www.ourcreativeinfo.in

You might also like