0% found this document useful (0 votes)
25 views

POST MID TERMDATABASE MANAGEMENT SYSTEM-Notes

Uploaded by

anushka4ks
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

POST MID TERMDATABASE MANAGEMENT SYSTEM-Notes

Uploaded by

anushka4ks
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

UNIT-3

DATABASE MANAGEMENT SYSTEM

QUESTION- ANSWER
Q1. What is a Database?
Ans. A database is an organized collection of data. You can visualize it as a container
of information. The data is typically organized to model relevant aspects of reality (for
example, the availability of rooms in hotels), in a way that supports processes requiring
this information (for example, finding a hotel with facilities such as Laundry, GYM etc…).

While in the manual system, you would maintain several files with different bits of
information; in the computerized system you would use database programs such as
Microsoft Access, LibreOffice.org Base, and MySQL, to organize the data as per your
business need.
Q2. Define Database Management System.
A database management system is a software package with computer programs that
controls the creation, maintenance, and use of a database. It allows organizations to
conveniently develop databases for various applications. A database is an integrated
collection of data records, files, and other objects. A DBMS allows different user
application programs to concurrently access the same database.
Eg: Oracle, IBM DB2, Microsoft SQL Server, Microsoft Access, PostgreSQL, MySQL,
FoxPro, and SQLite.
Q3. What are two types of database structures?
Ans. Data can be organized into two types:
• Flat File: Data is stored in a single table. Usually suitable for less amount of data. •
Relational: Data is stored in multiple tables and the tables are linked using a common
field. Relational is suitable for medium to large amount of data.
Q4. What are Database servers?
Ans.
Database servers are dedicated computers that hold the actual databases and run only
the DBMS and related software. Typically databases available on the database servers
are accessed through command line or graphic user interface tools referred to as
Frontends; database servers are referred to as Back-ends. Such type of data access is
referred to as a client-server model.
Q5. List the advantages of Database
Ans.
Advantages of Database
1. Reduces Data Redundancy -The database management systems contain multiple
files that are to be stored in many different locations in a system or even across multiple
systems. Because of this, there were sometimes multiple copies of the same file which
lead to data redundancy.
This is prevented in a database as there is a single database and any change in it
is reflected immediately. Because of this, there is no chance of encountering
duplicate data.
2. Sharing of Data In a database- The users of the database can share the data
among themselves. There are various levels of authorisation to access the data, and
consequently the data can only be shared based with the authorized users.
Many remote users can also access the database simultaneously and share the data
between themselves.
3. Data Integrity - Data integrity means that the data is accurate and consistent in the
database. Data Integrity is very important as there are multiple databases in a DBMS.
All of these databases contain data that is visible to multiple users. So it is necessary to
ensure that the data is correct and consistent in all the databases and for all the users.
4. Data Security - Data Security is an important concept in a database. Only
authorised users should be allowed to access the database and their identity should be
authenticated using a username and password. Unauthorised users should not be
allowed to access the database under any circumstances as it violates the integrity
constraints.
5. Privacy - The privacy rule in a database states that only the authorized users can
access a database according to its privacy constraints. To secure data levels are set in
the database and a user can only view the data which is allowed to be seen. For
example - In social networking sites, access constraints are different for different
accounts a user may want to access.
6. Backup and Recovery - Database Management System automatically takes care of
backup and recovery. The users don't need to backup data periodically because this is
taken care of by the DBMS. Moreover, it also restores the database after a crash or
system failure to its previous condition.
7. Data Consistency - Data consistency is ensured in a database because there is no
data redundancy. Data Consistency means there should be multiple mismatching
copies of the same data. All data appears consistently across the database and must be
same for all the users viewing the database. Moreover, any changes made to the
database are immediately reflected to all the users and there is no data inconsistency.
Q6. Describe the features of a Database.
Ans.
A record is a set of information (made up of fields) stored in your database about one
of the items.
A “value” is the actual text or numerical amount or date that you put in while adding
information to your database.
Field – A field is a set of data values, of the same data type, in a table. It is also referred
to as a column or an attribute.
Table - When you put all the information together in a grid, a collection of similar
records creates a table.
Key features of a database:
1. A database can have one or many tables. An address book example is a very simple
one, in real world there are many more details involved. A big company would have in
its database, one table for its products, one table for its suppliers, one table for its
customer details, one for orders received and maybe many others.
2. Each table in a database contains information about one type of item. So, a database
is a container that holds tables and other objects and manages how they can be used.
3. Another very important thing to remember is that when we put in information, we may
have people with the same name (there can be more than one Charu Arora) or the
same address (members of a family). But when creating a database an important
feature is record uniqueness in every table. it is important to be able to distinguish
between different items having duplicate values.
Uniqueness helps to avoid accidental duplication of records caused by user or computer
error. This can be achieved by using some number or value that uniquely identifies a
record. If such a unique value does not exist in your fields, as the database designer,
you can create a special additional field in a table where unique numbers or values can
be assigned for each new entry. Therefore, every table has a key field which ensures
that there are 100% unique values throughout the database.
4. Every database table should have one or more fields designated as key. You can
assign a unique value to this key for differentiating records that may have similar names
or addresses.
Q7. What is Relational Database?
Ans.
A relational database is a type of database. It uses a structure that allows us to identify
and access data in relation to another piece of data in the database. Often, data in a
relational database is organized into tables.

