Database Systems. The Complete Book 2nd ed. Hector Garcia-Molina
Database Systems. The Complete Book 2nd ed. Hector Garcia-Molina
Database Systems. The Complete Book 2nd ed. Hector Garcia-Molina
Database Systems. The Complete Book 2nd ed. Hector Garcia-Molina
Database Systems. The Complete Book 2nd ed. Hector Garcia-Molina
1.
Database Systems. TheComplete Book 2nd ed.
Hector Garcia-Molina pdf download
https://ebookmass.com/product/database-systems-the-complete-
book-2nd-ed-hector-garcia-molina/
Explore and download more ebooks at ebookmass.com
2.
Here are somerecommended products for you. Click the link to
download, or explore more at ebookmass.com
Complete German Grammar 2nd Edition Ed Swick
https://ebookmass.com/product/complete-german-grammar-2nd-edition-ed-
swick/
Database Management Systems Ramakrishnan 3rd Edition Raghu
Ramakrishnan
https://ebookmass.com/product/database-management-systems-
ramakrishnan-3rd-edition-raghu-ramakrishnan/
The New Statistics with R: An Introduction for Biologists
2nd Edition Andy Hector
https://ebookmass.com/product/the-new-statistics-with-r-an-
introduction-for-biologists-2nd-edition-andy-hector/
IIT Foundation Series Physics Class 7, The. 2nd ed.
Edition Systems
https://ebookmass.com/product/iit-foundation-series-physics-
class-7-the-2nd-ed-edition-systems/
3.
Database Systems Design,Implementation, and Management
12th Edition (eTextbook) PDF
https://ebookmass.com/product/database-systems-design-implementation-
and-management-12th-edition-etextbook-pdf/
Database Systems: Design, Implementation, and Management
13th Edition Carlos Coronel
https://ebookmass.com/product/database-systems-design-implementation-
and-management-13th-edition-carlos-coronel/
Complete English All-in-One for ESL Learners 2nd Edition
Ed
https://ebookmass.com/product/complete-english-all-in-one-for-esl-
learners-2nd-edition-ed/
Data Modeling and Database Design 2nd Edition, (Ebook PDF)
https://ebookmass.com/product/data-modeling-and-database-design-2nd-
edition-ebook-pdf/
Complete German All-in-One (Practice Makes Perfect), 2nd
Premium Edition Ed Swick
https://ebookmass.com/product/complete-german-all-in-one-practice-
makes-perfect-2nd-premium-edition-ed-swick/
1. The Worldsof Database Systems
1
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
2. The Relational Model of Data
13
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
3. Design Theory for Relational Databases
63
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
4. High-Level Database Models
121
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
5. Algebraic and Logical Query Languages
199
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
6. The Database Language SQL
237
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
7. Constraints and Triggers
303
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
8. Views and Indexes
333
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
9. SQL in a Server Environment
361
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
10. Advanced Topics in Relational Databases
417
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
11. The Semistructured-Data Model
473
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
12. Programming Languages for XML
507
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
13. Secondary Storage Management
545
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
Contents
8.
14. Index Structures
607
HectorGarcia-Molina/Jeffrey Ullman/Jennifer Widom
15. Query Execution
689
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
16. The Query Compiler
747
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
17. Coping With System Failures
831
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
18. Concurrency Control
871
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
19. More About Transaction Management
941
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
20. Parallel and Distributed Databases
973
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
21. Information Integration
1023
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
22. Database Systems and the Internet
1079
Hector Garcia-Molina/Jeffrey Ullman/Jennifer Widom
1121
Index
9.
The Worlds ofDatabase
Systems
Databases today are essential to every business. Whenever you visit a major
Web site — Google, Yahoo!, Amazon.com, or thousands of smaller sites that
provide information — there is a database behind the scenes serving up the
information you request. Corporations maintain all their important records in
databases. Databases are likewise found at the core of many scientific investi-
gations. They represent the data gathered by astronomers, by investigators of
the human genome, and by biochemists exploring properties of proteins, among
many other scientific activities.
The power of databases comes from a body of knowledge and technology
that has developed over several decades and is embodied in specialized soft-
ware called a database management system, or DBMS, or more colloquially a
“database system.” A DBMS is a powerful tool for creating and managing large
amounts of data efficiently and allowing it to persist over long periods of time,
safely. These systems are among the most complex types of software available.
1 The Evolution of Database Systems
What is a database? In essence a database is nothing more than a collection of
information that exists over a long period of time, often many years. In common
parlance, the term database refers to a collection of data that is managed by a
DBMS. The DBMS is expected to:
1. Allow users to create new databases and specify their schemas (logical
structure of the data), using a specialized data-definition language.
10.
THE WORLDS OFDATABASE SYSTEMS
2. Give users the ability to query the data (a “query” is database lingo for
a question about the data) and modify the data, using an appropriate
language, often called a query language or data-manipulation language.
3. Support the storage of very large amounts of data — many terabytes or
more — over a long period of time, allowing efficient access to the data
for queries and database modifications.
4. Enable durability, the recovery of the database in the face of failures,
errors of many kinds, or intentional misuse.
5. Control access to data from many users at once, without allowing unex-
pected interactions among users (called isolation) and without actions on
the data to be performed partially but not completely (called atomicity).
1.1 Early Database Management Systems
The first commercial database management systems appeared in the late 1960’s.
These systems evolved from file systems, which provide some of item (3) above;
file systems store data over a long period of time, and they allow the storage of
large amounts of data. However, file systems do not generally guarantee that
data cannot be lost if it is not backed up, and they don’t support efficient access
to data items whose location in a particular file is not known.
Further, file systems do not directly support item (2), a query language for
the data in files. Their support for (1) — a schema for the data — is limited to
the creation of directory structures for files. Item (4) is not always supported
by file systems; you can lose data that has not been backed up. Finally, file
systems do not satisfy (5). While they allow concurrent access to files by several
users or processes, a file system generally will not prevent situations such as
two users modifying the same file at about the same time, so the changes made
by one user fail to appear in the file.
The first important applications of DBMS’s were ones where data was com-
posed of many small items, and many queries or modifications were made.
Examples of these applications are:
1. Banking systems: maintaining accounts and making sure that system
failures do not cause money to disappear.
2. Airline reservation systems: these, like banking systems, require assurance
that data will not be lost, and they must accept very large volumes of
small actions by customers.
3. Corporate record keeping: employment and tax records, inventories, sales
records, and a great variety of other types of information, much of it
critical.
The early DBMS’s required the programmer to visualize data much as it
was stored. These database systems used several different data models for
2
11.
THE WORLDS OFDATABASE SYSTEMS
describing the structure of the information in a database, chief among them
the “hierarchical” or tree-based model and the graph-based “network” model.
The latter was standardized in the late 1960’s through a report of CODASYL
(Committee on Data Systems and Languages).1
A problem with these early models and systems was that they did not sup-
port high-level query languages. For example, the CODASYL query language
had statements that allowed the user to jump from data element to data ele-
ment, through a graph of pointers among these elements. There was consider-
able effort needed to write such programs, even for very simple queries.
1.2 Relational Database Systems
Following a famous paper written by Ted Codd in 1970,2
database systems
changed significantly. Codd proposed that database systems should present
the user with a view of data organized as tables called relations. Behind the
scenes, there might be a complex data structure that allowed rapid response to
a variety of queries. But, unlike the programmers for earlier database systems,
the programmer of a relational system would not be concerned with the storage
structure. Queries could be expressed in a very high-level language, which
greatly increased the efficiency of database programmers. SQL (“Structured
Query Language”) is the most important query language based on the relational
model.
By 1990, relational database systems were the norm. Yet the database field
continues to evolve, and new issues and approaches to the management of data
surface regularly. Object-oriented features have infilrated the relational model.
Some of the largest databases are organized rather differently from those using
relational methodology. In the balance of this section, we shall consider some
of the modern trends in database systems.
1.3 Smaller and Smaller Systems
Originally, DBMS’s were large, expensive software systems running on large
computers. The size was necessary, because to store a gigabyte of data required
a large computer system. Today, hundreds of gigabytes fit on a single disk,
and it is quite feasible to run a DBMS on a personal computer. Thus, database
systems based on the relational model have become available for even very small
machines, and they are beginning to appear as a common tool for computer
applications, much as spreadsheets and word processors did before them.
Another important trend is the use of documents, often tagged using XML
(eXtensible Modeling Language). Large collections of small documents can
1CODASYL Data Base Task Group April 1971 Report, ACM, New York.
2Codd, E. F., “A relational model for large shared data banks,” Comm. ACM, 13:6,
pp. 377–387, 1970.
3
12.
THE WORLDS OFDATABASE SYSTEMS
serve as a database, and the methods of querying and manipulating them are
different from those used in relational systems.
1.4 Bigger and Bigger Systems
On the other hand, a gigabyte is not that much data any more. Corporate
databases routinely store terabytes (1012
bytes). Yet there are many databases
that store petabytes (1015
bytes) of data and serve it all to users. Some impor-
tant examples:
1. Google holds petabytes of data gleaned from its crawl of the Web. This
data is not held in a traditional DBMS, but in specialized structures
optimized for search-engine queries.
2. Satellites send down petabytes of information for storage in specialized
systems.
3. A picture is actually worth way more than a thousand words. You can
store 1000 words in five or six thousand bytes. Storing a picture typi-
cally takes much more space. Repositories such as Flickr store millions
of pictures and support search of those pictures. Even a database like
Amazon’s has millions of pictures of products to serve.
4. And if still pictures consume space, movies consume much more. An hour
of video requires at least a gigabyte. Sites such as YouTube hold hundreds
of thousands, or millions, of movies and make them available easily.
5. Peer-to-peer file-sharing systems use large networks of conventional com-
puters to store and distribute data of various kinds. Although each node
in the network may only store a few hundred gigabytes, together the
database they embody is enormous.
1.5 Information Integration
To a great extent, the old problem of building and maintaining databases has
become one of information integration: joining the information contained in
many related databases into a whole. For example, a large company has
many divisions. Each division may have built its own database of products
or employee records independently of other divisions. Perhaps some of these
divisions used to be independent companies, which naturally had their own way
of doing things. These divisions may use different DBMS’s and different struc-
tures for information. They may use different terms to mean the same thing or
the same term to mean different things. To make matters worse, the existence
of legacy applications using each of these databases makes it almost impossible
to scrap them, ever.
As a result, it has become necessary with increasing frequency to build struc-
tures on top of existing databases, with the goal of integrating the information
4
13.
THE WORLDS OFDATABASE SYSTEMS
distributed among them. One popular approach is the creation of data ware-
houses, where information from many legacy databases is copied periodically,
with the appropriate translation, to a central database. Another approach is
the implementation of a mediator, or “middleware,” whose function is to sup-
port an integrated model of the data of the various databases, while translating
between this model and the actual models used by each database.
2 Overview of a Database Management
System
In Fig. 1 we see an outline of a complete DBMS. Single boxes represent system
components, while double boxes represent in-memory data structures. The solid
lines indicate control and data flow, while dashed lines indicate data flow only.
Since the diagram is complicated, we shall consider the details in several stages.
First, at the top, we suggest that there are two distinct sources of commands
to the DBMS:
1. Conventional users and application programs that ask for data or modify
data.
2. A database administrator: a person or persons responsible for the struc-
ture or schema of the database.
2.1 Data-Definition Language Commands
The second kind of command is the simpler to process, and we show its trail
beginning at the upper right side of Fig. 1. For example, the database admin-
istrator, or DBA, for a university registrar’s database might decide that there
should be a table or relation with columns for a student, a course the student
has taken, and a grade for that student in that course. The DBA might also
decide that the only allowable grades are A, B, C, D, and F. This structure
and constraint information is all part of the schema of the database. It is
shown in Fig. 1 as entered by the DBA, who needs special authority to exe-
cute schema-altering commands, since these can have profound effects on the
database. These schema-altering data-definition language (DDL) commands
are parsed by a DDL processor and passed to the execution engine, which then
goes through the index/file/record manager to alter the metadata, that is, the
schema information for the database.
2.2 Overview of Query Processing
The great majority of interactions with the DBMS follow the path on the left
side of Fig. 1. A user or an application program initiates some action, using
the data-manipulation language (DML). This command does not affect the
schema of the database, but may affect the content of the database (if the
5
14.
THE WORLDS OFDATABASE SYSTEMS
Buffers
Storage
Index/file/rec−
Storage
ord manager
Execution
engine
Transaction
manager
manager
Logging and
recovery
Database
administrator
table
Query
compiler compiler
Concurrency
control
Lock
manager
Buffer
DDL
User/application
queries,
updates
query
plan
index, file, and
record requests
commands
page
read/write
pages
transaction
commands
statistics
metadata,
log
pages
commands
DDL
data,
metadata,
indexes
metadata
Figure 1: Database management system components
6
15.
Visit https://ebookmass.com todayto explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
16.
THE WORLDS OFDATABASE SYSTEMS
action is a modification command) or will extract data from the database (if the
action is a query). DML statements are handled by two separate subsystems,
as follows.
Answering the Query
The query is parsed and optimized by a query compiler. The resulting query
plan, or sequence of actions the DBMS will perform to answer the query, is
passed to the execution engine. The execution engine issues a sequence of
requests for small pieces of data, typically records or tuples of a relation, to a
resource manager that knows about data files (holding relations), the format
and size of records in those files, and index files, which help find elements of
data files quickly.
The requests for data are passed to the buffer manager. The buffer man-
ager’s task is to bring appropriate portions of the data from secondary storage
(disk) where it is kept permanently, to the main-memory buffers. Normally, the
page or “disk block” is the unit of transfer between buffers and disk.
The buffer manager communicates with a storage manager to get data from
disk. The storage manager might involve operating-system commands, but
more typically, the DBMS issues commands directly to the disk controller.
Transaction Processing
Queries and other DML actions are grouped into transactions, which are units
that must be executed atomically and in isolation from one another. Any query
or modification action can be a transaction by itself. In addition, the execu-
tion of transactions must be durable, meaning that the effect of any completed
transaction must be preserved even if the system fails in some way right after
completion of the transaction. We divide the transaction processor into two
major parts:
1. A concurrency-control manager, or scheduler, responsible for assuring
atomicity and isolation of transactions, and
2. A logging and recovery manager, responsible for the durability of trans-
actions.
2.3 Storage and Buffer Management
The data of a database normally resides in secondary storage; in today’s com-
puter systems “secondary storage” generally means magnetic disk. However, to
perform any useful operation on data, that data must be in main memory. It
is the job of the storage manager to control the placement of data on disk and
its movement between disk and main memory.
In a simple database system, the storage manager might be nothing more
than the file system of the underlying operating system. However, for efficiency
7
17.
THE WORLDS OFDATABASE SYSTEMS
purposes, DBMS’s normally control storage on the disk directly, at least under
some circumstances. The storage manager keeps track of the location of files
on the disk and obtains the block or blocks containing a file on request from
the buffer manager.
The buffer manager is responsible for partitioning the available main mem-
ory into buffers, which are page-sized regions into which disk blocks can be
transferred. Thus, all DBMS components that need information from the disk
will interact with the buffers and the buffer manager, either directly or through
the execution engine. The kinds of information that various components may
need include:
1. Data: the contents of the database itself.
2. Metadata: the database schema that describes the structure of, and con-
straints on, the database.
3. Log Records: information about recent changes to the database; these
support durability of the database.
4. Statistics: information gathered and stored by the DBMS about data
properties such as the sizes of, and values in, various relations or other
components of the database.
5. Indexes: data structures that support efficient access to the data.
2.4 Transaction Processing
It is normal to group one or more database operations into a transaction, which
is a unit of work that must be executed atomically and in apparent isolation
from other transactions. In addition, a DBMS offers the guarantee of durability:
that the work of a completed transaction will never be lost. The transaction
manager therefore accepts transaction commands from an application, which
tell the transaction manager when transactions begin and end, as well as infor-
mation about the expectations of the application (some may not wish to require
atomicity, for example). The transaction processor performs the following tasks:
1. Logging: In order to assure durability, every change in the database is
logged separately on disk. The log manager follows one of several policies
designed to assure that no matter when a system failure or “crash” occurs,
a recovery manager will be able to examine the log of changes and restore
the database to some consistent state. The log manager initially writes
the log in buffers and negotiates with the buffer manager to make sure that
buffers are written to disk (where data can survive a crash) at appropriate
times.
2. Concurrency control: Transactions must appear to execute in isolation.
But in most systems, there will in truth be many transactions executing
8
18.
THE WORLDS OFDATABASE SYSTEMS
The ACID Properties of Transactions
Properly implemented transactions are commonly said to meet the “ACID
test,” where:
• “A” stands for “atomicity,” the all-or-nothing execution of trans-
actions.
• “I” stands for “isolation,” the fact that each transaction must appear
to be executed as if no other transaction is executing at the same
time.
• “D” stands for “durability,” the condition that the effect on the
database of a transaction must never be lost, once the transaction
has completed.
The remaining letter, “C,” stands for “consistency.” That is, all databases
have consistency constraints, or expectations about relationships among
data elements (e.g., account balances may not be negative after a trans-
action finishes). Transactions are expected to preserve the consistency of
the database.
at once. Thus, the scheduler (concurrency-control manager) must assure
that the individual actions of multiple transactions are executed in such
an order that the net effect is the same as if the transactions had in
fact executed in their entirety, one-at-a-time. A typical scheduler does
its work by maintaining locks on certain pieces of the database. These
locks prevent two transactions from accessing the same piece of data in
ways that interact badly. Locks are generally stored in a main-memory
lock table, as suggested by Fig. 1. The scheduler affects the execution of
queries and other database operations by forbidding the execution engine
from accessing locked parts of the database.
3. Deadlock resolution: As transactions compete for resources through the
locks that the scheduler grants, they can get into a situation where none
can proceed because each needs something another transaction has. The
transaction manager has the responsibility to intervene and cancel (“roll-
back” or “abort”) one or more transactions to let the others proceed.
2.5 The Query Processor
The portion of the DBMS that most affects the performance that the user sees
is the query processor. In Fig. 1 the query processor is represented by two
components:
9
19.
THE WORLDS OFDATABASE SYSTEMS
1. The query compiler, which translates the query into an internal form
called a query plan. The latter is a sequence of operations to be performed
on the data. Often the operations in a query plan are implementations
of “relational algebra” operations. The query compiler consists of three
major units:
(a) A query parser, which builds a tree structure from the textual form
of the query.
(b) A query preprocessor, which performs semantic checks on the query
(e.g., making sure all relations mentioned by the query actually
exist), and performing some tree transformations to turn the parse
tree into a tree of algebraic operators representing the initial query
plan.
(c) A query optimizer, which transforms the initial query plan into the
best available sequence of operations on the actual data.
The query compiler uses metadata and statistics about the data to decide
which sequence of operations is likely to be the fastest. For example, the
existence of an index, which is a specialized data structure that facilitates
access to data, given values for one or more components of that data, can
make one plan much faster than another.
2. The execution engine, which has the responsibility for executing each of
the steps in the chosen query plan. The execution engine interacts with
most of the other components of the DBMS, either directly or through
the buffers. It must get the data from the database into buffers in order
to manipulate that data. It needs to interact with the scheduler to avoid
accessing data that is locked, and with the log manager to make sure that
all database changes are properly logged.
10
20.
THE WORLDS OFDATABASE SYSTEMS
3 References
Today, on-line searchable bibliographies cover essentially all recent papers con-
cerning database systems. Thus, we shall not try to be exhaustive in our cita-
tions, but rather shall mention only the papers of historical importance and
major secondary sources or useful surveys. A searchable index of database
research papers was constructed by Michael Ley [5], and has recently been
expanded to include references from many fields. Alf-Christian Achilles main-
tains a searchable directory of many indexes relevant to the database field [3].
While many prototype implementations of database systems contributed to
the technology of the field, two of the most widely known are the System R
project at IBM Almaden Research Center [4] and the INGRES project at Berke-
ley [7]. Each was an early relational system and helped establish this type of
system as the dominant database technology. Many of the research papers that
shaped the database field are found in [6].
The 2003 “Lowell report” [1] is the most recent in a series of reports on
database-system research and directions. It also has references to earlier reports
of this type.
You can find more about the theory of database systems than is covered
here from [2] and [8].
1. S. Abiteboul et al., “The Lowell database research self-assessment,” Comm.
ACM 48:5 (2005), pp. 111–118. http://research.microsoft.com/˜gray
/lowell/LowellDatabaseResearchSelfAssessment.htm
2. S. Abiteboul, R. Hull, and V. Vianu, Foundations of Databases, Addison-
Wesley, Reading, MA, 1995.
3. http://liinwww.ira.uka.de/bibliography/Database .
11
21.
THE WORLDS OFDATABASE SYSTEMS
4. M. M. Astrahan et al., “System R: a relational approach to database
management,” ACM Trans. on Database Systems 1:2, pp. 97–137, 1976.
5. http://www.informatik.uni-trier.de/˜ley/db/index.html . A mir-
ror site is found at http://www.acm.org/sigmod/dblp/db/index.html .
6. M. Stonebraker and J. M. Hellerstein (eds.), Readings in Database Sys-
tems, Morgan-Kaufmann, San Francisco, 1998.
7. M. Stonebraker, E. Wong, P. Kreps, and G. Held, “The design and imple-
mentation of INGRES,” ACM Trans. on Database Systems 1:3, pp. 189–
222, 1976.
8. J. D. Ullman, Principles of Database and Knowledge-Base Systems, Vol-
umes I and II, Computer Science Press, New York, 1988, 1989.
12
22.
The Relational Modelof
Data
This chapter introduces the most important model of data: the two-dimensional
table, or “relation.” We begin with an overview of data models in general. We
give the basic terminology for relations and show how the model can be used to
represent typical forms of data. We then introduce a portion of the language
SQL — that part used to declare relations and their structure. The chapter
closes with an introduction to relational algebra. We see how this notation
serves as both a query language — the aspect of a data model that enables us
to ask questions about the data — and as a constraint language — the aspect
of a data model that lets us restrict the data in the database in various ways.
1 An Overview of Data Models
The notion of a “data model” is one of the most fundamental in the study of
database systems. In this brief summary of the concept, we define some basic
terminology and mention the most important data models.
1.1 What is a Data Model?
A data model is a notation for describing data or information. The description
generally consists of three parts:
1. Structure of the data. You may be familiar with tools in programming
languages such as C or Java for describing the structure of the data used by
a program: arrays and structures (“structs”) or objects, for example. The
data structures used to implement data in the computer are sometimes
referred to, in discussions of database systems, as a physical data model,
although in fact they are far removed from the gates and electrons that
truly serve as the physical implementation of the data. In the database
23.
THE RELATIONAL MODELOF DATA
world, data models are at a somewhat higher level than data structures,
and are sometimes referred to as a conceptual model to emphasize the
difference in level. We shall see examples shortly.
2. Operations on the data. In programming languages, operations on the
data are generally anything that can be programmed. In database data
models, there is usually a limited set of operations that can be performed.
We are generally allowed to perform a limited set of queries (operations
that retrieve information) and modifications (operations that change the
database). This limitation is not a weakness, but a strength. By limiting
operations, it is possible for programmers to describe database operations
at a very high level, yet have the database management system implement
the operations efficiently. In comparison, it is generally impossible to
optimize programs in conventional languages like C, to the extent that an
inefficient algorithm (e.g., bubblesort) is replaced by a more efficient one
(e.g., quicksort).
3. Constraints on the data. Database data models usually have a way to
describe limitations on what the data can be. These constraints can range
from the simple (e.g., “a day of the week is an integer between 1 and 7”
or “a movie has at most one title”) to some very complex limitations.
1.2 Important Data Models
Today, the two data models of preeminent importance for database systems are:
1. The relational model, including object-relational extensions.
2. The semistructured-data model, including XML and related standards.
The first, which is present in all commercial database management systems,
is the subject of this chapter. The semistructured model, of which XML is
the primary manifestation, is an added feature of most relational DBMS’s, and
appears in a number of other contexts as well.
1.3 The Relational Model in Brief
The relational model is based on tables, of which Fig. 1 is an example. We shall
discuss this model beginning in Section 2. This relation, or table, describes
movies: their title, the year in which they were made, their length in minutes,
and the genre of the movie. We show three particular movies, but you should
imagine that there are many more rows to this table — one row for each movie
ever made, perhaps.
The structure portion of the relational model might appear to resemble an
array of structs in C, where the column headers are the field names, and each
14
24.
THE RELATIONAL MODELOF DATA
title year length genre
Gone With the Wind 1939 231 drama
Star Wars 1977 124 sciFi
Wayne’s World 1992 95 comedy
Figure 1: An example relation
of the rows represent the values of one struct in the array. However, it must be
emphasized that this physical implementation is only one possible way the table
could be implemented in physical data structures. In fact, it is not the normal
way to represent relations, and a large portion of the study of database systems
addresses the right ways to implement such tables. Much of the distinction
comes from the scale of relations — they are not normally implemented as
main-memory structures, and their proper physical implementation must take
into account the need to access relations of very large size that are resident on
disk.
The operations normally associated with the relational model form the “rela-
tional algebra,” which we discuss beginning in Section 4. These operations are
table-oriented. As an example, we can ask for all those rows of a relation that
have a certain value in a certain column. For example, we can ask of the table
in Fig. 1 for all the rows where the genre is “comedy.”
The constraint portion of the relational data model will be touched upon
briefly in Section 5. However, as a brief sample of what kinds of constraints are
generally used, we could decide that there is a fixed list of genres for movies,
and that the last column of every row must have a value that is on this list. Or
we might decide (incorrectly, it turns out) that there could never be two movies
with the same title, and constrain the table so that no two rows could have the
same string in the first component.
1.4 The Semistructured Model in Brief
Semistructured data resembles trees or graphs, rather than tables or arrays.
The principal manifestation of this viewpoint today is XML, a way to represent
data by hierarchically nested tagged elements. The tags, similar to those used
in HTML, define the role played by different pieces of data, much as the column
headers do in the relational model. For example, the same data as in Fig. 1
might appear in an XML “document” as in Fig. 2.
The operations on semistructured data usually involve following paths in
the implied tree from an element to one or more of its nested subelements,
then to subelements nested within those, and so on. For example, starting at
the outer <Movies> element (the entire document in Fig. 2), we might move to
each of its nested <Movie> elements, each delimited by the tag <Movie> and
matching </Movie> tag, and from each <Movie> element to its nested <Genre>
element, to see which movies belong to the “comedy” genre.
15
25.
THE RELATIONAL MODELOF DATA
<Movies>
<Movie title="Gone With the Wind">
<Year>1939</Year>
<Length>231</Length>
<Genre>drama</Genre>
</Movie>
<Movie title="Star Wars">
<Year>1977</Year>
<Length>124</Length>
<Genre>sciFi</Genre>
</Movie>
<Movie title="Wayne’s World">
<Year>1992</Year>
<Length>95</Length>
<Genre>comedy</Genre>
</Movie>
</Movies>
Figure 2: Movie data as XML
Constraints on the structure of data in this model often involve the data
type of values associated with a tag. For instance, are the values associated
with the <Length> tag integers or can they be arbitrary character strings?
Other constraints determine which tags can appear nested within which other
tags. For example, must each <Movie> element have a <Length> element nested
within it? What other tags, besides those shown in Fig. 2 might be used within
a <Movie> element? Can there be more than one genre for a movie?
1.5 Other Data Models
There are many other models that are, or have been, associated with DBMS’s.
A modern trend is to add object-oriented features to the relational model. There
are two effects of object-orientation on relations:
1. Values can have structure, rather than being elementary types such as
integer or strings, as they were in Fig. 1.
2. Relations can have associated methods.
In a sense, these extensions, called the object-relational model, are analogous to
the way structs in C were extended to objects in C++.
16
26.
Visit https://ebookmass.com todayto explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
would be nouse to the Germans as draught or saddle horses, and it
is not an unreasonable supposition that they were commandeered
for food: Pte. A. Forbes, Gordon Highlanders.
Not So “Swanky”
Their prisoners aren’t near so swanky as they were at first, when
they used to move about as though the British soldiers weren’t fit to
be seen with. Now they’re glad to fall into our hands, and if they see
the uniform at all they surrender without further trouble. They’ve all
got Government news-sheets containing all sorts of stories, and they
say that these are distributed every day. Perhaps they get them
instead of grub, and if that’s the case it would account for the half-
fed appearance of so many of the prisoners: Pte. Taylor, Rifle
Brigade.
Undaunted
A few days ago I witnessed a most exciting incident. A French staff
officer went up in an aeroplane and the Germans opened fire on
him. Shots went wide at first and then all around him. He didn’t
mind that, but turned about again and once more ran the gauntlet.
Then the Germans started again, but that didn’t stop him. He turned
once more and came back before making off to headquarters with
information as to where the Germans were: Drill-Instructor
Anderson.
“Rotten Luck”
We are all putting up in farms on account of our horses being under
cover from the aeroplanes, which have done a lot of damage. The
9th had just got in from a good hard day, when a big shell came into
their yard and killed ten men and wounded four. Who would have
expected that, after getting away from the firing line all safe? Of
29.
course, they mighthave been stray shells trying to find our artillery.
But then it is what you may call rotten luck: Pte. Robinson, 18th
Hussars.
Near Shaves
I saw some brave things done. “Tanker” Gillespie endeavoured three
times, at great risk, to aid a comrade who had been seriously
wounded. The first time he got up a bullet grazed his head, and I
saw him rubbing it with rather comical grimness, and then seizing
hold of his rifle, the barrel of which had nearly all been blown away,
and firing; three or four shots at the Germans. He tried a second
time to reach his comrade, but again had to duck, and the third time
he succeeded, only to find that the poor fellow had died. In
returning to his place, “Tanker” was struck by a bullet which took
away some of the hair on his head, and he had to retire: Pte.
McMahon, Gordon Highlanders.
Custom!
German shell fire is not nearly so effective shot for shot and gun for
gun as ours, in spite of all the fine things they claim for it, and
where great accuracy in range is necessary they are hopelessly out
of it. Their infantry can’t stand half the shelling our men will put up
with, and they get awfully panicky under fire from our guns. It is a
favourite trick of the Germans to keep a battery well masked for
hours, and then when our infantry are deploying within range,
without the slightest notion of what is coming, the German shells
begin to fall round like the autumn leaves. That’s very trying to the
nerves, or was at first, but we are now getting used to it: Gunner T.
Wall.
Buried and Burnt
30.
There was oneinteresting sight I saw as the column was on the
march, and that was a duel in the air between French and German
aeroplanes. It was wonderful to see the Frenchman manœuvre to
get the upper position of the German, and after about ten minutes
or a quarter of an hour the Frenchman got on top and blazed away
with a revolver on the German. He injured him so much as to cause
him to descend, and when found he was dead. The British buried
the airman and burnt the aeroplane: A Private of the 1st Royal Kent
Regiment.
“That Tired Feeling”
We are now getting into our stride and beginning to get a little of
our own back out of the Germans. They don’t like it at all now that
we are nearer to them in numbers, and their men all look like so
many “Weary Willies,” they are so tired. You might say they had got
“that tired feeling” bad, and so they have. Some of them just drop
into our arms when we call on them to surrender, as though it were
the thing they’d been waiting for all their lives: Lance-Corporal T.
Williams.
Lucky Fellow!
It was a pitiful sight to see the people fleeing from their homes
carrying all they could save. Our soldiers are very kind to them, and
give them whatever they can spare—and sometimes more than that.
I saw one young woman trying to reach some fruit from a tree which
was a good way out of her reach, and, not thinking, I went over and
gave her some pears which I had given me. She ate them hurriedly,
but before doing so gave me a kiss on both cheeks, which was
rather enjoyed by the rest of the troops standing by: Driver J.
Brennan, Army Service Corps.
So Glad!
31.
Oh, dear! Iam pleased all my good women live in England. Often I
see cottage homes a-smoke and in flames. Villages, too! Dogs
forlorn, cats despondent on doorsteps. And yesterday I saw three
little dots walking along the muddy road with a tiny wheelbarrow.
We were, when we passed them, going under cover from a severe
shell fire, whilst they were going in the direction whence we were
coming. At present we are billeted in the buildings about a huge
water-mill. The wooded hills are all around, and the harvests seem
all gathered in about here. It is not so elsewhere: A Reservist of the
Beds Regiment.
The Gallant Belgians
We are doing fine, and have earned the name of the “Fighting Fifth”
again. We have heard that some Hindus have come from India to
fight, and the public expect great things from them; but you take it
from me, no matter how brave, how fearless they may be, they will
never equal the brave little Belgian people. What other race in the
world could have fought with more courage and determination than
they when the German curs burnt Louvain and committed the most
dastardly outrages? Who were they who bit their lips to hide their
feelings, but who swore that the Germans should pay for it—not in
the way the Germans made the women and children suffer, but by
good lead and cold steel? The Belgians! Pte. A. Hayes, of Upper
Wortley.
In the Dark
We had not gone three hundred yards before the Germans fired on
us. We were between two farmhouses. We were only about thirty to
forty yards off, and we didn’t half give it them. We could hear the
wounded Germans moaning and groaning, and it was awful to hear.
It was dark, and we fired low because we knew that was the best
way to get them. Just then a piece of shrapnel came through the
peak of my cap and grazed my nose. It was a near thing, but I took
32.
no notice ofit and kept on firing. The man next to me was then shot
dead, and our captain was shot slightly in the head, but he
continued to give orders. A piece of my boot was blown away, and I
received a piece of shrapnel in my right shoulder, and consequently
saw no more of the fighting: Pte. Brayshaw, Guards Brigade.
A Bold Battery
Half the horses of L Battery Royal Artillery got smashed, and we had
to bung our poor old tired ones to fill up. Only a few gunners were
left, but they stood by firing still and singing “Onward, Christian
Soldiers.” Then the Germans charged, and our gunners did a bunk,
but not before they had driven spikes into the guns so as to make
them useless to the enemy. They said they guessed they would get
them back in a day or two, and if they did they could repair them
easy enough. The Germans don’t know these tricks, and we can do
them down any time: A Driver of the 4th Ammunition Column.
Before the Dawn
I was given a map, and a message for my company officer. When I
had made my way in the dark to where the outpost should have
been, I found it had retired. I went to where I saw a picket posted,
and noticed a body of men. It was just getting light, and I thought I
saw an English officer. I put down my rifle and whistled. They
immediately dropped down and fired at me. I dropped into the
grass, too, to bluff them into thinking I had been “winged.” I crawled
through a big turnip field, and heard a general action commencing. I
could hear people talking, but not loudly enough to know whether
they were English. So I hoisted my cap upon a stick and called,
“Hullo, West Kent!” Then shots came in my direction, and, as it was
getting lighter, I decided, as the best thing to do, to make for our big
guns. I crawled along the ground for nearly two hours, and when I
stopped for a short rest a bullet hit my right arm: Corpl. Drinkwater,
West Kent Regiment.
33.
Rescued
In getting outof my trench I fell back, so injuring my back that I
could not move. I lay there, expecting every minute to be my last,
but it did not come. I took a bold front and looked over the trench to
see what was happening there. I saw that the Germans had taken a
sweeping curve to the right, and I saw the tail of them a long way
off. They seem to be driven along by their officers rather than led,
for the officers have their swords drawn. I laid down in the trench
(my comrades had evidently thought I was shot, as they took no
notice of me when I fell back into the trench) for two hours, looking
now and again to see if I could see any signs of our men. At last,
after nearly giving up hope, I saw a patrol of the 15th Hussars, and
managed to attract their attention, and they put me on a horse and
carried me to a French hospital in a village: A Private in the Royal
Sussex Regiment.
A “Jelly Fish”
I was ordered to remain behind with the aeroplanes, one of which
was to go up early in the morning and return, and I was to take
reports on to headquarters. The machine had been gone half an
hour when rifle fire was heard, and we discovered that a German
aeroplane was flying overhead. The officers got rifles, and likewise
myself, and stood up to have a shot, but he went away, only,
however, to return. We allowed him to get in range and then opened
fire. He came over the place where we were lying down. I fired
twenty-five rounds and expected to have a bomb dropped on us,
when I saw he was done. He made one dive and landed in a heap
behind us. On examining him we found twelve bombs, all of which
had safety caps and pins attached, luckily for us. He had a lot of
papers which I had the honour to carry to headquarters. The fall
made him like a jelly fish: Private A. J. Davis.
34.
Cold—and Hot!
We hadto climb up a big hill, and then through a quarry, so that we
were fagged out and wet through before we saw the enemy. When
we did get to the top they gave us a good welcome with shot and
shell. It was so heavy it dug up the ground in front of us, but we
had to go on and try to shift them. I saw some sights up there, with
one man down after another. I expected the next to be me, but I
had determined that I would keep my end up and do my best, so I
kept going on. Well, the long and short of it was that we got to them
about tea-time, or what should be tea-time. We found them about
sixteen to one, or that is what I thought. We could not shift them,
but just as I thought we were getting the best of it someone gave
the order to retire, which we did. When we got back we found we
had lost all our officers, and nobody could tell who gave the order to
retire, and the sun was then sinking. It was in going back that I was
wounded. It is not a bad wound, and you must thank God, as I have
done, that I got through at all: Pte. Clare, 1st Royal Lancashire
Regiment.
“Knocked!”
When night came we knew where the Germans were, so we crept
out of the trenches and went down to the roadway. No sooner had
we got there than a great volley rang out. We were in the midst of
it, and knew it was either the Germans or us. So we at them. In the
struggle that took place I thought of you and the children. I made a
jump at a German, but whether I got him or not I don’t remember,
for I got such a terrible knock over the ribs. It must have been with
the butt of a rifle. You talk about getting your ribs bent. I got mine,
and more than that my appendix got first. They thought at first that
it was a bullet wound, but happily it was not, or I might not have
been here to tell the tale. I was knocked into a “trap” trench about
eight feet deep, but I was pulled out and carried eight miles on
horseback: A Private of the Gordon Highlanders.
35.
In a Château
Twohundred of us went into a big château, where we were told we
would be quite safe, and we sat down to a meal of tea and biscuits.
We were just in the middle of it when a patrol of German cavalry
scouts discovered us, and as we were eating, a shell struck the roof
of the building, smashing it into fragments. Then there was the
greatest excitement as the men scurried out of the building. As the
shells were getting very busy we lost no time in retreating from that
place, and took up our position in a field about 200 yards distant.
There were a lot of wounded around, and we were lying on a slightly
elevated ridge in the field. We had only been a short time in this
position when we saw the Somersets getting badly cut up. We went
to the assistance of the Somersets, and succeeded in checking the
Germans’ advance. We began to go forward and went at them with
the bayonet, when they turned and fled. We were just 150 yards
away when they packed themselves into motor-cars that were
waiting on them and drove off, but before they went we managed to
capture five of their machine guns: Pte. T. O’Dea, Seaforth
Highlanders.
“Made Good!”
Our last action was the worst. Men fell like corn before the reaper. I
tell you truly, I never expected to get out alive. The Germans must
have lost thousands, but they were ten to one, so we had to retire.
The shrapnel and hail of lead and bullets—I see it all now, and I was
one of the last to leave the field. I won’t say more, only I got a
bullet through my right leg, but still kept on twenty yards or
thereabouts. I got a great piece of shrapnel shell in my neck—laid
me senseless. I came to again, and, as if possessed, ran for my life
through it all and “made good.” It’s wonderful how you can run with
a bullet through your leg. I have not been long at it, but fellows say
that they saw more in the last four days than they did in three years
in Africa. That’s the truth. Ah, well! I’m not grumbling. I’m not
36.
disfigured or maimedlike so many poor fellows, so let’s rejoice over
all. Some of our engagements lasted thirteen hours, and the last—
and worst—ten hours. So tired, must sleep: A Lance-Sergeant of the
King’s Own Yorkshire Light Infantry
A “Terrible Time”
We had a terrible time at Mons, and for four days and nights we did
nothing but fight, and I should think the Germans had three men to
every one of ours. On August 24 we lost one hundred men in about
five minutes. We had a mile and a half to gallop over open country
with as many as thirty shells a minute bursting round us. How I got
out of it I do not know, for I had not gone 200 yards before a shell
burst under my horse and killed it. I was not touched, and I
managed, with a bit of luck, to get another horse from a comrade
who had been killed. I am sure it was worse than hell let loose, and
I think I said a prayer afterwards, but anyway I shall soon be right
now. The man who was with me when I was wounded is dead. He
died as soon as the search party found us. He was shot twice in the
stomach, whilst I was shot in the thigh. I crawled to him when he
was dying, but I could not help him as I was in such agony myself.
He gave me his papers, and I gave them to the officer when he rode
up to us: Lance-Corpl. Potton, 18th Hussars.
His True Colours
We had been entrenched two days when a German spy was
captured. He spoke English as well as I do, and shouted to me, “I
surrender, I surrender; take me prisoner.” He was placed in a corner
of the trench, seven feet deep, and was guarded. He soon began to
chatter, and told us his history in such a plausible manner that we
believed him. He told us he had been in private service as a butler in
Surrey and Sussex, and also a waiter in hotels at Brighton, Liverpool,
and Manchester. The devil actually cried when he pulled out of his
pocket the photo of a girl he said he intended making his wife when
37.
the war wasover if he was spared, and begged we would not take it
away from him. He said she was a Lancashire lassie—he could put
on the north-country dialect all right—and read portions of a letter
she wrote him when he was called up. The traitor gave us a lot of
supposed information about the Germans, and pretended to be as
wild as a March hare when he spoke of their officers. They were
everything that was bad. I must admit I thought the fellow was
genuine, and I gave him some of my rations, but several of the
others had their doubts. He had been with us three days when he
showed himself in his true colours. It was pitch dark, and raining like
cats and dogs. He jumped out of the trench and made a dash for the
German trenches, but he did not get thirty yards away before he
was brought down. The next morning we saw his dead body lying
where he fell: Sapper A. G. Hutton, R.E.
A Barricade
We were just about five minutes billeted in the various houses and
just stretching our legs when our officer came running in shouting,
“The Germans are upon us; outside, everyone.” We came out
magazine loaded, bayonets fixed, and eager to get a good bayonet
fight with them. It appears they do not like it, but we found none;
they had not yet arrived. It was 10 P.M. before they did so. In the
meantime, the poor people were leaving the town in crowds with as
much goods and chattels as they could carry away, and it was well
for them, too. It was a dark night when we formed up in the streets,
and the lamps but dimly burned. The noises of rifles and field guns
were terrific. We rushed to the heads of the various streets, where
our German foe would advance. Our field artillery and the
Coldstream Guards went out to delay their advance, whilst we
stripped off our coats and commenced to tear up the square setts,
gather carts—in fact, everything that would build a barricade to keep
back our numerous German foe, and we did so under perfect
showers of shrapnel shell that fell around us and struck the houses
about us, but we were undaunted, and so succeeded: Private Spain.
38.
Wounded and Waiting
Theorder came to retire to a neighbouring haystack. How the
bullets flew about! Up I jumped, and up the slope I ran. I soon
reduced the distance. Another 100 yards to safety—80, 60, 40, 30,
15 yards. Oh, my left knee! I dropped down flat, with my right arm
underneath my body, and my left hand feeling if my leg was still on.
An officer ran by shouting out, “Wounded, lie still.” I was laid on my
chest, and I could see them coming, 200 yards behind me. They did
not put their rifles to their shoulders, but fired from the hips. Bullets
were spitting in the ground around me. “Should I ever get out of
this?” I thought. Something seemed to say to me, “Keep still, and
you will be all right.” On the Germans came to within 100 yards of
me, then 50 yards, then 20 yards, then 10 yards, and there they
halted. They were on the slope leading to the stack, and after a
short conversation two of them came in my direction. “Now for it,” I
said to myself. But no, they passed me and went to the top of the
hill. My arm beneath my body was paralysed, and I could feel the
blood running from my wound. Now and again I could hear one of
them shout out, “Hoch, Kaiser!” and I said to myself, “Hurrah for the
King!” Then I saw them fall in, and about to turn. Thank God! off
they went: Pte. Wood, Coldstream Guards.
Lay the proudusurpers low!
Tyrants fall in every foe!
Liberty’s in every blow!
Let us do or die!
Robert Burns: “Scots Wha Hae.”
And man, whose heav’n-erected face
The smiles of love adorn,—
Mans inhumanity to man
Makes countless thousands mourn!
Burns: “Man was made to Mourn.”
I must admit we were all a bit shaky until we got properly stuck into
it, and then you feel in your glory. You forget all fear, everybody full
of excitement. You hardly think of your funeral: Gunner J. Robinson,
Royal Field Artillery.
Inconceivable!
People in England can have no idea what it is like on a battlefield,
thousands of dead and wounded lying about with nobody to help
them. After my pal and I got hit we could hear the deadly shell on
its way, but could not move, and had to lay for some time. My pal
had his foot blown off: Gunner J. Edgecombe, Royal Field Artillery.
Gets Used to It
I shall never forget when the first shot was fired. We soon got used
to it, and I was as anxious to get at them as anyone else. It is awful
in action. I saw my two chums shot down beside me, and one of
41.
them said withhis dying breath, “Kill ten of those German devils for
me,” and I think I did: Pte. E. Mead, 19th Hussars.
Gay to Grave
You must not take too much notice of the reports of the soldiers in
the trenches singing as if they had not a care in the world. I heard
more talk of religion—and from men from whom you would least
expect it—than any popular songs! Some of the sights are simply
shocking—you could not talk about them: Private Pope.
Encouraged
It was my first baptism of fire, and I frankly confess that I thought
my time had come. It was a nerve-racking experience. I said a
prayer to myself. But the fear soon wore away, and I recognized that
to save my own skin I must beat the enemy. We were also
encouraged by the poor marksmanship of the Germans: Pte.
Gallagher, Royal Scots Fusiliers.
Wondering!
We saw some terrible sights—women and children cut up—and I
shall never forget until my dying day some of the awful things I saw.
The firing was awful. I am not much of a praying chap, but I prayed
when the shots were coming thick about us. It was maddening to
see the fellows shot down right and left, and wondering when it
would be my turn: Pte. Sibley, 3rd Worcester Regiment.
Jubilant
War! How terrible the word sounds, but our British spirit in us makes
us view things from the bright side. I do not mean to imply that the
troops do not think it a serious concern—far from it—but all seem
42.
quite confident. Whenunder heavy fire there seems to exist a
jubilant sort of spirit, each and all steady and ready to sacrifice
themselves for the honour of England: A Private of the Scottish
Rifles.
Mad!
You feel pretty shaky going into battle at first. When you are going
along the road and see dead lying here and there and hear the
groaning of the wounded you do feel rather queer, but once you see
what you are getting at, all that feeling disappears and your one
desire is to get at them. In fact, when the bullets begin to fly you
turn mad for the time being: Pte. Lightfoot, Cameron Highlanders.
Know nor Care
You don’t realize that you are in danger until some of the men
around you get knocked over by shells and bullets, but afterwards
you have the feeling that you don’t care. You know you have to be
there, and you don’t care a hang whether you get knocked over or
not. In a way you are only too glad when you can get to close
quarters with the Germans. As to the sensation caused by being
struck by a bullet, it is just like being hit by a stone thrown at you: A
Sergeant of the Irish Rifles.
An “Infernal Din”
Artillery fire is the deadliest thing out, and it takes a lot of nerve to
stand it. The Germans keep up an infernal din from morning until far
into the night; but they don’t do half as much damage as you would
think, though it is annoying to have all that row going on when
you’re trying to write home or make up the regimental accounts. The
French seem to like the noise, and don’t seem at all happy unless it’s
there. There’s no accounting for tastes: Sergeant J. Baker.
43.
Splendid but Awful
Theorder was given, “Retire! Every man for himself!” It was a
splendid but awful sight to see horses, men, and guns racing for life
with shells bursting among them. The Germans rushed up, and I lay
helpless. A German pointed his rifle at me for me to surrender. I
refused, and was just on the point of being put out when a German
officer saved me. He said, “Englishman brave fool.” He then dressed
my wound, and he gave me brandy and wine and left me: Gunner B.
Wiseman, Royal Artillery.
How It Happened
How I came to be wounded was like this. I had got my bayonet fixed
in some fat German, and I could not get it out in time, and a
German officer hit me over the head with the butt of his revolver. Of
course I went down for the count, and when I came round I found I
had stopped a stray shot with my left foot, so I had to lie among the
German dead until it became dark. Then I crawled to the British
lines three miles away, and into hospital: Pte. P. Rourke, North
Lancashires.
Joe to Bill
You know, Bill, it looked hard to see my old chums mowed down like
sheep.... After being under shot and shell for seven hours, Bill, I
know what it is to be at death’s door. You can bet your hat God
answered my prayer, for I asked and He accepted. They were killed
on each side of me, and shells were bursting front and back, but
none hit Joseph, so that was a Godsend. What do you say? I know
what I think, Bill: A Reservist of the Lancashire Fusiliers.
The Stuffing Wrong
44.
“Never say dietill you’re dead” is the only motto for us in the firing
line, for every hour of the blessed day you’re expecting to have your
head blown off by a German shell, and you wonder how on earth
you managed to escape every time it hits something else instead of
you. Their shells make awful havoc when they do burst, but it is not
so often as you would think. There seems to be something wrong
with the stuffing of them: Engineer Hughes, Royal Artillery.
Guarded!
When you do drop asleep you awaken suddenly and think you are
being fired at. Twice now while I have been in battle, the man on my
right and on my left has been killed. The last one next to me to be
killed was poor ——. He was asking me where the enemy was when
he got shot in the arm. Then he got hit in the stomach, and
afterwards, poor chap, in the chest. The man on my right got hit,
and then it came my turn. It is strange that the same thing should
occur twice running. God is guarding me all right: Sergt. Greeley,
South Lancashire Regiment.
A Scamper
The whistle has just blown to get under cover as there is an
aeroplane up. I have just spotted it. All the fellows are running for
shelter so as not to be seen and give the position away. I am inside
the car, a covered van body. The shells are beginning to drop very
close, so we’ll have to make a shift for better cover: they are
screaming and howling like some of those funny fireworks, but you
cannot see them and don’t know where they are going to land any
minute. Our guns are firing on the aeroplane, but I’m afraid he is too
high for them to reach him: Driver F. Clarkson, Artillery Transport
Service.
Causes Deafness
45.
A bullet struckthe kit of Corpl. Thompson, of the 3rd Worcesters,
and lodged in his canteen. Thompson gave a grunt and thought he
was done for, but when the bullet rattled inside the canteen he just
laughed and blessed his luck. It’s a funny thing to go into battle for
the first time. There we were in the trenches with rain falling heavily
all the time, bullets whizzing all round us and shells—death-dealing
things—dropping everywhere. The roar was deafening: in fact, I was
deaf for a week afterwards, and I couldn’t tell what was shouted:
Private J. Sibley.
Twenty to One
We had no cover, and simply walked into the German army, who
were about twenty to one. We bayoneted and charged several times.
They shouted for mercy. They can’t face steel. I think I was just
mad, and the rest were, too, at seeing chums go under. You simply
don’t think about yourself; all your thought is to get at them. I felt
right proud to be a Britisher, especially a Cameron. If I do go under,
it will be fighting with a rifle in my hand and like a Britisher; but, at
the same time, a few Germans are already my victims: A Private of
the Cameron Highlanders.
Under Difficulties
We got into a little hell yesterday and all last night—a proper warm
corner. Shells bursting all over and round us and bullets whizzing
about all over the place. I had to take one of our wagons right into
the firing line. Our captain, who was riding ten yards in front, got
blown off his horse. The battle is still raging now. Heaven only
knows how it will end up. We cannot hear ourselves speak. My
writing is very bad, but you must excuse it as the very ground is
shaking. I have to take another wagon right into the firing line in ten
minutes’ time: A Corporal of the Royal Army Medical Corps.
46.
Not Troubling
The Germansare an awful lot of bad shots with the rifle, but they
are good with the artillery, and that is where we have suffered most
of our losses. There have been very few to speak of who have fallen
through rifle fire. To tell you the truth, I do not seem sometimes as
though I was on a battlefield at all. I go blundering along as if I was
on the dear old sea front at Bridlington, and I find that is the best
way, for, as sure as I am living, the less you think of it all the better.
We do our best, and trust in God. You need not trouble much about
me, for I am as happy here as I am at home. It is no use being
otherwise, and it is like being on guard at home: Pte. C. Gledhill,
Coldstream Guards.
The Pictures!
Every morning we go within 300 yards of the place where the shells
are bursting. First you hear the shell whistling about a quarter of a
mile away like a Gabriel horn, and the nearer it gets the louder, then
it bursts like 120 tyres bursting together. At first it frightened the life
out of me. I was digging some potatoes in a garden, and one burst
about 200 yards away. I left the potatoes and hopped it—I did the
fastest 100 yards on record. When you hear a shell coming it is best
to lie flat—it’s quite amusing to see everybody drop to the ground. It
reminds one of the pictures: Pte. Noel Withers, Army Service Corps.
Healing Nicely!
I got shrapnel in the face, and it entered just by my eye and came
through my mouth, splitting my face open and fracturing my jaw.
Lucky for me my sight is not gone. My face is stitched up and
healing nicely, but I’m afraid I’m disfigured for life. The beggars
were not content with that—they shot me through the left forearm
and fractured the bone. I’ve got it in plaster of Paris. I am glad to
47.
say I amnot in much pain now, and I am as strong as an ox. I had
to leave everything on the battlefield, including my pipe and the
pouch you gave me. Your photo, taken at Paddington, I had in a
waterproof case with some more: A Private of a Field Battery.
Dazed, but There
All the officers stood round us the whole time, including one young
lieutenant who had only just joined the battery from England, and
was under fire for the first time. The captain was wounded, but he
stood up and cried out, “Go on, lads! I’m not killed yet.” We went
on. But another hail of shells came, and the captain fell. We all knew
we were in for it; but we cracked jokes as we loaded and fired. One
by one the fellows went down. Those left shook hands with one
another, and just said, “So long, old man!” My chum at my gun bent
down to look through the aperture of the gun shield. A shell came
and caught him in the forehead. He tumbled up against me as he
fell. Then they got the shells on our limbers. I can’t describe the
sight as our own shells exploded on the spot. There were only ten of
us now. We had never received the order to clear out, and we stuck
it dazed: A Gunner of the Royal Field Artillery.
“A Mad Crew”
When I read in books or stories of the coolness of men under fire I
thought somebody was blathering. But after eight weeks of it, I can
say that no book has ever done justice to the coolness of British
soldiers under conditions that would try anybody. The night I was hit
we were just leaving the trenches for an interview with some
Germans who were trying some of their fancy tricks about our left.
As we stood up there was a ghastly shower of bullets and shells
bursting all round. Into it we had to go, and as we looked ahead one
of our chaps said, “I think we’ll have to get our greatcoats, boys; it’s
raining bullets tonight, and we’ll get wet to the skin if we’re not
careful.” The men of “C” Company started laughing, and then they
48.
took to singing,“Put up your umbrella when it comes on wet.” The
song was taken up all along as we went into the thick of it, and
some of us were humming it as we dashed into the German
trenches. The Germans must have thought us a mad crew: A Private
of the Irish Fusiliers.
Saving a Battery
We were sent up to the firing line to try and save a battery. When
we got there we found that they were nearly all killed or wounded.
Our Irish lads opened fire on the Germans, and you should have
seen them fall. It was like a game of skittles. But as soon as you
knocked them down up came another thousand or so. We could not
make out where they came from. So all of a sudden our officer gave
us the order to charge. We fixed bayonets and went like fire through
them. You should have seen them run! As the firing line was at full
swing we had with us an officer of the Hussars. I think he was next
to me, and he had his hand nearly blown off by one of the German
shells. So I and two more fellows picked him up and took him to a
place of safety, where he got his wound cared for. I heard afterwards
that he had been sent home, poor fellow: Pte. Levy, Royal Munster
Fusiliers.
Salt and Cigarettes
I am writing this under fire. Every now and again a little message
from the Kaiser comes whizzing in this direction, but no damage is
being done, and we don’t worry. Bang! Another message. One of the
things I miss more than anything else is a drop of milk for tea.
Would give 2s. for a tin of condensed milk. Of course, most of the
cattle are moved miles away from any battlefield, and consequently
no milk can be obtained. There is plenty of fruit and vegetables. But
now and again we run short of certain things. For instance, to-day
we have run short of salt, and consequently our dinner was not
quite the success I anticipated. We made a stew—1½ lb. of corned
49.
beef, potatoes, beans,carrots, and pumpkin. This did for three men.
I was the cook. To-night for tea we are having bread, bacon, jam,
and cheese; but, sad to relate, I have no cigarettes: Private W.
Rouse.
Like an Electric Shock
I got five or six bullets in my right thigh. The actual wounding was
not very painful—like an electric shock. I fired for over an hour
afterwards, then crept to an old barn, where my wounds were
dressed. There we had to stay two days under shell-fire. Then they
started smashing the place up with shrapnel, knocking the roof on
the top of us—without hurting us. We were dragged out. It was
night before we could be taken in farm carts to the field hospital. On
Sunday the “dirty pigs” shelled that, though the Red Cross flag was
flying. It seems to be a favourite game of theirs. We are well away
from the fighting line now, our only danger being bombs from
airships, which we don’t fear. Our biggest risk now is over-feeding.
We are quartered in the finest hotel in Versailles. Crowds of French
people collect round the gates and send us presents of flowers,
tobacco, and cigarettes, which are very welcome. The people here
think the world of the English “Tommy,” and nothing is too good or
too expensive to give him. All they ask in return is a button or a cap-
badge “to keep as a souvenir of us”: Pte. Graham, Coldstream
Guards.
Given up Worrying
One of the coolest things I have seen—and I have seen a few—was
an Engineer sergeant and two assistants measuring a piece of the
river bank with the tape, and having to lie down every few minutes
to dodge shells or extra-strong volleys. The sergeant could not hear
some of the figures, so yelled out, “Don’t let your voice be drowned
by a ---- German gaspipe.” I assure you that we think no more of
bullets and shells than of a cricket ball sent down by a fast bowler.
50.
In fact, Ihave felt more funk when ---- is in form at the wicket than
I have at a shell. This may sound awful swank, but when you have
lived among shells and bullets for a month it is a case of familiarity
breeding contempt. I believe I am the funkiest, or at any rate the
most careful, chap in the regiment, but I have long since given up
worrying: A Private of the Bedfordshire Regiment.
Safe as Houses
The Germans watched until we halted, and then let fly at us with
some shells. They killed about fifteen and wounded about twenty-
five. One chap was blown to bits; another got one right through his
cheek, and it was terrible to see us after they had bunked. They did
not half let us have it. We all lay flat down on our faces waiting
every moment for our turn to come. I can tell you I thought my last
day had come then. Every time a shell comes it makes a whistle and
then a bang, and not half a bang, too. I can tell you it was a relief to
everybody, and they would sigh after a bang if not hit. They must
have thought we had all gone or been killed or wounded because
they stopped for a bit, and then we started to dig ourselves in. Of
course we had to dig deep and well underground so as to be out of
shell reach. We did not get any more that day, but the next morning
they let us know it was time to get up with some of their heavy gun
shells. We only got four wounded then, but I can tell you I thought I
had got hit. One dropped about fifteen yards in front of my trench,
and it lifted me up and dropped me with such a bang that I thought
I was counted out. I felt all over me to see what I had got, but no, I
am as safe as houses yet: Sergt. T. L. Neal, King’s Own Yorkshire
Light Infantry.
Stunned!
What gets at you is not being able to come to close quarters and
fight man to man. As a fact we see very little of the enemy, but
blaze away at the given range and trust to Providence. For that
51.
matter, we seevery little of our own fellows, and only know by the
ambulance men passing through our lines what regiments are near
us. For hours we stick on one spot and see nothing but smoke and
something like a football crowd swaying half a mile off. We see all
we want of the German flying machines. They are over our lines day
and night, and are so common that we do not now take pot-shots at
them. The chances of hitting them are about 100 to 1. We hate
them, because we know they are signalling the position and range to
their artillery, which is awful. The German rifle fire wouldn’t worry a
covey of partridges, but their shells are hell. I was stunned by one a
week ago. It was a queer feeling, and rather pleasant than
otherwise. It fell about six yards in front of me, and I felt as if a rush
of lime-kiln gas had hit me. I fell forward, and was carried to the
rear, but came to in about half an hour, with no hurt whatever,
except that I had a tingling in my nose and eyes, and a bad
headache all day. Other chaps say the feeling is the same: Pte. F.
Burton, Bedfordshire Regiment.
His Fire Baptism!
It was the first time I had been under fire, and for the first ten
minutes I felt a bit nervous, and so, I think, all of us did; but it soon
wore off, and seeing our comrades hit by shell seemed to stiffen us.
We could see the Germans lying in their trenches more than 1000
yards away: we could see their helmets, which showed up like a lot
of mushrooms. While we were still digging our trenches the enemy
began to advance; and some of our cavalry to our rear came
through us to attack the enemy. The Lancers, however, were met by
a tremendous rifle and machine-gun fire, and mown down; and they
retired through us, followed by the Germans, who came on yelling
with fixed bayonets. The regiment who were next us on our right
digging themselves in, got caught, I fancy, for I saw some of their
men tumbling out of their half-finished trenches in their shirt-sleeves
without their rifles. We were ordered out of our trenches to meet the
advancing Germans, who, firing from the hip, and with fiendish yells,
52.
were evidently intendingto rush us. They were coming on in dense
blocks—blocks which were probably companies—in échelon, but
when they saw us come out of our trenches with our bayonets fixed
they didn’t like it, and most of them turned and ran. Some of them,
however, came on, and I saw one man single me out and come for
me with his bayonet. He made a lunge at my chest, and, as I
guarded, his bayonet glanced aside and wounded me in the hip; but
I managed to jab him in the left arm and get him on the ground,
and when he was there I hammered him on the head with the butt-
end of my rifle. I think I had become a bit dazed, for I did not see
my battalion, only a few dead and wounded lying on the ground: A
Private of the Yorks Light Infantry.
Smoke—and Fire!
We got down a slope in some way, and thought we were practically
safe. In fact, I stopped behind the rest to light my pipe, when
suddenly from a wood on our right a terrible rifle and machine-gun
fire opened; I couldn’t for the moment realize what had happened,
but when I saw our chaps dropping (whether shot or taking cover I
couldn’t then tell), I thought it was time for yours truly to drop,
which I promptly did. I was, however, all on my own, down among
some young cabbage plants, and I couldn’t see a soul. Bullets hit up
the earth in my face, and the cabbage leaves were perforated in no
time. I started to bang away at the enemy for all I was worth, and
continued till I had only five cartridges left. I resolved to save these,
and expected every moment for the enemy to charge. I am utterly
unable to describe my feelings, but you can take it from me I
thought my last moment had arrived. It seemed impossible I could
be missed by that stream of Maxim fire, but at last, thank goodness!
a British battery noticed our predicament. They galloped into
position and fired from behind us. The noise of their first shell
seemed like a voice from heaven, and as they got range and poured
in more shells, the German fire slackened. Then I caught sight of
some of our chaps racing for a ditch to my left. I made up my mind
53.
to chance it.I sprang up, grabbed my things, and raced for my life. I
reached that ditch on the point of exhaustion and fell into a foot of
mud and water. What a relief! One of our chaps had been shot dead
in the ditch. With three or four others I crawled about two hundred
yards till we gained the roadside and temporary safety: Sapper Clift,
Royal Engineers.
“Punched!”
I felt as if someone had punched me in the back. A regular Jack
Johnson it was, and I went flat on the ground. There I lay for about
twelve hours. Then an officer came by and wanted to know where I
was hit. I told him, and he said the best thing I could do was to lay
there for a bit. Then I found that there was a man on each side of
me, quite dead, so I felt quite comfortable with them. Night fell and
I must have dozed off, for when I woke up it was stone dark, and I
could hear the wounded Germans crying out in agony. I felt like it
myself, for I had been lying on my stomach all the time, and it never
stopped raining. I happened to raise my head, and I saw a large fire
about 500 yards away, and I thought if I could get beside it I should
feel better. I tried to get up, but I could not. In the end I had to
crawl over the dead body on my right, and I crawled on my stomach
for 500 yards till I came to the fire. When I got there I must have
fainted, for when I came round it was just getting light. Then I
heard voices. I called as much as I could, and they heard me. I saw
it was the Northampton outpost. I had nearly gone off again when
they picked me up. When they moved me I knew the bullet had
gone through my lung. They took me to the hospital and dressed my
wound: Pte. H. L. Hook, Royal Sussex Regiment.
54.
IX. CORNERS INTHE FIGHT
Deeds
Above heroic, though in secret done,
And unrecorded left through many an age.
Milton’s “Paradise Regained.”
Who, doomed to go in company with pain,
And fear, and bloodshed, miserable train!
Turns his necessity to glorious gain;
This is the happy warrior; this is he
Whom every man in arms should wish to be.
Wordsworth’s “Character of the
Happy Warrior.”
An amusing thing was to hear an officer of the Royal Irish shouting
at the top of his voice, “Give ’em hell, boys, give ’em hell!” He was
already wounded in the back by a lump of shrapnel, but it was a
treat to hear him shouting: Pte. R. Toomey, Royal Army Medical
Corps.
Footsore
I pinched a German’s “bike” and tried to escape, but could not. So
some Belgian people gave me civilian clothes, and a Belgian soldier,
also a prisoner, helped me through the German patrols, and by a
55.
miracle I escaped.I am footsore with walking in a pair of boots
three sizes too big for me: Pte. V. Cohen, R.A.M.C.
Couldn’t Miss
The Germans rushed at us like a crowd streaming from a cup-tie at
the Crystal Palace. You could not miss them. Our bullets ploughed
into them, but still on they came. I was well entrenched, and my
rifle got so hot I could hardly hold it. I was wondering if I should
have enough bullets when a pal shouted, “Up, Guards, and at them!”
The next second he was bowled over with a nasty knock on the
shoulder. He jumped and hissed, “Let me get at them”: Private
Whittaker.
What Ho!
When we copped the German infantry without their artillery we gave
them “What Ho!” Our boys were fine marching on, or in the firing
line, always happy. One night in the trenches, waiting for the
Germans, they were singing “It’s a long way to Tipperary” and “Sing
something Irish to me,” but it was not long when the German
artillery sang “Get out and get under.” They sent some “humming
birds”—I mean shells—over to us and spoiled our concert: Private P.
McGrath.
Grand Fighting
We saw some grand fighting between our aeroplanes and theirs. You
could see them circle round each other like a couple of fighting
cocks—and then one would come down. One aeroplane was brought
down with our guns. We had had several pot-shots at it, but they did
not take effect. The first shot from one of our aerial guns brought it
down, a mass of blazing wreckage. We were told afterwards that the
56.
airman got awayand was unhurt: Pte. J. Doolan, Northumberland
Fusiliers.
Swept Away
Near to Cambrai one of our cavalry regiments ran full tilt into a
battalion of German infantry. They flung down their rifles and ran for
all they were worth, with the exception of one company, whose
officers commanded them to stand. They faced round without
attempting to fire a shot, and stood there like statues to receive the
onslaught of our men. Our lads were bound to admire their iron
discipline, but you can’t make way for sentiment in war, and our men
rode straight at them with the lance. They were swept away, and
our fellows took most of the unwounded ones prisoners: Trooper E.
Tugwell.
Giving a Hand
I have to go right up to the firing line, and when I arrive there I
have to give a hand at serving the guns. It is dangerous work, but
we don’t look at it from that standpoint: we only look to make the
enemy run. At the first battle in which the British were engaged I
got a flesh wound, but was very thankful it was nothing worse, as
scores of my comrades were falling all round me. One of our
gunners was so anxious to see the enemy that he jumped up to
look, and got part of his leg shot away as a result: A Salvationist
serving as a Royal Field Artillery Motorman.
Came Down Dead!
I saw a fine “scrap” in the air between a British and a German
aeroplane. The British airman can move about quicker and has a
much greater speed. This is partly due to the fact that the German
machines are armoured underneath. The English airman got above
57.
the German, andthey had a fight for about a quarter of an hour. Our
man emptied his revolver into the German, who kept trying to get
out of his way, but could not owing to the Englishman’s speed. The
German then seemed to plane down in good order, but when he got
to the ground he was dead: Pte. Herman, King’s Royal Rifles.
Fisticuffs
I was in South Africa, and that was a jolly beanfeast to what this is.
I have been all day soaked to the skin, standing knee-deep in water.
Sometimes all is quiet, then shot and shell come down like rain and
men drop out all around one; but we English Tommies know how to
shoot, and that is more than the Uhlan does. We came to fists with
them once, and we know more about that also. I downed three with
my fist, and I believe I stuck four with my bayonet before I got shot.
Our officers are simply grand. They work with us, and one pulled me
out of the trench when I was wounded and carried me a little way
back: Pte. J. Hesselop, Essex Regiment.
Not to be Shot
I got hit by three bullets in about a minute. One went through my
cap, one smashed the magazine of my rifle, and one flattened five
rounds of ammunition in my belt. Nearly all my company wanted to
shake hands with me, telling me that I am the luckiest man in the
war. I think it was a record myself. They wanted to keep the cap,
ammunition, and magazine, but I am keeping them myself to show
you when I come home. So you see I am not to be shot with rifle
bullets. At least, that is what they say here, and I think so myself:
Pte. W. Hinton, 1st East Lancashire Regiment.
Promoted Corporal
58.
There is onething I am glad to say, that I have fulfilled my
undertaking by killing I don’t know how many Germans, as they fell
before me like broken eggs. I was promoted to full corporal for
sticking it out in my blockhouse for seventy-three hours without
anything to eat or drink, only firing away all the time at the savages,
as this is what I call them. I was given a hearty cheer when the
General shook hands with me and congratulated me on my pluck,
and not forgetting the men that were with me in the blockhouse.
There were four killed and myself and two more wounded—seven
altogether, so I will say no more, but will write again soon. Give my
love to all. Good-bye, from your loving son, Bert: Corporal B. L.
Prince.
Uhlans or Hussars
Now, directly we see the Uhlans or the Prussian Hussars we make
for them. We have galloped for a mile to get at them. Once they
drew us on to the fire of their infantry. We were only two hundred
yards away when they fired on us, but at the pace we were going
very few were hit. At one time we were in line, and then in échelon,
and after a short hand-to-hand fight many surrendered, whilst
others made off, the machine guns accounting for many. The
German cavalry have excellent mounts, and the horses appear to be
well trained. Somehow the men haven’t got the same grit as our
chaps. When they hear our yells as we get into the stride, and they
see the glint of our swords, they turn pale, and if it wasn’t for their
officers they would bolt each time: A Cavalryman of General de
Lisle’s Brigade.
Soon be Better
I was in the firing line, and my mate next to me had one of his
fingers shot off and a bullet through his head. How I got hit, I was
bandaging his head up. I was caught in the neck just below the jaw,
and the bullet came out of my mouth. It knocked all my teeth out on
59.
Welcome to ourwebsite – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
ebookmasss.com