POST MID TERMDATABASE MANAGEMENT SYSTEM-Notes
POST MID TERMDATABASE MANAGEMENT SYSTEM-Notes
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.
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.
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.
Time Stores hour, minute and second info Seconds since 1/1/1970
The table will open in Datasheet View in which new data can be inserted and existing
data can be updated or removed.
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.
Q19. What are the different field properties you can set in Base. How can we change the
Field Properties ?
Ans.
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.
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.
Select the table > Right click > Select the option Edit > the table Design View window will
open
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.
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?
Save time as there is no need to enter the same data in separate 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.
1. ONE 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.
Ans
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.
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
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.