Q8. Define RDBMS

When data is to be stored, maintained, and retrieved from multiple tables then special
database software are required known as Relational Database Management System.
A relational database is a collective set of multiple data sets organized by tables,
records and columns. Relational database establish a well-defined relationship between
database tables. Tables communicate and share information, which facilitates data
search ability, organization and reporting. In the RDBMS data can be integrated using
keys. These are Primary Key, Composite Primary Key, and Foreign Key.
A Relational database use Structured Query Language (SQL), which is a standard user
application that provides an easy programming interface for database interaction
Q9. State the relationship and difference between a primary, Composite Primary
Key and foreign key?
Ans.
Primary Key - A primary key is a unique value that identifies a row in a table.. Primary
Keys are also indexed in the database, making it faster for the database to search for a
record. Primary Key can’ accept null values as well as duplicate values..
Composite Primary Key - When primary key constraint is applied on one or more
columns then it is known as Composite Primary Key.
Foreign Key - The foreign key identifies a column or set of columns in one
(referencing) table that refers to a column or set of columns in another (referenced)
table. The “one” side of a relation is always the parent, and provides the PK attributes to
be copied. The “many” side of a relation is always the child, into which the FK attributes
are copied. Memorize it: one, parent, PK; many, child, FK.

Q10. Differentiate between Table, Record and Field


(Define the structure of a table / Differentiate between Tuples and Attributes of a
table)
Ans.
Tables: A table is a set of data elements (values) that is organized using a model of
vertical columns (which are identified by their name) and horizontal rows. A table has a
defined number of columns, but can have any number of rows. Each row is identified by
the values appearing in a particular column identified as a unique key index or the key
field.
Columns or Fields or Attributes: A column is a set of data values of a particular
simple type, one for each row of the table. The columns provide the structure according
to which the rows are composed. For example, FirstName, or LastName are fields in a
row.
Rows or Records or Tuples: A row also called a Record or Tuple represents a single,
data item in a table. In simple terms, a database table can be visualized as consisting of
rows and columns or fields. Each row in a table represents a set of related data, and
every row in the table has the same structure.
Q11. What is meant by data types in LibreOffice Base?
(Why are data types used in DBMS /RDBMS? )
Ans.
Data Types: Datatypes are used to identify which type of data (value) we are going to
store in the database. Fields themselves can be of different types depending on the
data they contain. Data types in LibreOffice base are broadly classified into five
categories listed below.
• Numeric Types
• Alphanumeric Types
• Binary Types
• Date time
• Other Variable types
Q12. Explain Numeric Data Types (List datatypes available in Numeric Datatype)
Numeric Types: Numeric data types are used for describing numeric values for the
field used in the table of a database. Numeric data types in a database can be used for
storing information such as mobile number, roll number, door number, year of school
admission, true or false statements, statistical values, etc.
The different types of numeric data types available are

Name Data type Description

BOOLEAN yes / no Values as 0 or 1. Example: True or False, Yes or No.

TINYINT tiny integer Store integer range between 0 to 255

SMALLINT small integer Store integer range between -215 to +215-1

INTEGER Integer Store integer range between -231 to +231-1

BIGINT big integer Range between -263 to +263-1

NUMERIC Number Maximum precision of e(+/-)231

DECIMAL Decimal Maximum precision of e(+/-)231

REAL Real 2-1074 to (2-2-52)* 21023

FLOAT Float 2-1074 to (2-2-52)* 21023

DOUBLE Double 2-1074 to (2-2-52)* 21023


Q13. What are the different types of Alphanumeric data type?

( List datatypes available in Alphanumeric Datatype)


Ans.

Name Data type Description

LONGVARCHAR Memo Stores up to the max length or number indicated


by user. It accepts any UTF 8 Character.
CHAR text (fix) Stores exactly the length specified by user. Pads with
trailing spaces for shorter strings. Accepts any UTF 8
Character.
VARCHAR_IGNORE Text Stores up the specified length. Comparisons are not
CASE case sensitive but stores capitals as you type them.

Q14. Explain Binary Data Type.


(Name different Binary data types.)
Binary Types: Binary data types are used for storing data in binary formats. Binary data
types in a database can be using for storing photos, music files, etc. In general, files of

