Ch 1 Exercises

Ace your homework & exams now with Quizwiz!

1.14 Explain the difference between two-tier and three-tier architectures. Which is better suited for Web applications? Why?

In a two-tier application architecture, the application runs on the client machine, and directly communicates with the database system running on server. In contrast, in a three-tier architecture, application code run- ning on the client's machine communicates with an application server at the server, and never directly communicates with the database. The three-tier archicture is better suited for Web applications.

Advantages of a semistructured model

It can represent the information of some data sources that cannot be constrained by schema. It provides a flexible format for data exchange between different types of databases. It can be helpful to view structured data as semi-structured (for browsing purposes). The schema can easily be changed. The data transfer format may be portable.

1.9 Explain the concept of physical data independence, and its importance in database systems.

Physical data independence is the ability to modify the physical scheme without making it necessary to rewrite application programs. Such modifications include changing from unblocked to blocked record storage, or from sequential to random access files. Such a modification might be adding a field to a record; an application program's view hides this change from the program.

1.13 What are five main functions of a database administrator?

To create the scheme definition ·To define the storage structure and access methods ·To modify the scheme and/or physical organization when necessary ·To grant authorization for data access ·To specify integrity constraints

Disadvantages of object-based model

Unfamiliarity and shortage of experienced programmers, limited consensus on the standards to use, low efficiency when dealing with simple data, and limited availability of proper tools and support.

Advantages of object-based model

simplicity: software objects model real world objects, so the complexity is reduced and the program structure is very clear; modularity: each object forms a separate entity whose internal workings are decoupled from other parts of the system; modifiability: it is easy to make minor changes in the data representation or the procedures in an OO program. Changes inside a class do not affect any other part of a program, since the only public interface that the external world has to a class is through the use of methods; extensibility: adding new features or responding to changing operating environments can be solved by introducing a few new objects and modifying some existing ones; maintainability: objects can be maintained separately, making locating and fixing problems easier; re-usability: objects can be reused in different programs.

Advantages of a relational model

*Easy to use *Flexibility: Different tables from which information has to be linked and extracted can be easily manipulated by operators such as project and join to give information in the form in which it is desired. *Security: Security control and authorization can also be implemented more easily by moving sensitive attributes in a given table into a separate relation with its own authorization controls. *Data Manipulation Language: The possibility of responding to query by means of a language based on relational algebra and relational calculus e.g SQL is easy in the relational database approach. For data organized in other structure the query language either becomes complex or extremely limited in its capabilities.

Disadvantages of relational model

*Performance: If the number of tables between which relationships to be established are large and the tables themselves effect the performance in responding to the sql queries. *Physical Storage Consumption:With an interactive system, for example an operation like join would depend upon the physical storage also. *Slow extraction of meaning from data: if the data is naturally organized in a hierarchical manner and stored as such, the hierarchical approach may give quick meaning for that data.

1.8 List four significant differences between a file-processing system and a DBMS.

1) A database coordinates the physical and logical access to the data; a file-processing system only coordinates physical access to the data 2) A DBMS reduces the amount of data duplication 3) A DBMS is designed to allow flexibility in what queries give access to the data, where a file-processing system only allows pre-determined access to data (by specific compiled programs) 4) A DBMS is designed to coordinate and permit multiple users to access data at the same time. A file processing system is much more restrictive in simultaneous data access

1.15 Describe at least 3 tables that might be used to store information in a social-networking system such as Facebook.

1) A users table containing users, with attributes such as account name, real name, age, gender, location, and other profile information. 2) A friends table recording for each user which other users are con- nected to that user. The kind of connection may also be recorded in this table. 3) A permissions table, recording which category of friends are allowed to view which content uploaded by a user. For example, a user may share some photos with family but not with all friends.

1.3 List six major steps that you would take in setting up a database for a particular enterprise.

1) Define the high level requirements of the enterprise (this step generates a document know as the requirements specification) 2) Define a model containing all appropriate types of data and data relationships 3) Define the integrity constraints on the data 4) Define the physical level 5) For each known problem to be solved on a regular basis (e.g., tasks to be carried out by clerks or Web users) define a user interface to carry out the task, and write the necessary application programs to implement the user interface. 6) Create/Initialize the database

1.2 List five ways in which the type declaration system of a language such as Java or C++ differs from the data definition language used in a database.

1) Executing an action in the DDL creates an object in the database; in contrast, a java or C++ declaration is simply an abstraction used in the program. 2) They do not allow consistency constraints to be specified 3) DDL supports access rights to different users; Java and C++ do not 4) Java and C++ have more complex types, such as arrays and objects 5) A database DDL is focussed on specifying types of attributes of rela- tions; in contrast, a programming language allows objects, and col- lections of objects to be created.

1.7 List four applications you have used that most likely employed a database system to store persistent data.

1) WA state health finder: options based on income, family size 2) Booking Airfare: ticket reservations, schedule 3) Banking online: transactions, bill pay, transfers 4) University: submitting assignments, course schedule, registering for class

1.11 List at least two reasons why database systems support data manipulation using a declarative query language such as SQL, instead of just providing a a library of C or C++ functions to carry out data manipulation.

1) easier for programmers to learn, and non-programmers 2)The programmer does not have to worry about how to write queries to ensure that they will execute efficiently; the choice of an efficient execution technique is left to the database system. The declarative specification makes it easier for the database system to make a proper choice of execution technique.

Disadvantages of semistructured

Queries cannot be made as efficient as in a more constrained structure, such as in the relational model. Typically the records in a semi-structured database are stored with unique IDs that are referenced with pointers to their location on disk. This makes navigational or path-based queries quite efficient, but for doing searches over many records (as is typical in SQL), it is not as efficient because it has to seek around the disk following pointers.

1.6 Keyword queries used in Web search are quite different from database queries. List key differences between the two, in terms of the way the queries are specified, and in terms of what is the result of a query.

Queries used in the Web are specified by providing a list of keywords with no specific syntax. The result is typically an ordered list of URLs, along with snippets of information about the content of the URLs. In contrast, database queries have a specific syntax allowing complex queries to be specified. And in the relational world the result of a query is always a table.

1.10 List five responsibilities of a database-management system. For each re- sponsibility, explain the problems that would arise if the responsibility were not discharged.

a. interaction with the file manager. No DBMS can do without this. If there is no file manager interaction then nothing stored in the files can be retrieved. b. integrity enforcement. Consistency constraints may not be satisfied, for example an instructor may belong to a non-existent department, two students may have the same ID, account balances could go below the minimum allowed, and so on. c. security enforcement. Unauthorized users may access the database, or users authorized to access part of the database may be able to access parts of the database for which they lack authority. For example, a low-level user could get access to national defense secret codes, or employees could find out what their supervisors earn (which is presumably a secret). d. backup and recovery. Data could be lost permanently, rather than at least being available in a consistent state that existed prior to a failure. e. concurrency control. Consistency constraints may be violated despite proper integrity enforcement in each transaction. For example, incorrect bank balances might be reflected due to simultaneous withdrawals and deposits on the same account, and so on.

1.1 What are some disadvantages of database systems?

complexity, size, performance (needs to cater to more than one application), cost, hardware cost, training staff to use


Related study sets

global environment of business test 1

View Set

Chapter 11 Nutrients Reading Guide

View Set

Peds Exam 4: Chapters 26, 29, & 30

View Set