7
LOVELY PROFESSIONAL UNIVERSITY HOME WORK: #1 School: lstca Department:CSE/IT Course No: CSE301 Course Title: Database Management System Class: E1804 Part-A Q1. Conceptually and diagrammatically describe the logical steps while executing users request to access the database system. Ans:- database-related requests (access), the server first checks the user's global privileges by looking in the user table row. If the row permits the requested operation, access is granted. If the global privileges in the user table are insufficient, the server determines the user's database-specific privileges by checking the dband host tables: 1. The server looks in the db table for a match on the Host, Db, and User columns. The Host and User columns are matched to the connecting user's host name and MySQL user name. The Db column is matched to the database that the user wants to access. If there is no row for the Host and User, access is denied. 2. If there is a matching db table row and its Host column is not blank, that row defines the user's database-specific privileges. 3. If the materb diagram bata the user's database-specific privileges are computed as the intersection (not the union!) of the privileges in the db and host table entries; that is, the privileges that are 'Y' in both entries. (This way you can grant general privileges in the dbtable row and then selectively restrict them on a host-by-host basis using the host table entries.) After determining the database-specific privileges granted by the db and host table entries, the server adds them to the global privileges granted by the user table. If the result permits the requested operation, access is granted. Otherwise, the server successively checks the user's table and column privileges in the

arun

Embed Size (px)

Citation preview

Page 1: arun

LOVELY PROFESSIONAL UNIVERSITY

HOME WORK: #1

School: lstca Department:CSE/ITCourse No: CSE301Course Title: Database Management SystemClass: E1804 Part-AQ1. Conceptually and diagrammatically describe the logical steps while executing users request to access the database system.Ans:- database-related requests (access), the server first checks the user's global privileges by looking in the user table row. If the row permits the requested operation, access is granted. If the global privileges in the user table are insufficient, the server determines the user's database-specific privileges by checking the dband host tables:1. The server looks in the db table for a match on the Host, Db, and User columns. The Host and User columns are matched to the connecting user's host name and MySQL user name. The Db column is matched to the database that the user wants to access. If there is no row for the Host and User, access is denied.2. If there is a matching db table row and its Host column is not blank, that row defines the user's database-specific privileges.3. If the materb diagram bata the user's database-specific privileges are computed as the intersection (not the union!) of the privileges in the db and host table entries; that is, the privileges that are 'Y' in both entries. (This way you can grant general privileges in the dbtable row and then selectively restrict them on a host-by-host basis using the host table entries.)After determining the database-specific privileges granted by the db and host table entries, the server adds them to the global privileges granted by the user table. If the result permits the requested operation, access is granted. Otherwise, the server successively checks the user's table and column privileges in the tables_priv andcolumns_priv tables, adds those to the user's privileges, and permits or denies access based on the result. For stor

Q2. Construct a E-R diagram for a hospital management system with a set of doctors and a set of patients. With each patient,a series of various tests and examinations are conducted. On the basis of preliminary report patients are admitted to a particular specialty ward.

Page 2: arun

Q3. “There are a number of database models available in Database Management System”.Why there is need of these models. Explain your answer by comparing all the models.

Ans:-

Hierarchical ModelThe hierarchical data model organizes data in a tree. There is a hierarchy of data segments parent and child. This structure implies that a record can have repeating information, generally within data segments of the child. Data from a series of records, which have a set of field values associated with it. It brings together all cases of a specific record as a record type. These types of records are the equivalent tables in the relational model, and with individual records being the equivalent of lines. To create links between record types, the hierarchical model uses parent-child relationships. They are 1: N mapping between record types. This is done using the trees as set theory used in the relational model, "borrowed" math. For example, an organization can store information about an employee such as name, employee number, department, salary. The

Doctor

ECG

Patients

Tests

Bad no. NameWard No.specelistDoc. Name

Na

Hostipal

MRIEyesBloodHIV

Page 3: arun

organization can also store information on children of an employee such as name and date of birth. The employee and the data of children is a hierarchy, where employee data is the segment of parent and child is the data segment of the child. If an employee has three children, then there would be three segments child associated with a segment of employees. In a hierarchical database of parent-child relationship is one to many.

Network ModelThe popularity of the network data model coincided with the popularity of the hierarchical data model. Some data were more naturally modeled with more than one parent per child. So, the network model permitted the modeling of many-to-many relationships in data. Modeling data in constructing the network model is all built. A set consists of a record type owner, name game, and a type of member record. A member record type can have this role in more than a game, where the concept is supported multiparent. An owner record type can also be a member or owner in another set. The data model is a simple network, and record types of link and intersection (junction of files called by IDMS) may exist, and sets them.

Relational Model

(RDBMS - relational database management system) A database based on the relational model developed by E.F. Codd. A relational database allows the definition of data structures, storage and retrieval operations and integrity constraints. In such a database the data and relations between them are organised in tables. A table is a collection of records and each record in a table contains the same fields.

Part-BQ4. If we want to change the schema of at one level of database system without having change the schema of next higher level , is it possible , if yes representing using abstraction levels.

Ans:- Data independence is define as tha capicity to change the schema at one level of a

database system without having to change the schema at the nest higher level

Ther are two type of data independenc:- 1-Logical Data dependence- The capacity to change the conceptual schema without having to change external schema or application program.the external schema that refer only to the remaining data should not be attected.only the view definitions and the mapping need to be changed in a dbms that support logical data independence.2-Physical Data Independence-The capacity to change the internal schema

Q5 explain the architecture of database.

Page 4: arun

Ans:- Database Management Systems (DBMSs) are complex, mission-critical software systems. Today’s DBMSs embody decades of academic and industrial research and intense corporate software development. Database systems were among the earliest widely deployed online server systems and, as such, have pioneered design solutions spanning not only data management, but also applications, operating systems, and networked services. The early DBMSs are among the most influential software systems in computer science, and the ideas and implementation issues pioneered for DBMSs are widely copied and reinvented.

The three level of the ArchitecturePhysical data architecture

Physical data architecture of an information system is part of a plan for technology. As its name suggests, the technology plan focuses on real tangible evidence to be used in the implementation of the design of data architecture. Physical data architecture includes the architecture of the database. architecture database is a diagram of the basic technology of real data that will support the data architecture designed.

The elements of the data architecture There are certain elements that must be defined as the schema of the data architecture of an organization is designed. For example, the administrative structure that will be put in place to manage data resources must be described. In addition, methods to be used to store the data must be defined. In addition, a description of the technology database to be used must be generated, and the description of the process that will manipulate the data. It is also important to design interfaces for data from other systems, and a design infrastructure that will support joint operations data (ie emergency procedures, data imports, backups data, external data transfers). Without the guidance of an architecture design data properly implemented, the common data operations could be implemented in different ways, making it difficult to understand and control the flow of data in these systems. This type of fragmentation is highly undesirable because of potential increased cost, and disconnects the data in question. These sorts of difficulties may be encountered with rapid-growth companies and also companies that service different lines of business (eg insurance products).

Constraints and influences Various constraints and influences will affect the architecture of design data. These include business requirements, drivers of technology, economics, business policies and needs of data processing.

Page 5: arun

Q6. A university has many academic unit named schools. Each school is administered by a Head of School. The school has administrative and teaching staff. A school offers many courses. A course consists of many subjects A subject is taught to students who have registered for a subject in a class room by a teacher. Draw the necessary E-R diagram for the university specifying aggregation, generalization or specialization hierarchy.