Академический Документы
Профессиональный Документы
Культура Документы
Qst.1 Construct an ER diagram for an Event Management System. Clearly indicate the entities,
relationships, cardinality and the key constraints. Also, derive the unnormalized relational database
tables with the help of this diagram.
Ans: Entity Relationship Diagram: Entity- An entity is an object, place, person, concept, or activity about
which an enterprises record data.
Attribute- An attribute is the characteristic property of an existing entity. The difference between attribute type
and attribute instance has to be understood.
Relationship Diagrams
A relationship is defined as "an association among entities". A relationship type is an association of entity,
while a relationship instance is an association of entity instances.
Relationship Diagrams:A relationship is defined as "an association among entities". A relationship type is an association of
entity, while a relationship instance is an association of entity instances.
One-to-One
If in an entity there is a one field, which is not repeated, and another entity it is related and also entered once is
called One-to-One relationship.
One-to-Many (or Many-to-One)
In One-to-Many relationship in one table field is not repeated and in another table which is related to the first
table the field has to be repeated like in the current project in consumer master file consumer number is not
repeated and booking file there is repetitions of consumer number whenever consumer booked the refill.
Many-to-Many
In many to many relationships both table can have repetitive data.
Entity Diagram
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 1
MCS-023
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 2
MCS-023
6.2
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 3
MCS-023
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 4
MCS-023
Tables Are:
Table Name:
Employee
Field Name
Data Type
Size
Key
Emp_Id
Numeric
15
Primary key
Name
Varchar
25
Address
Varchar
35
Ph_No.
Numerric
40
Varchar
40
Designation
Varchar
15
Table Name:
Designation
Field Name
Data Type
Size
Key
Des_Id
Numeric
15
Primary key
Des_Name
Varchar
15
Basic_Form
Numeric
10
Basic_to
Numerric
10
Table Name:
Allowances
Field Name
Data Type
Size
Key
Des_Id
Numeric
15
Foreign Key
Allo_Type
Varchar
10
Percentage
Numerric
Table Name:
Deduction
Field Name
Data Type
Size
Key
Des_Id
Numeric
15
Foreign Key
Allo_Type
Varchar
10
Percentage
Numerric
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 5
MCS-023
Table Name:
Leave Master
Field Name
Data Type
Size
Key
Des_Id
Numeric
15
Foreign Key
Leave_Type
Varchar
10
Max.No.OfDays
Numerric
Table Name:
Attendance
Field Name
Data Type
Size
Key
Emp_Id
Numeric
15
Foreign Key
Status
Varchar
10
Date
Date
10
Table Name:
Company
Field Name
Data Type
Size
Key
Comp_Id
Numeric
15
Primary Key
Comp_Name
Varchar
20
Comp_Address
Varchar
35
Web_Site
Varchar
40
Ph_No.
Numeric
12
Table Name:
Event Master
Field Name
Data Type
Size
Key
Event_Id
Numeric
15
Primary Key
Event_Name
Varchar
20
Content
Varchar
20
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 6
MCS-023
Charges
Numeric
10
Duration
Numeric
Event_Place
Varchar
20
Event_Date
Date
10
No._OfPerson
Numeric
Event_Type
Varchar
20
Table Name:
Leave Transaction
Field Name
Data Type
Size
Key
Emp_Id
Numeric
15
Foreign Key
Leave_Type
Varchar
10
Date_Form
Date
10
Date_To
Date
10
Table Name:
Customer
Field Name
Data Type
Size
Key
Cust_Id
Numeric
15
Primary Key
Cust_Name
Varchar
20
Address
Varchar
35
Ph_No.
Numeric
12
Varchar
40
Table Name:
Registration
Field Name
Data Type
Size
Key
Reg_No.
Numeric
15
Primary Key
Reg_Date
Date
Event_Date
Date
Cust_Id
Numeric
15
Foreign Key
Tocken_Ammount
Numeric
10
Balance
Numeric
10
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 7
MCS-023
Table Name:
Receipt
Field Name
Data Type
Size
Key
Cust_Id
Numeric
15
Foreign Key
Event_Name
Varchar
20
Event_Date
Date
Ammount
Numerric
10
Date
Date
Table Name:
Country
Field Name
Data Type
Size
Key
Count_Id
Numeric
15
Primary key
Count_Name
Varchar
10
Table Name:
State
Field Name
Data Type
Size
Key
State_Id
Numeric
15
Primary key
State_Name
Varchar
10
Count_Id
Numeric
15
Foreign Key
Table Name:
City
Field Name
Data Type
Size
Key
City_Id
Numeric
15
Primary key
City_Name
Varchar
10
State_Id
Numeric
15
Table Name:
Payment
Field Name
Data Type
Size
Key
Cust_Id
Numeric
15
Foreign Key
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 8
MCS-023
Date
Date
Mode
Varchar
10
Ammount
Numerric
10
Table Name:
Event_Result
Field Name
Data Type
Size
Key
Event_Id
Numeric
15
Foreign Key
Event_Name
Varchar
20
Event_Type
Varchar
20
Event_Winner
Varchar
20
Event_Date
Date
10
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 9
MCS-023
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 10
MCS-023
Qst.2 Normalize the tables designed in Q1 till its requirements are satisfied
Ans:
Table Name:
Employee
Field Name
Data Type
Size
Key
Emp_Id
Numeric
15
Primary key
Name
Varchar
25
Address
Varchar
35
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 11
MCS-023
Ph_No.
Numerric
40
Varchar
40
Designation
Varchar
15
Table Name:
Designation
Field Name
Data Type
Size
Key
Des_Id
Numeric
15
Primary key
Des_Name
Varchar
15
Basic_Form
Numeric
10
Basic_to
Numerric
10
Table Name:
Allowances
Field Name
Data Type
Size
Key
Des_Id
Numeric
15
Foreign Key
Allo_Type
Varchar
10
Percentage
Numerric
Table Name:
Deduction
Field Name
Data Type
Size
Key
Des_Id
Numeric
15
Foreign Key
Allo_Type
Varchar
10
Percentage
Numerric
Table Name:
Leave Master
Field Name
Data Type
Size
Key
Des_Id
Numeric
15
Foreign Key
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 12
MCS-023
Leave_Type
Varchar
10
Max.No.OfDays
Numerric
Table Name:
Attendance
Field Name
Data Type
Size
Key
Emp_Id
Numeric
15
Foreign Key
Status
Varchar
10
Date
Date
10
Table Name:
Company
Field Name
Data Type
Size
Key
Comp_Id
Numeric
15
Primary Key
Comp_Name
Varchar
20
Comp_Address
Varchar
35
Web_Site
Varchar
40
Ph_No.
Numeric
12
Table Name:
Event Master
Field Name
Data Type
Size
Key
Event_Id
Numeric
15
Primary Key
Event_Name
Varchar
20
Content
Varchar
20
Charges
Numeric
10
Duration
Numeric
Event_Place
Varchar
20
Event_Date
Date
10
No._OfPerson
Numeric
Event_Type
Varchar
20
Table Name:
Leave Transaction
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 13
MCS-023
Field Name
Data Type
Size
Key
Emp_Id
Numeric
15
Foreign Key
Leave_Type
Varchar
10
Date_Form
Date
10
Date_To
Date
10
Table Name:
Customer
Field Name
Data Type
Size
Key
Cust_Id
Numeric
15
Primary Key
Cust_Name
Varchar
20
Address
Varchar
35
Ph_No.
Numeric
12
Varchar
40
Table Name:
Registration
Field Name
Data Type
Size
Key
Reg_No.
Numeric
15
Primary Key
Reg_Date
Date
Event_Date
Date
Cust_Id
Numeric
15
Foreign Key
Tocken_Ammount
Numeric
10
Balance
Numeric
10
Table Name:
Receipt
Field Name
Data Type
Size
Key
Cust_Id
Numeric
15
Foreign Key
Event_Name
Varchar
20
Event_Date
Date
Ammount
Numerric
10
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 14
MCS-023
Date
Table Name:
Date
Country
Field Name
Data Type
Size
Key
Count_Id
Numeric
15
Primary key
Count_Name
Varchar
10
Table Name:
State
Field Name
Data Type
Size
Key
State_Id
Numeric
15
Primary key
State_Name
Varchar
10
Count_Id
Numeric
15
Foreign Key
Table Name:
City
Field Name
Data Type
Size
Key
City_Id
Numeric
15
Primary key
City_Name
Varchar
10
State_Id
Numeric
15
Table Name:
Payment
Field Name
Data Type
Size
Key
Cust_Id
Numeric
15
Foreign Key
Date
Date
Mode
Varchar
10
Ammount
Numerric
10
Table Name:
Event_Result
Field Name
Data Type
Size
Key
Event_Id
Numeric
15
Foreign Key
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 15
MCS-023
Event_Name
Varchar
20
Event_Type
Varchar
20
Event_Winner
Varchar
20
Event_Date
Date
10
(ii) Find all the employees working with SALES Department and with designation MANAGER
Ans:
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 16
MCS-023
Ans:
(iv) Find total number of employees who work with RESEARCH department.
Ans:
(v) Find all the employees who joined after Jan 1, 2010.
Ans:
(vi) Count number of employees whose salary is between Rs.8000 and Rs.12500.
Ans:
(viii) Find the employees whose designation is SALESMAN and joined after 1st Aug, 1990.
Ans:
SELECT * FROM EMP WHERE DESIGNATION= SALES AND DATE OF JOIN> Aug 1,1990;
(xi) Count all the number of employees who are working with the company.
Ans:
SELECT * FROM EMP WHERE DATE OF JOIN =1ST JAN,1997 TO 31ST Dec,2010;
(xv) Find the employees with similar names and display their designation, department and data of join.
Ans:
SELECT
DESIGNATION,
DEPT_NAME,
DATE_OF_JOIN
FROM
EMP
COMPARE
ENAME=ENAME IF TRUE;
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 17
MCS-023
Qst.4 (a) Discuss the advantages and disadvantages of hierarchical database management system in
comparison with RDBMS. Discuss types of applications suitable for hierarchical DBMS and RDBMS.
Ans:
Relational database management systems (RDBMS) contain data arranged in tables. Each table has a name
closely related to the data that it holds. In each table uniquely named columns define the stored data, while the
rows - sometimes called tuples - store records with specific values.
A query language is used to retrieve and manipulate data. Different types of relational databases exist to serve a
variety of needs.
Tables in a database have certain relationships with each other: one-to-one, one-to-many and many-to-many.
One-to-one relationships exist when a record in one table relates to one and only one record in another table.
One-to-many relationships exist when a record in one table relates to many records in another table. Many-tomany relationships exist when a tables (Table 1) records can relate to many records in another table (Table 2)
and records in Table 2 can relate to many records in Table 1.
Benefits of RDBMS are that the system is simple, flexible, and productive. Because the tables are simple, data
is easier to understand and communicate with others. RDBMS are flexible because users do not have to use
predefined keys to input information. Also, RDBMS are more productive because SQL is easier to learn. This
allows users to spend more time inputting instead of learning. More importantly, RDBMS biggest advantage is
the ease with which users can create and access data and extend it if needed. After the original database is
created, new data categories can be added without the existing application being changed.
Qst.4 (b) Define the two principal integrity rules for the relational model. Discuss why it is desirable to
enforce these rules.
Ans:
A model in database system basically defines the structure or organisation of data and
a set of operations on that data. Relational model is a simple model in which database
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 18
MCS-023
is represented as a collection of Relations, where each relation is represented by a
two dimensional table. Thus, because of its simplicity it is most commonly used. The
following table represents a simple relation:
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 19
MCS-023
Each row in a table represents a record and is called a tuple. A table containing n
attributes in a record is called n-tuple.
Attribute
The name of each column in a table is used to interpret its meaning and is called an
attribute. Each table is called a relation.
For example, Figure 2 represents a relation PERSON. The columns PERSON_ID,
NAME, AGE and ADDRESS are the attributes of PERSON and each row in the table
represents a separate tuple (record).
Relation Name: PERSON
Domain
A domain is a set of permissible values that can be given to an attribute. So every
attribute in a table has a specific domain. Values to these attributes cannot be
assigned outside their domains.
In the example above if domain of PERSON_ID is a set of integer values from 1 to
1000 than a value outside this range will not be valid. Some other common domains
may be age between 1 and 150. The domain can be defined by assigning a type or a
format or a range to an attribute. For example, a domain for a number 501 to 999 can
be specified by having a 3-digit number format having a range of values between 501
and 999. However, please note the domains can also be non-contiguous. For
example, the enrolment number of IGNOU has the last digit as the check digit, thus
the nine- digit enrolment numbers are non-continuous.
Qst.5 (a) Describe the main aims of the conceptual, logical and physical database design phases.
Ans:
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 20
MCS-023
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 21
MCS-023
are defined, as well as how stored fields are represented, what physical sequence the
stored records are in, and what other physical structures exist.
Qst.5 (B) Discuss the concept of data independence and explain its importance in a database
environment.
Ans: Data Independence
In the file-based system, the descriptions of data and logic for accessing the data are
built into each application program making the program more dependent on data. A
change in the structure of data may require alterations to programs. Database
Management systems separates data descriptions from data. Hence it is not affected by
changes. This is called Data Independence, where details of data are not exposed.
DBMS provides an abstract view and hides details. For example, logically we can say
that the interface or window to data provided by DBMS to a user may still be the same
although the internal structure of the data may be changed.
The three levels of abstraction in the database do not exist independently of each
other. There must be some correspondence, or mapping, between the levels. There are
two types of mappings: the conceptual/internal mapping and the external/conceptual
mapping.
The conceptual/internal mapping lies between the conceptual and internal levels, and
defines the correspondence between the records and the fields of the conceptual view
and the files and data structures of the internal view. If the structure of the stored
database is changed, then the conceptual/ internal mapping must also be changed
accordingly so that the view from the conceptual level remains constant. It is this
mapping that provides physical data independence for the database. For example, we
may change the internal view of student relation by breaking the student file into two
files, one containing enrolment, name and address and other containing enrolment,
programme. However, the mapping will make sure that the conceptual view is
restored as original. The storage decision is primarily taken for optimisation
purposes.
The external/conceptual view lies between the external and conceptual levels, and
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 22
MCS-023
defines the correspondence between a particular external view and the conceptual
view. Although these two levels are similar, some elements found in a particular
external view may be different from the conceptual view. For example, several fields
can be combined into a single (virtual) field, which can also have different names
from the original fields. If the structure of the database at the conceptual level is
changed, then the external/conceptual mapping must change accordingly so that the
view from the external level remains constant. It is this mapping that provides logical
data independence for the database. For example, we may change the student relation
to have more fields at conceptual level, yet this will not change the two user views at
all.
It is also possible to have another mapping, where one external view is expressed in
terms of other external views (this could be called an external/external mapping). This
is useful if several external views are closely related to one another, as it allows you to
avoid mapping each of the similar external views directly to the conceptual level.
The need for three level architecture
The objective of the three level architecture is to separate each users view of the
database from the way the database is physically represented.
! Support of multiple user views: Each user is able to access the same data, but
have a different customized view of the data. Each user should be able to
change the way he or she views the data and this change should not affect other
users.
! Insulation between user programs and data that does not concern them:
Users should not directly deal with physical storage details, such as indexing or
hashing. The users interactions with the database should be independent of
storage considerations.
Insulation between conceptual and physical structures
It can be defined as:
1. The Database Administrator should be able to change the storage structures
without affecting users views.
2. The internal structure of the database should be unaffected by the changes to the
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 23
MCS-023
physical aspects of the storage, such as changing to a new storage device.
3. The DBA should be able to chan
For More Solutions Contact To Mr. Bilal Ali : Brain Cafe Computer Classes, Near U.P.
Tech. Chowk Lucknow. Contact Number:+91 9984736691,+91 9450148850
E_Mail_Id- Lucknowcomputerclasses@gmail.com, FB Page- facebook.com/bilalali0786 24