Name Data type Description

LONGVARBINARY Image Stores any array of bytes (images, sounds, etc.). No


validation required.
BINARY binary (fix) Stores any array of bytes. No validation required.
VARBINARY Binary Stores any array of bytes. No validation required.
any format can be stored using the binary data type. The different types of binary data
types available are listed here.

Q15. Write about Other datatypes?

Name Description
Other/Object Stores serialized Java objects –user application must supply
serialization routines
16 Explain the Date and Time Data Type.

DATE TIME: Date time data types are used for describing date and time values for the
field used in the table of a database. Date time data types in a database can be used for
storing information such as date of birth, date of admission, date of product sale, etc.
The different types of date time data types available are listed here.

Name Description Format

Date Stores month, day and year information 1/1/99 to 1/1/9999

Time Stores hour, minute and second info Seconds since 1/1/1970

Timestamp Stores date and time information

Q17. In how many ways tables can be created in Base?


Ans.
There are different ways to create a table:
1. Create table in Design View
2. Use Wizard to Create Table - A table can be created using the
predefined steps and table structure(s) in Base.

Q18. How to Insert/ Edit / Delete Data In The Table

To insert the data in the table, follow the steps:

Select the table > Double click on it.

The table will open in Datasheet View in which new data can be inserted and existing
data can be updated or removed.

Editing Records In The Table

To edit the data either click on edit icon or double on the data in the cell of a table and
modifications can be done.

Deleting Records From The Table


To remove the data from the table, follow the steps: Select the data > right click on
selected data > select the Delete option

Q19. What are the different field properties you can set in Base. How can we change the
Field Properties ?

Ans.

1. The properties of numeric type data are

AutoValue – if set to yes then field will get the auto numeric values.

Length – By default length of the field is 10 but the size of the field can be set to
maximum length.

Default Value – A default value can be set for a field if user don’t provide any value
while entering the values in the table.

Format example – This property helps to set the format of the data entered in the field
such as 91-222-333.

2. The properties of character type data are

Entry Required – if set to yes then it will be must to insert the value in the field which
means that field cannot be left blank.

Length – By default length of the field is 10 but the size of the field can be set to
maximum length.

Default Value – A default value can be set for a field if user don’t provide any value
while entering the values in the table.

Format example – This property helps to set the format of the data entered in the field
such as 91-222-333.

To change the field properties

Select the table > Right click > Select the option Edit > the table Design View window will
open

Q21.What do you mean by Sorting? In how many ways it can be done?

Ans.

Sorting means to arrange the data in either ascending order of descending order. Select
the column(s) then click on sort buttons. The data will be displayed accordingly.
Q22. .Explain Referential Integrity with the help of an example. What are the
benefits of Referential Integrity?

Ans.

Referential integrity is used to maintain accuracy and consistency of data in a


relationship. In Base, data can be linked between two or more tables with the help of
primary key and foreign key constraints.

Referential integrity helps to avoid:

Adding records to a related table if there is no associated record available in the primary
key table.

Changing values in a primary if any dependent records are present in associated table(s).

Deleting records from a primary key table if there are any matching related records
available in associated table(s).

Q 23. What is meant by Creating Relationships between Tables? What are the
advantages?

A relationship refers to an association or connection between two or more tables. When


you relate two tables, you don't need to enter the same data in separate tables.

Relationships between tables helps to:

Save time as there is no need to enter the same data in separate tables.

Reduce data-entry errors.

Summarize data from related tables.

You can create a relationship between any two tables by selecting Relationships… option
from the Tools menu.

Q24.Write about the different types of Relationship that can be created in tables.
How do you create Relationship in Tables?

Ans.

There are three types of relationships which can be created in tables:

1. ONE to ONE

2. ONE to MANY OR MANY to ONE

3. MANY to MANY
There are two ways to create the relationships between the tables:

a. Click on Insert option and select New Relation… option in Relation Design window.
Select the options as required:
b. Drag the primary key column from one table and drop it on the key column of another
table.

Remove the Relationships - The relationships applied on the tables can be removed
also with the help of Delete option. Right Click on the relationship thread and select
Delete option.

Q25. Describe the different relationship in Tables.

Ans

1. One to One Relationship

In this relationship, both the tables must have primary key columns. Example: In the
tables EMP and DEPT, EMP_ID in EMP table and DEPT_ID in DEPT table are the
primary keys.

2. One to Many Relationship

In this relationship, one of the table must have primary key column. It signifies that one
column of primary key table is associated with all the columns of associated table.
Example: In the tables EMP and DEPT, EMP_ID in EMP table is the primary key

3. Many to Many Relationship

In this relationship, no table has the primary key column. It signifies that all the
columns of primary key table are associated with all the columns of associated table.
Example: In the tables EMP and DEPT, there is no primary key.

You might also like