You are on page 1of 53

Practical guide to Oracle SQL, T-SQL

and MySQL 1st Edition Preston Zhang


Visit to download the full and correct content document:
https://textbookfull.com/product/practical-guide-to-oracle-sql-t-sql-and-mysql-1st-editi
on-preston-zhang/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Practical Guide to Large Database Migration Preston


Zhang

https://textbookfull.com/product/practical-guide-to-large-
database-migration-preston-zhang/

Oracle SQL tuning with Oracle SQLTXPLAIN: Oracle


database 12c edition Charalambides

https://textbookfull.com/product/oracle-sql-tuning-with-oracle-
sqltxplain-oracle-database-12c-edition-charalambides/

Study Guide for 1Z0 071 Oracle Database 12c SQL Oracle
Certification Prep 1st Edition Matthew Morris

https://textbookfull.com/product/study-guide-for-1z0-071-oracle-
database-12c-sql-oracle-certification-prep-1st-edition-matthew-
morris/

OCA Oracle Database SQL Exam Guide (Exam 1Z0-071) 1st


Edition Steve O’Hearn

https://textbookfull.com/product/oca-oracle-database-sql-exam-
guide-exam-1z0-071-1st-edition-steve-ohearn/
Practical SQL 1st Edition Anthony Debarros

https://textbookfull.com/product/practical-sql-1st-edition-
anthony-debarros/

SQL QuickStart Guide The Simplified Beginner s Guide to


Managing Analyzing and Manipulating Data With SQL 1st
Edition Shields

https://textbookfull.com/product/sql-quickstart-guide-the-
simplified-beginner-s-guide-to-managing-analyzing-and-
manipulating-data-with-sql-1st-edition-shields/

T SQL Fundamentals Itzik Ben-Gan

https://textbookfull.com/product/t-sql-fundamentals-itzik-ben-
gan/

Practical SQL A Beginner s Guide to Storytelling with


Data 1st Edition Anthony Debarros

https://textbookfull.com/product/practical-sql-a-beginner-s-
guide-to-storytelling-with-data-1st-edition-anthony-debarros/

Practical SQL A Beginner s Guide to Storytelling with


Data 1st Edition Anthony Debarros

https://textbookfull.com/product/practical-sql-a-beginner-s-
guide-to-storytelling-with-data-1st-edition-anthony-debarros-2/
Practical Guide to
Oracle SQL,
T-SQL and MySQL
Practical Guide to
Oracle SQL,
T-SQL and MySQL
Preston Zhang

p,
p,
A SCIENCE PUBLISHERS BOOK
A SCIENCE PUBLISHERS BOOK
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742

© 2017 by Taylor & Francis Group, LLC


CRC Press is an imprint of Taylor & Francis Group, an Informa business
Taylor & Francis Group
No
6000claim to original
Broken U.S. Government
Sound Parkway NW, Suiteworks
300
Boca Raton, FL 33487-2742
Printed on acid-free paper
© 2017 by
2018
Version Taylor
Date: & Francis Group, LLC
20170119
CRC Press is an imprint of Taylor & Francis Group, an Informa business
International Standard Book Number-13: 978-1-4987-4799-8 (Hardback)
No claim to original U.S. Government works
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been
Printed
made toon acid-free
publish paperdata and information, but the author and publisher cannot assume responsibility for the
reliable
Version
validity Date:
of all 20170119
20170908
materials or the consequences of their use. The authors and publishers have attempted to trace the
copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to
International
publish in thisStandard
form hasBook Number-13:
not been 978-1-4987-4799-8
obtained. If any copyright(Hardback)
978-1-1381-0518-8 material has not been acknowledged please write and let
us know so we may rectify in any future reprint.
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been
made
Excepttoaspublish reliable
permitted data
under andCopyright
U.S. information,
Law,butno the
partauthor
of thisand
bookpublisher
may becannot assume
reprinted, responsibility
reproduced, for the
transmitted,
validity of all
or utilized materials
in any or any
form by the consequences of their use.
electronic, mechanical, or The
otherauthors
means,andnowpublishers
known orhave attempted
hereafter to trace
invented, the
includ-
copyright holders of
ing photocopying, all material reproduced
microfilming, in this
and recording, publication
or in and apologize
any information storagetoorcopyright holders without
retrieval system, if permission to
written
publish in this
permission fromform
thehas not been obtained. If any copyright material has not been acknowledged please write and let
publishers.
us know so we may rectify in any future reprint.
For permission to photocopy or use material electronically from this work, please access www.copyright.com
Except as permitted under U.S.
(http://www.copyright.com/) Copyright
or contact the Law, no part
Copyright of this book
Clearance may
Center, be(CCC),
Inc. reprinted, reproduced,
222 Rosewood transmitted,
Drive, Danvers,
or
MAutilized
01923, in any form by CCC
978-750-8400. any electronic, mechanical,
is a not-for-profit or otherthat
organization means, now known
provides licensesorand
hereafter invented,
registration for a includ-
variety
ing photocopying,
of users. microfilming,
For organizations and been
that have recording,
granted or ainphotocopy
any information
licensestorage
by the or retrieval
CCC, system,
a separate without
system written
of payment
permission from the publishers.
has been arranged.

For permission
Trademark to photocopy
Notice: Product or or use material
corporate nameselectronically from or
may be trademarks this work, please
registered access and
trademarks, www.copyright.com
are used only for
(http://www.copyright.com/)
identification and explanationorwithout
contactintent
the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers,
to infringe.
MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety
of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment
has been arranged. Library of Congress Cataloging‑in‑Publication Data

Trademark Names: Liu,Product


Notice: Jian (Chemical engineer),
or corporate nameseditor.
may be| Jiang, San Ping,
trademarks editor. trademarks, and are used only for
or registered
Title: Mesoporous materials for advanced
identification and explanation without intent to infringe. energy storage and conversion
technologies / editors, Jian Liu, Department of Chemical Engineering,
Faculty of Science and Engineering, Curtin University, Perth, WA,
Library ofSan
Australia, Congress Cataloging-in-Publication
Library
Ping Jiang, Fuelsof Congress Data Institute &
and EnergyCataloging‑in‑Publication
Technology Data
Department of Chemical Engineering, Curtin University, Perth, WA,
Names:
Names:
Australia.Liu, Jian (Chemical
Zhang, engineer), editor. | Jiang, San Ping, editor.
Preston, author.
Title:
Title:Mesoporous
Description:
Practical materials
Bocaguide
Raton,to FL :for
OracleCRCadvanced
Press,
SQL, energy
Taylor
T-SQL &storage
and Francis
MySQL and conversion
Group, 2017.
/ Preston |
Zhang,
technologies
Series:
database /administrator,
A scienceeditors, Jian Liu,
publishers book Department
| Includes
University of Chemical
bibliographical
of Georgia, Engineering,
references
Watkinsville, Georgia, USA.
Faculty
and of Science
index.
Description: Bocaand Engineering,
Raton : CRC Press,Curtin University,
[2017] Perth, publishers
| "A science WA, book." |
Australia,
Identifiers: San Ping2016042509|
Jiang, Fuels and Energy Technology Institute &
IncludesLCCN ISBN
bibliographical references 9781498747998
and index. (hardback : alk. paper) |
Department of Chemical
ISBN 9781498748018 (e-book) Engineering, Curtin University, Perth, WA,
Identifiers: LCCN 2017040116 | ISBN 9781138105188 (hardback : alk. paper)
Australia.
Subjects: LCSH: Electric batteries--Materials. | Fuel cells--Materials. |
Subjects: LCSH:
Description: SQL (Computer
Boca Raton, program
FL : CRC Press, language)
Taylor & Francis | Oracle
Group,(Computer
2017. | file)
Solar cells--Materials. | Mesoporous materials.
Classification:
Series: A science
Classification: LCC
LCC QA76.73.S67
publishers
TK2901 book
.M47|2017 Z54| DDC
2017
Includes | DDC 005.75/6--dc23
bibliographical references
621.31/24240284--dc23
LCrecord
and
LC record
index. available
available at https://lccn.loc.gov/2017040116
at https://lccn.loc.gov/2016042509
Identifiers: LCCN 2016042509| ISBN 9781498747998 (hardback : alk. paper) |
ISBN 9781498748018 (e-book)
Visit the Subjects:
Taylor & LCSH:
FrancisElectric
Web sitebatteries--Materials.
at | Fuel cells--Materials. |
Solar cells--Materials. | Mesoporous materials.
http://www.taylorandfrancis.com
Classification: LCC TK2901 .M47 2017 | DDC 621.31/24240284--dc23
and the CRC Press available
LC record Web site atathttps://lccn.loc.gov/2016042509
http://www.crcpress.com

Visit the Taylor & Francis Web site at


http://www.taylorandfrancis.com

and the CRC Press Web site at


http://www.crcpress.com
Preface

Databases are used everywhere. They effect on our daily lives widely. Online business
companies use databases to store critical data for their products and users; Doctor offices
use databases to keep patient, pharmacy and insurance information; Banks use databases
to track millions of financial transactions.
Relational database management systems (RDBMS) have become the standard database
type from 1980s. The most popular relational database management systems in the
world are Oracle, SQL Server and MySQL. To get data or manipulate data from database
systems developers and database administrators use Structured Query Language (SQL).
I have worked on Web applications using Oracle and MySQL databases on the backend.
In order to display important data I write SQL statements to access databases in php or
other development tools. I also use SQL to create databases or update database structures.
SQL is so powerful that I can process millions of records in few seconds.
As a database administrator I have been working on Oracle, SQL Server and MySQL
for decades. Although the basic SQL statements for Oracle SQL, SQL Server T-SQL and
MySQL are similar to each other, some functions and styles are quite different. I often
need to work with different database systems at the same time and it takes time for me to
check SQL syntax for the three database systems. There are a lot of SQL books available in
the market, but it is very hard to find a practical SQL book that comparing the differences
between the three major database systems. That’s why I want to write this reference book
with step by step examples in the real working environment.
I hope that this book can be a quick reference book for Oracle SQL, SQL Server T-SQL and
MySQL.

Why Learn SQL?


• SQL is one of the most desirable programming skills
• SQL is used by all types of career fields
• You can use SQL to ask questions about your business
• You can get useful business reports from SQL statements
• You can manipulate millions of records in seconds
• You can import data to a database
• You can export data from a database
• You can embed SQL statements to other programming languages
vi Preface

Who This Book Is For


This book is for beginning and intermediate SQL developers, database administrators,
database programmers and students. It starts from database concepts, installation of
database management systems, database creation and datatypes. It introduces basic and
advanced SQL syntax with side by side examples in Oracle SQL, T-SQL and MySQL. The
SQL code in this book is fully tested in Oracle 12c, SQL Server 2012 and MySQL 5.7.

How to Use This Book


To run the examples from this book you need to install the following database systems and
development tools:
Oracle 11g or 12c
Oracle SQL Developer
SQL Server 2012 or above
SQL Server Management Studio 2012 or above
MySQL Server 5.7
MySQL Workbench 6.3
All of the above software can be download from Oracle.com and Microsoft.com

Acknowledge
I wish to express appreciation to the Science Publisher editors who have been supporting
this book from the beginning and made this book a reality.
My deepest expression of gratefulness goes to my mom who has been learning for 30 years
after her retirement.
Contents

Preface v
Chapter 1 Introduction to SQL and Relational Databases 1
Brief History of SQL and Relational Databases 2
SQL Standards 2
Oracle, SQL Server and MySQL Versions 3
Relational Database Basic Concepts 3
Constraints 7
Data Integrity 7
Types of Relationships 8
One-to-Many Relationships 8
Many-to-Many Relationships 9
One-to-One Relationships 9
Self-Referencing Relationships 9
Summary 10
Chapter 2 Data Types 11
Character Data Types 11
Number Data Types 12
Date and Time Data Types 13
Boolean Data Type 14
Summary 14
Chapter 3 Installation of Oracle, SQL Server and MySQL 15
Minimum System Requirements 15
Installation of Oracle 12c 16
Installation of SQL Server 2016 20
Installation of MySQL Server 5.7 26
Summary 32
Exercise 33
Chapter 4 Database Development Tools 34
Command Line Tools 34
Oracle SQL Plus 34
MySQL Command Line Client 36
Installation of Oracle SQL Developer 4.3 38
Installation of SQL Management Studio 2016 40
Installation of MySQL Workbench 6.3 43
Summary 46
Exercise 46
viii Contents

Chapter 5 Data Definition Language (DDL) 47


Data Definition Language Statements 47
Using SQL Commands to Create a Database 48
Using GUI Tools to Create a Database 49
Using SQL Commands to Create a Table 51
Using GUI Tools to Create a Table 54
Using Data from an Existing Table to Create a Table 56
Renaming a Table 58
Truncating a Table 61
Altering a Table 61
Summary 64
Exercises 64
Chapter 6 Data Manipulation Language (DML) 65
Data Manipulation Language Statements 65
INSERT INTO Statement 65
SELECT Statements 72
DISTINCT Clause 73
WHERE Clause 74
Arithmetic Operators 74
Order of Arithmetic Operators 76
Comparison Operators 76
AND Condition 77
OR Condition 77
IN Condition 78
BETWEEN Condition 79
IS NULL Condition 79
IS NOT NULL Condition 80
LIKE Condition 81
ORDER BY Clause 82
ALIASES 84
INSERT Multiple Records into an Existing Table 85
UPDATE Statement 86
DELETE Statement 86
Data Control Language 87
Summary 87
Exercises 87
Chapter 7 Aggregate Functions and GROUP BY Clause 89
Aggregate Functions 89
AVG ( ) 90
COUNT ( ) 90
MIN ( ) 91
MAX ( ) 92
SUM ( ) 93
GROUP BY and HAVING Clause 94
GOUNP BY with AVG ( ) Function 94
GROUP BY with COUNT ( ) Function 95
Contents ix

GROUP BY with HAVING Example 96


Summary 97
Exercises 97
Chapter 8 Functions 98
Common Number Functions 98
CEIL ( ) 98
CEILING ( ) 98
FLOOR ( ) 99
GREATEST ( ) 99
LEAST ( ) 100
MOD ( ) 100
POWER ( ) 101
ROUND ( ) 101
SQRT ( ) 102
TRUNC ( ) 102
Common String Functions 103
CONCAT ( ) 104
FORMAT ( ) 106
LEFT ( ) 106
INITCAP ( ) 106
LENGTH ( ) 107
LEN ( ) 107
LOWER ( ) 108
LPAD ( ) 108
LTRIM ( ) 109
REPLACE ( ) 109
RIGHT ( ) 110
RPAD ( ) 110
RTRIM ( ) 111
SUBSTR ( ) 111
SUBSTRING ( ) 111
UPPER ( ) 112
Common Date and time Functions 113
CURRENT_TIMESTAMP 113
ADD_MONTHS ( ) 114
DATEADD ( ) 114
DATE_ADD ( ) 114
EXTRACT ( ) 114
DATEPART ( ) 114
CURRENT_DATE 115
GETDATE ( ) 115
CURRENT_DATE ( ) 115
MONTHS_BETWEEN ( ) 115
DATEDIFF ( ) 116
PERIOD_DIFF ( ) 116
SYSDATE 116
SYSDATETIME ( ) 116
SYSDATE ( ) 116
x Contents

Conversion Functions 116


CAST ( ) 117
TO_DATE 117
CONVERT ( ) 118
STR_TO_DATE ( ) 119
Summary 120
Exercises 121
Chapter 9 Advanced SQL 122
Advanced SQL Statements 123
Union 123
Union All 124
INTERSECT 124
EXCEPT 125
MINUS 125
ROWNUM 126
TOP 126
LIMIT 126
Subquery 128
CASE 130
SEQUENCE 132
IDENTITY 132
AUTO_INCREMENT 132
Summary 136
Exercises 136
Chapter 10 Joins 137
INNER JOIN 137
JOIN with USING Clause 138
Joining with Multiple Tables 141
LEFT JOIN 142
RIGHT JOIN 142
FULL JOIN 142
Summary 144
Exercise 145
Chapter 11 Views 146
Creating Views in Oracle 146
Creating Views in T-SQL 149
Creating Views in MySQL 151
Updating Views 153
Summary 154
Exercise 154
Chapter 12 Data Import and Export 155
Oracle Data Export from Query Results 155
SQL Server Data Export from Query Results 157
MySQL Data Export from Query Results 159
Oracle Data Import Tool 161
Contents xi

SQL Server Data Import Tool 166


MySQL Data Import Tool 171
Summary 174
Exercise 174
Chapter 13 Stored Procedures 175
Steps to Create an Oracle Stored Procedure 175
Steps to Create a SQL Server Stored Procedure 176
Steps to Create a MySQL Stored Procedure 177
A Stored Procedure with Parameters 178
Summary 182
Exercise 183
Index 185
About the Author 189
Chapter 1

Introduction to SQL and


Relational Databases

Relational database management systems (RDBMS) have become the standard database
type for various industries since the 1980s. These systems allow the users to store data and
access data in graphic user interfaces. It also allows users to set security rules.
Structured Query Language (SQL) is a standard computer language for relational database
management systems. SQL has different dialects. For example, Oracle SQL is called
PL/SQL, MS SQL Server SQL is called T-SQL (Transact-SQL).
SQL is a very useful tool for database developers and database administrators. Database
developers use SQL to select, insert, and update data. Database administrators (DBAs)
apply their SQL skills to support Oracle, SQL Server, MySQL and other database systems.
The highlights of this chapter include
• Brief History of SQL and Database Systems
• SQL Standards
• Oracle, SQL Server and MySQL Versions
• Introduction to RDBMSs
• Relational Database Basic Concepts
• Entity Relational Diagram Used in This Book
2 Chapter 1 Introduction to SQL and Relational Databases

Brief History of SQL and Database Systems

Table 1.1 History of SQL and Database Systems

Year SQL and Database Development

1970 to 1972 Dr. E.F. Codd in IBM introduced in his paper the term “A Relational Model of Data for
Large Shared Data Banks”. In the paper he defined RDBMs by Codd’s 12 rules.

1970s Ingres and System R were created at IBM San Jose. System R used the SEQUEL query
language. The development of SQL/DS, DB2, and Oracle were based on the SEQUEL
query language.

1976 Dr. Peter Chen developed the entity-relationship model. This model becomes the
foundation of many systems analysis and design methods.

1980s Structured Query Language became the standard query language. Computer sales
increased rapidly. Relational database systems became a commercial success. IBM’s DB2
and IBM PC resulted in the launches of many new developments of database systems
such as PARADOX, dBase III and IV.

1990s Successful Online businesses let to demand for database accessing tools. MySQL and
Apache became open source solution for the Internet. Application development tools
including Oracle Developer, Power Builder, and Visual Basic were released.

2000s The three leading relational database systems in the world are Oracle, Microsoft SQL
Server and MySQL.

SQL Standards
Table 1.2 SQL Standards

Year SQL Standard

1974 Original SQL (SEQUEL)

1986 SQL became a standard by ANSI (American National Standards Institute) and ISO
(International Standards Organization)

SQL/96 Major modification (ISO 9075)

SQL/99 Added many features including recursive queries, triggers, procedural and control-of-flow
statements, and some object-oriented structures

SQL/2003 Introduced XML-related features

SQL/2006 Defined ways for importing and storing XML data in database

SQL/2008 Added TRUNCATE TABLE statement and INSTEAD OF triggers


Chapter 1 Introduction to SQL and Relational Databases 3

Oracle, SQL Server and MySQL Versions

Table 1.3 Different versions for the three database systems

Oracle SQL Server MySQL

1979–Oracle 2 1989–SQL Server 1.0 1995–First Release

1983–Oracle 3 1991–SQL Server 1.1 1996–MySQL 3.19

1984–Oracle 4 1993–SQL Server 4.21 1997–MySQL 3.20

1985–Oracle 5 1995–SQL Server 6.0 1998–MySQL 3.21

1988–Oracle 6 1996–SQL Server 6.5 2000–MySQL 3.23

1992–Oracle 7 1998–SQL Server 7.0 2002–MySQL 4.0

1997–Oracle 8 2000–SQL Server 2000 2003–MySQL 4.01

1998–Oracle 8i 2005–SQL Server 2005 2004–MySQL 4.1

2001–Oracle 9i 2008–SQL Server 2008 2005–MySQL 5.0

2003–Oracle 10g 2010–SQL Server 2008 R2 2010–MySQL 5.5

2007–Oracle 11g 2012–SQL Server 2012 2013–MySQL 5.6

2013–Oracle 12C 2014–SQL Server 2014 2015–MySQL 5.7

2016–SQL Server 2016 2016–MySQL 8.0

Relational Database Basic Concepts


▪ Databases
Relational Database Management System consists of one or more databases.
For example, the following SQL Server has HR and Sample databases.

Figure 1.1 Database examples


4 Chapter 1 Introduction to SQL and Relational Databases

▪ Entity
Entity is any person, place, or thing that the data can represent in a database design. For
example, Employees and Departments are entities. Entities are converted to tables at the
physical design stage.

▪ Data Type
SQL developers need to choose a data type for each column when creating a table. The
common data types are boolean, integer, float, currency, string, date and time.

▪ DDL
DDL stands for Data Definition Language. DDL commands can be used to create, modify
database structures. Sample DDL commands are CREATE, ALTER and DROP.

▪ DML
DML stands for Data Manipulation Language. DML commands can be used to insert
data into database tables, retrieve or modify data, deleting data in database. Sample DML
commands are INSERT, DELETE and UPDATE.

▪ DCL
DCL stands for Data Control Language. DCL commands can be used to create rights and
permissions. Sample DCL commands are GRANT and REVOKE.

▪ Query
SQL developers can use a query to get data or information from one or more database
tables.

Attributes
Entity has its own attributes. For example, an Employee entity may have name, email,
phone and salary as attributes.

Types of Attributes
Simple attribute—An attribute that cannot be divided into subparts. For example, an
employee’s age is a simple attribute.
Composite attribute—An attribute that can be divided into simple attributes. For example,
an employee’s name has First_Name and Last_Name.
Derived attribute—An attribute whose value can be derived (calculated) from other
attribute. For example, Average_Age for employees can be calculated.
Chapter 1 Introduction to SQL and Relational Databases 5

Single-value attribute—An attribute contains a single value. For example, City or State.
Multi-value attribute—An attribute have more than one values. For example, an employee
can have more than one skills.

Tables
Each database contains collection of tables.
For example, the HR databases has country, customer, departments, employees, job and
locations tables.

Figure 1.2 Table examples

▪ Fields (Columns)
Each table consists of smaller entities called fields or columns.
For example, The Country table has three fields (columns): Country_ID, Country_Name
and Region_ID.
6 Chapter 1 Introduction to SQL and Relational Databases

▪ Records (Rows)
Each table consists of one or more records (rows).
For example, the COUNTRY table has the following rows:

Figure 1.3 Record examples

▪ Primary Key
Each table can have only one primary key.
For example, the COUNTRY table has a primary key COUNTRY_ID.

▪ Foreign Key
Database tables might be related by (foreign key) common column(s).
For example, Location_ID is the common column for Departments and Locations tables.

Figure 1.4 Foreign key example


Chapter 1 Introduction to SQL and Relational Databases 7

▪ NULL
Null value is a field with no value. It is different with a zero value and it has been left blank
during record creation.

▪ Constraints
Constraints define rules to restrict what values can be stored in columns. This assurances
the correctness of the data in the database. For example, we can set a primary key for a
table so that there is no duplicated rows in the table.

Common Constraints
• NOT NULL—A column does not accept NULL values.
• DEFAULT—Set a default value to a column when no value is specified to a column.
• UNIQUE—No duplicated values in a column.
• Primary Key—A column or a combination of columns that uniquely defines a row.
The primary key column can not contain a NULL value.
• Foreign Key—A foreign key in one table points to a candidate key in another table.
• CHECK—Check whether the value is valid or not.

▪ Data Integrity
• Entity Integrity—No duplicate records in a table.
• Referential Integrity—Referential integrity is violated when deleting a row that is
referenced by a foreign key in another table.
For example, a user can’t delete the Marketing department from the Departments table,
as there are two employees working for the Marketing department (#20). Deleting the
Marketing department violates the referential integrity rule. See the sample records below:

Figure 1.5 Sample data in Departments table

Figure 1.6 Sample records in Employees table


8 Chapter 1 Introduction to SQL and Relational Databases

Entity Relational Diagram (ERD) Used in This Book

Departments Locations
department_id int PK location_id int PK
department_name text street_address text
manager_id_per_unit decimal(6,0) postal_code text
location_id decimal(4,0) city text
Locations_location_id int FK state_province text
country_id text FK

Employees Country
employee_id int PK country_id int PK
Jobs first_name text country_name text
last_name text region_id int
job_id int PK email text Regions_region_id int FK
job_title text phone_number text
min_salary int job_id text
max_salary int salary decimal(8,2)
manager_id int
department_id int Regions
job_id int FK
department_id int FK region_id int PK
Employees_employee_id int FK region_name text

Figure 1.7 Simplified Oracle HR Schema

Types of Relationships
• One-to-Many Relationships
• Many-to-Many Relationships
• One-to-One Relationships
• Self-Referencing Relationships

One-to-Many Relationships
One-to-Many Relationships define the situation when each row in the table_1 has many
linked rows in table_2. It is the most common type of relationship.
From the Entity Relationship diagram we can see:
The relationship between the Employees and Departments is a one-to-many
relationship. The Dept_ID is the primary key in the Departments table and the foreign
key in the Employees table. One DEPARTMENT_ID can relate to many rows in
the Employees table. One department can have one or many employees; an employee is
assigned to one department.
The relationship between the JOB and Employees is a one-to-many relationship. The
Job_ID is the primary key in the JOB table and the foreign key in the Employees table. One
Job_ID can relate to many rows in the Employees table. One job title can be used for one or
many employees; however, an employee only can have one job title.
Chapter 1 Introduction to SQL and Relational Databases 9

The relationship between the Locations and Departments is a one-to-many relationship.


The Location_ID is the primary key in the Locations table and the foreign key in
the Departments table. One Location_ID can relate to many rows in the Departments table.
One location can have one or many departments; a department only has one location.
The relationship between the Country and Locations is a one-to-many relationship. The
Country_ID is the primary key in the Country table and the foreign key in the Locations
table. One Country_ID can relate to many rows in the Locations table. One country can
have one or many locations (States or Provinces); a location (State or Province) only belongs
to one country.
The relationship between the Regions and Country is a one-to-many relationship. The
Region_ID is the primary key in the Regions table and the foreign key in the Country table.
One Region_ID can relate to many rows in the Country table. One region have one or
many countries; a country only belongs to one region.

Many-to-Many Relationships
A record in table_1 has many matching records in table_2, and a record in table_2 has many
matching records in table_1. For example, an employee may work on one or more projects,
and each project may have one or more employees. In this case, MANY employees are
related to MANY projects.
How can we build many-to-many relationship in a database system? Suppose we have
finished two tables: Employees table and Projects table. We can accomplish many-to-many
relationships by creating two one-to-many relationships and adding a link table between
the two tables. For example, we can create a table “Emp_Project” that has a composite
Primary Key that consists of the two primary keys from the Employees table and Projects
tables. Thus, the two one-to-many relationships are:
1. From Employees table to Emp_Project table: One-to-Many relationships.
2. From Project table to Emp_Project table: One-to-Many relationships.

One-to-One Relationships
One-to-Many Relationships define the situation when one row in table_1 has one linked
row in table_2.
For example, every person has a social security number. We can create a Person table with
name, address, email, phone info and a Person_2 table with social security number. We
link the two tables with a key.

Self-Referencing Relationships
A database model with a relationship to itself.
For example, Adam (Employee_ID 101) has a manager (Manager_ID 109). By linking the
manager ID 109 to Employee_ID 109 we know Adam’s manager is Lex De Hann.
10 Chapter 1 Introduction to SQL and Relational Databases

Figure 1.8 Self-referencing example

Summary
Chapter 1 covers the following:
• Introduction to the brief history of SQL and relational databases.
• Introduction to SQL standards.
• The basic terms of relational database management systems.
• Introduction to Oracle, SQL Server and MySQL versions.
• Displaying sample entity relationship diagram that used in this book.
• Defining one-to-one relationships.
• Defining one-to-many relationships.
• Defining many-to-many relationships.
• Defining self-referencing relationships.
Chapter 2

Data Types

You have learned in Chapter 1 that tables are consisted of many columns. When you design
or modify databases it is very important to understand the different data types. There are
three main data types: Characters, Numbers, and Date/Time.

Character Data Types


Table 2.1 Characters data types for the three database systems

Data Type Oracle SQL SQL SERVER MySQL


Fixed-length CHAR(n) CHAR(n) CHAR(n)
Character Hold up to 2,000 characters Hold up to 8,000 characters Hold up to 255 characters
NCHAR NCHAR(n) NCHAR NCHAR(n)
for any language Hold up to 2,000 characters Hold up to 4,000 characters Hold up to 65,535 characters
variable-length VARCHAR2(n) VARCHAR(n) VARCHAR(n)
character strings Hold up to 8,000 characters
Hold up to 4,000 characters VARCHAR(max) Hold up to 255 characters
Hold up to 1,073 million characters
NVARCHAR2(n) NVARCHAR2(n) NVARCHAR NVARCHAR(n)
for any language Hold up to 4,000 characters
Hold up to 4,000 characters NVARCHAR(max) Hold up to 65,535 characters
Hold up to 536 million characters
TINYTEXT
Hold up to 255 characters
NTEXT LONG TEXT TEXT
for any language Variable width NTEXT
Hold up to 2 GB characters Hold up to 4,000 characters Hold up to 65,535 characters
RAW(n) BINARY(n) MEDIUMTEXT
Binary date Fixed width binary date Hold up to 16 million
Hold up to 2,000 bytes Hold up to 8,000 bytes characters
Character Large CLOB VARBINARY LONGTEXT
Object NCLOB Variable width binary date
NCLOB Hold up to 4G characters Hold up to 8,000 bytes 4G bytes
for any language
Binary Large BLOB VARBINARY(max) LONGBLOB
Object Hold up to 4G characters Variable width; Hold up to 2 GB Hold up to 4,294 million
characters
IMAGE ENUM(a, b, c, …)
Variable width; Hold up to 2 GB List up to 65,535 values
SET
List up to 64 values
12 Chapter 2 Data Types

What is the difference between fixed-length characters and variable-length characters?


Fixed-length characters—When you create a fixed size field, like phone numbers, SSN,
State, CHAR data type is a good choice.
Variable-length characters—Many fields have variable-length characters. When you create
VARCHAR(30) or VARCHAR2(30) for first name field, for example, as first name length is
different for each person you need to use VARCHAR or VARCHAR2 type. If a first name
is “Peter”, only 5 characters are stored in a table (5 bytes), not 30. If we use CHAR(30) for
a first name field, than all the first names will be stored in 30 characters. Obviously, it will
waste a lot of storage spaces.

Number Data Types


Table 2.2 Number data types for the three database systems

Data Type Oracle SQL SQL SERVER MySQL


Small Integer NUMBER (3) TINYINT TINYINT (n)
–128 to 127
0 to 255 0 to 255 0 to 255 UNSIGNED
Median Integer NUMBER (5) SMALLINT SMALLINT (n)
–32,768 to 32767 –32,768 to 32767
0 to 65,535 UNSIGNED
MEDIUMINT (n)
–8,388,608 to 8,388,608
0 to 16,772,215 UNSIGNED
Integer 32 bit NUMBER (10) INT INT (n)
–2,147,483,648 to –2,147,483,647 –2,147,483,648 to –2,147,483,647
UNSIGNED
NUMBER (38) BIGINT BIGINT (n)
–9,223,372,036,854,775,808 to –9,223,372,036,854,775,808 to
9,223,372,036,854,775,807 9,223,372,036,854,775,807
REAL FLOAT (n, d)
Small floating number
Floating number n—maximum of digits
–3.40E + 38 to 3.40E + 38 d—decimal points
SMALLMONEY DOUBLE (n, d)
–214,748.3648 to 214,748.3647 Large floating number
MONEY n—maximum of digits
–922,337,203,685,477.5808 to d—decimal points
922,337,203,685,477.5807
NUMBER (p, s) DECIMAL (p, s) DECIMAL (n, d)
NUMERIC (p, s) NUMERIC (p, s)
–10^38 + 1 to 10^38 – 1 Stored as a string
p from 1 – 38 p from 1 – 38 n—maximum of digits
s from –84 to 127 s from –84 to 127 d—decimal points
Chapter 2 Data Types 13

NUMBER (p, s) (Oracle)


NUMERIC (p, s) (Oracle)
p—precision
s—scale
For example, NUMERIC (5, 2) including 3 digits before the decimal and 2 digits after the
decimal.

DECIMAL (p, s) (T-SQL)


NUMERIC (p, s) (T-SQL)
p—the maximum number of digits that can be stored (including all the digits
from on the left and right of decimal point).
s—the maximum number of digits that can be stored to the right of the decimal
point.

Oracle Number Example


Datatype Input Data Stored Value
NUMBER 634,782.59 634782.59
NUMBER (8) 634,782.59 634783
NUMBER (8, 2) 634,782.59 634782.59
NUMBER (8, 1) 634,782.59 634782.5

Date and Time Data Types

Table 2.3 Date and time data types for the three database systems

Oracle SQL SQL SERVER MySQL


DATE DATE DATE
Format: DD-MON-YY Format: YYYY-MM-DD Format: YYYY-MM-DD
Example: 25-JAN-2017 Example: 2017-01-25 Example: 2017-01-25
TIMESTAMP ( 0 ) SMALLDATETIME DATETIME ()
Format: YYYY-MM-DD HH:MI:SS
If we don’t specify a precision Format: YYYY-MM-DD HH:MI:SS
then the timestamp defaults to DATETIME
six places. Format: YYYY-MM-DD HH:MI:SS
[.mmm]
TIME TIME (p)
HH:MI:SS.0000000 Format: HH:MI:SS
TIMESTAMP (3) TIMESTAMP TIMESTAMP
DD-MM-YY HH:MI:SS Format: YYYY-MM-DD HH:MI:SS Format: YYYY-MM-DD HH:MI:SS
YEAR ( )
Format: YY (70 to 69) 1970 to 2069
YYYY: 1901 to 2155
14 Chapter 2 Data Types

Boolean Data Type


Table 2.4 Boolean data types for the three database systems

Data Type Oracle SQL SQL SERVER MySQL


Boolean CHAR(1) (0 or 1) BIT BOOLEAN, BOOL
0, 1 and NULL 0 or 1; Not NULL

Summary
Chapter 2 covers several data types for the three database systems.
• Character data types
• Number data types
• Date and time data types in the three database systems
• Boolean data type
Although this chapter is short but it takes time to get familiar with all those date types.
When you study Chapter 5 ‘‘Creating Databases and Tables’’ you will use different data
types for columns.
In the next chapter we will install Oracle 12c, SQL Server 2016 and MySQL 5.7 database
systems.
Chapter 3

Installation of Oracle, SQL


Server and MySQL

Before we run SQL commands we need to install relational database management systems.
This chapter covers how to install Oracle 12c, SQL Server 2016 and MySQL 5.7.

Minimum System Requirements


Table 3.1 System requirements

Oracle 12C SQL Server 2016 MySQL 5.7


Hard Disk: 10 GB Hard Disk: 6 GB Hard Disk: 8 GB
A DVD drive is required for
RAM: 2 GB installation from disc. RAM: 2 GB
1 GB of space in the tmp directory. .NET Framework 4.6
Operating System
Recommended RAM
Operating System Express Editions: 1 GB Windows 32-bit and 64-bit
32-bit: All other editions: At least 4 GB
Windows 8 (Pro and Enterprise editions) Processor: x64 Processor Linux
Windows 7 (Professional, Enterprise, Operating System Mac OS X
Ultimate editions) SQL Server Enterprise
Windows Server 2008 Windows Server 2016
Windows Server 2012
64-bit:
Windows 8 (Pro and Enterprise SQL Server Standard
editions) Windows Server 2016
Windows 7 (Professional, Enterprise, Windows Server 2012
Ultimate editions) Windows 10
Windows Server 2012 Windows 8.1
Windows Server 2008 R2
Windows Server 2008 SQL Server Web and Express:
Windows Server 2016
Linux Windows Server 2012

SQL Server Developer:


Windows Server 2016
Windows Server 2012
Windows 10
Windows 8.1
Windows 8
16 Chapter 3 Installation of Oracle, SQL Server and MySQL

Installation of Oracle 12c


• Download Oracle Database 12c Release 2 from the Oracle Web site:
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/
database12c-win64-download-2297732.html

Figure 3.1 Oracle 12c downloads

• After downloading and decompressing Windows x64 files, make sure that two folders
are at the same location:

Figure 3.2 Downloaded files


Another random document with
no related content on Scribd:
THE FREEBOOTER OF LOCHABER.

By Sir Thomas Dick Lauder.

Towards the end of the seventeenth century, there lived a certain


notorious freebooter, in the county of Moray, a native of Lochaber, of
the name of Cameron, but who was better known by his cognomen of
Padrig Mac-an-Ts’agairt, which signifies, “Peter, the Priest’s Son.”
Numerous were the “creachs,” or robberies of cattle on a great scale,
driven by him from Strathspey. But he did not confine his
depredations to that country; for, some time between the years 1690
and 1695, he made a clean sweep of the cattle from the rich pastures
of the Aird, the territory of the Frasers. That he might put his
pursuers on a wrong scent, he did not go directly towards Lochaber,
but, crossing the river Ness at Lochend, he struck over the mountains
of Strathnairn and Strathdearn, and ultimately encamped behind a
hill above Duthel, called, from a copious spring on its summit, Cairn-
an-Sh’uaran, or the Well Hill. But, notwithstanding all his
precautions, the celebrated Simon Lord Lovat, then chief of the
Frasers, discovered his track, and despatched a special messenger to
his father-in-law, Sir Ludovick Grant of Grant, begging his aid in
apprehending Mac-an-Ts’agairt, and recovering the cattle.
It so happened that there lived at this time, on the laird of Grant’s
ground, a man also called Cameron, surnamed Mugach More, of
great strength and undaunted courage; he had six sons and a
stepson, whom his wife, formerly a woman of light character, had
before her marriage with Mugach, and, as they were all brave, Sir
Ludovick applied to them to undertake the recapture of the cattle. Sir
Ludovic was not mistaken in the man. The Mugach no sooner
received his orders, than he armed himself and his little band, and
went in quest of the freebooter, whom he found in the act of cooking
a dinner from part of the spoil. The Mugach called on Padrig and his
men to surrender, and they, though numerous, dreading the well-
known prowess of their adversary, fled to the opposite hills, their
chief threatening bloody vengeance as he went. The Mugach drove
the cattle to a place of safety, and watched them till their owners
came to recover them.
Padrig did not utter his threats without the fullest intention of
carrying them into effect. In the latter end of the following spring, he
visited Strathspey with a strong party, and waylaid the Mugach, as he
and his sons were returning from working at a small patch of land he
had on the brow of a hill, about half-a-mile above his house. Padrig
and his party concealed themselves in a thick covert of underwood,
through which they knew that the Mugach and his sons must pass;
but seeing their intended victims well-armed, the cowardly assassins
lay still in their hiding-place, and allowed them to pass, with the
intention of taking a more favourable opportunity for their purpose.
That very night they surprised and murdered two of the sons, who,
being married, lived in separate houses, at some distance from their
father’s; and, having thus executed so much of their diabolical
purpose, they surrounded the Mugach’s cottage.
No sooner was his dwelling attacked, than the brave Mugach,
immediately guessing who the assailants were, made the best
arrangements for defence that time and circumstances permitted.
The door was the first point attempted; but it was strong, and he and
his four sons placed themselves behind it, determined to do bloody
execution the moment it should be forced. Whilst thus engaged, the
Mugach was startled by a noise above the rafters, and, looking up, he
perceived, in the obscurity, the figure of a man half through a hole in
the wattled roof. Eager to despatch his foe as he entered, he sprang
upon a table, plunged his sword into his body, and down fell—his
stepson, whom he had ever loved and cherished as one of his own
children! The youth had been cutting his way through the roof, with
the intention of attacking Padrig from above, and so creating a
diversion in favour of those who were defending the door. The brave
young man lived no longer than to say, “Dear father, I fear you have
killed me!”
For a moment the Mugach stood petrified with horror and grief,
but rage soon usurped the place of both. “Let me open the door!” he
cried, “and revenge his death, by drenching my sword in the blood of
the villain!” His sons clung around him, to prevent what they
conceived to be madness, and a strong struggle ensued between
desperate bravery and filial duty; whilst the Mugach’s wife stood
gazing on the corpse of her first-born son, in an agony of contending
passions, being ignorant from all she had witnessed but that the
young man’s death had been wilfully wrought by her husband. “Hast
thou forgotten our former days?” cried the wily Padrig, who saw the
whole scene through a crevice in the door. “How often hast thou
undone thy door to me, and wilt thou not open it now, to give me
way to punish him who has, but this moment, so foully slain thy
beloved son?” Ancient recollections, and present affliction, conspired
to twist her to his purpose. The struggle and altercation between the
Mugach and his sons still continued. A frenzy seized on the unhappy
woman; she flew to the door, undid the bolt, and Padrig and his
assassins rushed in.
The infuriated Mugach no sooner beheld his enemy enter, than he
sprang at him like a tiger, grasped him by the throat, and dashed him
to the ground. Already was his vigorous sword-arm drawn back, and
his broad claymore was about to find a passage to the traitor’s heart,
when his faithless wife, coming behind him, threw over it a large
canvas winnowing-sheet, and, before he could extricate the blade
from the numerous folds, Padrig’s weapon was reeking in the best
heart’s-blood of the bravest Highlander that Strathspey could boast
of. His four sons, who had witnessed their mother’s treachery, were
paralyzed. The unfortunate woman herself, too, stood stupified and
appalled. But she was quickly recalled to her senses by the active
clash of the swords of Padrig and his men. “Oh, my sons, my sons!”
she cried; “spare my boys!” But the tempter needed her services no
longer,—she had done his work. She was spurned to the ground and
trampled under foot by those who soon strewed the bloody floor
around her with the lifeless corpses of her brave sons.
Exulting in the full success of this expedition of vengeance, Mac-
an-Ts’agairt beheaded the bodies, and piled the heads in a heap on
an oblong hill that runs parallel to the road on the east side of Carr
Bridge, from which it is called Tom-nan-Cean, the Hill of the Heads.
Scarcely was he beyond the reach of danger, than his butchery was
known at the Castle Grant, and Sir Ludovick immediately offered a
great reward for his apprehension; but Padrig, who had anticipated
some such thing, fled to Ireland, where he remained for seven years.
But the restlessness of the murderer is well known, and Padrig felt it
in all its horrors. Leaving his Irish retreat, he returned to Lochaber.
By a strange accident, a certain Mungo Grant, of Muckrach, having
had his cattle and horses carried away by some thieves from that
quarter, pursued them hot foot, recovered them, and was on his way
returning with them, when, to his astonishment, he met Padrig Mac-
an-Ts’agairt, quite alone in a narrow pass, on the borders of his
native country. Mungo instantly seized and made a prisoner of him.
But his progress with his beasts was tedious; and as he was entering
Strathspey at Lag-na-caillich, about a mile to the westward of
Aviemore, he espied twelve desperate men, who, taking advantage of
his slow march, had crossed the hills to gain the pass before him, for
the purpose of rescuing Padrig. But Mungo was not to be daunted.
Seeing them occupying the road in his front, he grasped his prisoner
with one hand, and brandishing his dirk with the other, he advanced
in the midst of his people and animals, swearing potently that the
first motion at an attempt at rescue by any one of them should be the
signal for his dirk to drink the life’s-blood of Padrig Mac-an-
Ts’agairt. They were so intimidated by his boldness that they allowed
him to pass without assault, and left their friend to his fate. Padrig
was forthwith carried to Castle Grant. But the remembrance of the
Mugach’s murder had been by this time much obliterated by many
events little less strange, and the laird, unwilling to be troubled with
the matter, ordered Mungo and his prisoner away.
Disappointed and mortified, Mungo and his party were returning
with their captive, discussing, as they went, what they had best do
with him. “A fine reward we have had for all our trouble!” said one.
“The laird may catch the next thief her nainsel, for Donald!” said
another. “Let’s turn him loose!” said a third. “Ay, ay,” said a fourth;
“what for wud we be plaguing oursels more wi’ him?” “Yes, yes!
brave, generous men!” said Padrig, roused by a sudden hope of life
from the moody dream of the gallows-tree in which he had been
plunged, whilst he was courting his mournful muse to compose his
own lament, that he might die with an effect striking, as all the
events of his life had been. “Yes, brave men, free me from these
bonds! It is unworthy of Strathspey men,—it is unworthy of Grants to
triumph over a fallen foe! Those whom I killed were no clansmen of
yours, but recreant Camerons, who betrayed a Cameron! Let me go
free, and that reward of which you have been disappointed shall be
quadrupled for sparing my life.” Such words as these, operating on
minds so much prepared to receive them favourably, had well-nigh
worked their purpose. But “No!” said Muckrach sternly, “it shall
never be said that a murderer escaped from my hands. Besides, it
was just so that he fairly spake the Mugach’s false wife. But did he
spare her sons on that account? If ye let him go, my men, the fate of
the Mugach may be ours; for what bravery can stand against
treachery and assassination?” This opened an entirely new view of
the question to Padrig’s rude guards, and the result of the conference
was that they resolved to take him to Inverness, and to deliver him
up to the sheriff.
As they were pursuing their way up the south side of the river
Dulnan, the hill of Tom-nan-Cean appeared on that opposite to
them. At sight of it the whole circumstances of Padrig’s atrocious
deed came fresh in to their minds. It seemed to cry on them for
justice, and with one impulse they shouted out, “Let him die on the
spot where he did the bloody act!” Without a moment’s farther delay,
they determined to execute their new resolution. But on their way
across the plain, they happened to observe a large fir tree, with a
thick horizontal branch growing at right angles from the trunk, and
of a sufficient height from the ground to suit their purpose; and
doubting if they might find so convenient a gallows where they were
going, they at once determined that here Padrig should finish his
mortal career. The neighbouring birch thicket supplied them with
materials for making a withe; and whilst they were twisting it, Padrig
burst forth in a flood of Gaelic verse, which his mind had been
accumulating by the way. His song and the twig rope that was to
terminate his existence were spun out and finished at the same
moment, and he was instantly elevated to a height equally beyond his
ambition and his hopes.
AN HOUR IN THE MANSE.

By Professor Wilson.

In a few weeks the annual sacrament of the Lord’s Supper was to


be administered in the parish of Deanside; and the minister,
venerable in old age, of authority by the power of his talents and
learning, almost feared for his sanctity, yet withal beloved for
gentleness and compassion that had never been found wanting,
when required either by the misfortunes or errors of any of his flock,
had delivered for several successive Sabbaths, to full congregations,
sermons on the proper preparation of communicants in that awful
ordinance. The old man was a follower of Calvin; and many, who had
listened to him with a resolution in their hearts to approach the table
of the Redeemer, felt so awe-stricken and awakened at the
conclusion of his exhortations, that they gave their souls another
year to meditate on what they had heard, and by a pure and humble
course of life, to render themselves less unworthy to partake the
mysterious and holy bread and wine.
The good old man received in the manse, for a couple of hours
every evening, such of his parishioners as came to signify their wish
to partake of the sacrament; and it was then noted, that, though he in
nowise departed, in his conversation with them at such times, from
the spirit of those doctrines which he had delivered from the pulpit,
yet his manner was milder, and more soothing, and full of
encouragement; so that many who went to him almost with quaking
hearts, departed in tranquillity and peace, and looked forward to that
most impressive and solemn act of the Christian faith with calm and
glad anticipation. The old man thought, truly and justly, that few, if
any, would come to the manse, after having heard him in the kirk,
without due and deep reflection; and therefore, though he allowed
none to pass through his hands without strict examination, he spoke
to them all benignly, and with that sort of paternal pity which a
religious man, about to leave this life, feels towards all his brethren
of mankind, who are entering upon, or engaged in, its scenes of
agitation, trouble, and danger.
On one of those evenings, the servant showed into the minister’s
study a tall, bold-looking, dark-visaged man, in the prime of life,
who, with little of the usual courtesy, advanced into the middle of the
room, and somewhat abruptly declared the sacred purpose of his
visit. But before he could receive a reply, he looked around and
before him; and there was something so solemn in the old minister’s
appearance, as he sat like a spirit, with his unclouded eyes fixed upon
the intruder, that that person’s countenance fell, and his heart was
involuntarily knocking against his side. An old large Bible, the same
that he read from in the pulpit, was lying open before him. One
glimmering candle showed his beautiful and silvery locks falling over
his temples, as his head half stooped over the sacred page; a dead
silence was in the room dedicated to meditation and prayer; the old
man, it was known, had for some time felt himself to be dying, and
had spoken of the sacrament of this summer as the last he could ever
hope to administer; so that altogether, in the silence, the dimness,
the sanctity, the unworldliness of the time, the place, and the being
before him, the visitor stood like one abashed and appalled; and
bowing more reverently, or at least respectfully, he said, with a
quivering voice, “Sir, I come for your sanction to be admitted to the
table of our Lord.”
The minister motioned to him with his hand to sit down; and it
was a relief to the trembling man to do so, for he was in the presence
of one who, he felt, saw into his heart. A sudden change from
hardihood to terror took place within his dark nature; he wished
himself out of the insupportable sanctity of that breathless room;
and a remorse, that had hitherto slept, or been drowned within him,
now clutched his heartstrings, as if with an alternate grasp of frost
and fire, and made his knees knock against each other where he sat,
and his face pale as ashes.
“Norman Adams, saidst thou that thou wilt take into that hand,
and put into those lips, the symbol of the blood that was shed for
sinners, and of the body that bowed on the cross, and then gave up
the ghost? If so, let us speak together, even as if thou wert
communing with thine own heart. Never again may I join in that
sacrament, for the hour of my departure is at hand. Say, wilt thou eat
and drink death to thine immortal soul?”
The terrified man found strength to rise from his seat, and,
staggering towards the door, said, “Pardon, forgive me!—I am not
worthy.”
“It is not I who can pardon, Norman. That power lies not with
man; but sit down—you are deadly pale—and though, I fear, an ill-
living and a dissolute man, greater sinners have repented and been
saved. Approach not now the table of the Lord, but confess all your
sins before Him in the silence of your own house, and upon your
naked knees on the stone-floor every morning and every night; and if
this you do faithfully, humbly, and with a contrite heart, come to me
again when the sacrament is over, and I will speak words of comfort
to you (if then I am able to speak)—if, Norman, it should be on my
deathbed. This will I do for the sake of thy soul, and for the sake of
thy father, Norman, whom my soul loved, and who was a support to
me in my ministry for many long, long years, even for two score and
ten, for we were at school together; and had your father been living
now, he would, like myself, have this very day finished his eighty-
fifth year. I send you not from me in anger, but in pity and love. Go,
my son, and this very night begin your repentance, for if that face
speak the truth, your heart must be sorely charged.”
Just as the old man ceased speaking, and before the humble, or at
least affrighted culprit had risen to go, another visitor of a very
different kind was shown into the room—a young, beautiful girl,
almost shrouded in her cloak, with a sweet pale face, on which
sadness seemed in vain to strive with the natural expression of the
happiness of youth.
“Mary Simpson,” said the kind old man, as she stood with a timid
courtesy near the door, “Mary Simpson, approach, and receive from
my hands the token for which thou comest. Well dost thou know the
history of thy Saviour’s life, and rejoicest in the life and immortality
brought to light by the gospel. Young and guileless, Mary, art thou;
and dim as my memory now is of many things, yet do I well
remember the evening, when first beside my knee, thou heardst read
how the Divine Infant was laid in a manger, how the wise men from
the East came to the place of His nativity, and how the angels were
heard singing in the fields of Bethlehem all the night long.”
Alas! every word that had thus been uttered sent a pang into the
poor creature’s heart, and, without lifting her eyes from the floor,
and in a voice more faint and hollow than belonged to one so young,
she said, “O sir! I come not as an intending communicant; yet the
Lord my God knows that I am rather miserable than guilty, and He
will not suffer my soul to perish, though a baby is now within me, the
child of guilt, and sin, and horror. This, my shame, come I to tell you;
but for the father of my babe unborn, cruel though he has been to
me,—oh! cruel, cruel, indeed,—yet shall his name go down with me
in silence to the grave. I must not, must not breathe his name in
mortal ears; but I have looked round me in the wide moor, and when
nothing that could understand was by, nothing living but birds, and
bees, and the sheep I was herding, often have I whispered his name
in my prayers, and beseeched God and Jesus to forgive him all his
sins.”
At these words, of which the passionate utterance seemed to
relieve her heart, and before the pitying and bewildered old man
could reply, Mary Simpson raised her eyes from the floor, and
fearing to meet the face of the minister, which had heretofore never
shone upon her but with smiles, and of which the expected frown
was to her altogether insupportable, she turned them wildly round
the room, as if for a dark resting-place, and beheld Norman Adams
rooted to his seat, leaning towards her with his white, ghastly
countenance, and his eyes starting from their sockets, seemingly in
wrath, agony, fear, and remorse. That terrible face struck poor Mary
to the heart, and she sank against the wall, and slipped down,
shuddering, upon a chair.
“Norman Adams, I am old and weak, but do you put your arm
round that poor lost creature, and keep her from falling down on the
hard floor. I hear it is a stormy night, and she has walked some miles
hither; no wonder she is overcome. You have heard her confession,
but it was not meant for your ear; so, till I see you again, say nothing
of what you have now heard.”
“O sir! a cup of water, for my blood is either leaving my heart
altogether, or it is drowning it. Your voice, sir, is going far, far away
from me, and I am sinking down. Oh, hold me!—hold me up! Is it a
pit into which I am falling?—Saw I not Norman Adams?—Where is
he now?”
The poor maiden did not fall off the chair, although Norman
Adams supported her not; but her head lay back against the wall, and
a sigh, long and dismal, burst from her bosom, that deeply affected
the old man’s heart, but struck that of the speechless and motionless
sinner, like the first toll of the prison bell that warns the felon to
leave his cell and come forth to execution.
The minister fixed a stern eye upon Norman, for, from the poor
girl’s unconscious words, it was plain that he was the guilty wretch
who had wrought all this misery. “You knew, did you not, that she
had neither father nor mother, sister nor brother, scarcely one
relation on earth to care for or watch over her; and yet you have used
her so? If her beauty was a temptation unto you, did not the sweet
child’s innocence touch your hard and selfish heart with pity? or her
guilt and grief must surely now wring it with remorse. Look on her—
white, cold, breathless, still as a corpse; and yet, thou bold bad man,
thy footsteps would have approached the table of thy Lord!”
The child now partly awoke from her swoon, and her dim opening
eyes met those of Norman Adams. She shut them with a shudder,
and said, sickly and with a quivering voice, “Oh spare, spare me,
Norman! Are we again in that dark, fearful wood? Tremble not for
your life on earth, Norman, for never, never will I tell to mortal ears
that terrible secret; but spare me, spare me, else our Saviour, with all
His mercy, will never pardon your unrelenting soul. These are cruel-
looking eyes; you will not surely murder poor Mary Simpson,
unhappy as she is, and must for ever be—yet life is sweet! She
beseeches you on her knees to spare her life!”—and, in the intense
fear of phantasy, the poor creature struggled off the chair, and fell
down indeed in a heap at his feet.
“Canst thou indeed be the son of old Norman Adams, the
industrious, the temperate, the mild, and the pious—who so often sat
in this very room which thy presence has now polluted, and spake
with me on the mysteries of life and of death? Foul ravisher, what
stayed thy hand from the murder of that child, when there were none
near to hear her shrieks in the dark solitude of the great pine-wood?”
Norman Adams smote his heart and fell down too on his knees
beside the poor ruined orphan. He put his arm round her, and,
raising her from the floor, said, “No, no, my sin is great, too great for
Heaven’s forgiveness; but, oh sir! say not—say not that I would have
murdered her; for, savage as my crime was, yet may God judge me
less terribly than if I had taken her life.”
In a little while they were both seated with some composure, and
silence was in the room. No one spoke, and the old grayhaired man
sat with his eyes fixed, without reading, on the open Bible. At last he
broke silence with these words out of Isaiah, that seemed to have
forced themselves on his heedless eyes:—“Though your sins be as
scarlet, they shall be as white as snow: though they be red like
crimson, they shall be as wool.”
Mary Simpson wept aloud at these words, and seemed to forget
her own wrongs and grief in commiseration of the agonies of
remorse and fear that were now plainly preying on the soul of the
guilty man. “I forgive you, Norman, and will soon be out of the way,
no longer to anger you with the sight of me.” Then, fixing her
streaming eyes on the minister, she besought him not to be the
means of bringing him to punishment and a shameful death, for that
he might repent, and live to be a good man and respected in the
parish; but that she was a poor orphan for whom few cared, and who,
when dead, would have but a small funeral.
“I will deliver myself up into the hands of justice,” said the
offender, “for I do not deserve to live. Mine was an inhuman crime,
and let a violent and shameful death be my doom.”
The orphan girl now stood up as if her strength had been restored,
and stretching out her hands passionately, with a flow of most
affecting and beautiful language, inspired by a meek, single, and
sinless heart that could not bear the thought of utter degradation and
wretchedness befalling any one of the rational children of God,
implored and beseeched the old man to comfort the sinner before
them, and promise that the dark transaction of guilt should never
leave the concealment of their own three hearts. “Did he not save the
lives of two brothers once who were drowning in that black mossy
loch, when their own kindred, at work among the hay, feared the
deep sullen water, and all stood aloof shuddering and shaking, till
Norman Adams leapt in to their rescue, and drew them by the
dripping hair to the shore, and then lay down beside them on the
heather as like to death as themselves? I myself saw it done; I myself
heard their mother call down the blessing of God on Norman’s head,
and then all the haymakers knelt down and prayed. When you, on
the Sabbath, returned thanks to God for that they were saved, oh!
kind sir, did you not name, in the full kirk, him who, under
Providence, did deliver them from death, and who, you said, had
thus showed himself to be a Christian indeed? May his sin against
me be forgotten, for the sake of those two drowning boys, and their
mother, who blesses his name unto this day.”
From a few questions solemnly asked, and solemnly answered, the
minister found that Norman Adams had been won by the beauty and
loveliness of this poor orphan shepherdess, as he had sometimes
spoken to her when sitting on the hill-side with her flock, but that
pride had prevented him from ever thinking of her in marriage. It
appeared that he had also been falsely informed, by a youth whom
Mary disliked for his brutal and gross manners, that she was not the
innocent girl that her seeming simplicity denoted. On returning from
a festive meeting, where this abject person had made many mean
insinuations against her virtue, Norman Adams met her returning to
her master’s house, in the dusk of the evening, on the footpath
leading through a lonely wood; and, though his crime was of the
deepest dye, it seemed to the minister of the religion of mercy, that
by repentance, and belief in the atonement that had once been made
for sinners, he, too, might perhaps hope for forgiveness at the throne
of God.
“I warned you, miserable man, of the fatal nature of sin, when first
it brought a trouble over your countenance, and broke in upon the
peaceful integrity of your life. Was not the silence of the night often
terrible to you, when you were alone in the moors, and the whisper of
your own conscience told you, that every wicked thought was
sacrilege to your father’s dust? Step by step, and almost
imperceptibly, perhaps, did you advance upon the road that leadeth
to destruction; but look back now, and what a long dark journey have
you taken, standing, as you are, on the brink of everlasting death!
Once you were kind, gentle, generous, manly, and free; but you
trusted to the deceitfulness of your own heart; you estranged yourself
from the house of the God of your fathers; and what has your nature
done for you at last, but sunk you into a wretch—savage, selfish,
cruel, cowardly, and in good truth a slave? A felon are you, and
forfeited to the hangman’s hands. Look on that poor innocent child,
and think what is man without God. What would you give now, if the
last three years of your reckless life had been passed in a dungeon
dug deep into the earth, with hunger and thirst gnawing at your
heart, and bent down under a cartload of chains? Yet look not so
ghastly, for I condemn you not utterly; nor, though I know your guilt,
can I know what good may yet be left uncorrupted and
unextinguished in your soul. Kneel not to me, Norman; fasten not so
your eyes upon me; lift them upwards, and then turn them in upon
your own heart, for the dreadful reckoning is between it and God.”
Mary Simpson had now recovered all her strength, and she knelt
down by the side of the groaner. Deep was the pity she now felt for
him, who to her had shown no pity; she did not refuse to lay her light
arm tenderly upon his neck. Often had she prayed to God to save his
soul, even among her rueful sobs of shame in the solitary glens; and
now that she beheld his sin punished with a remorse more than he
could bear, the orphan would have willingly died to avert from his
prostrate head the wrath of the Almighty.
The old man wept at the sight of so much innocence, and so much
guilt, kneeling together before God, in strange union and fellowship
of a common being. With his own fatherly arms he lifted up the
orphan from her knees, and said, “Mary Simpson, my sweet and
innocent Mary Simpson, for innocent thou art, the elders will give
thee a token, that will, on Sabbath-day, admit thee (not for the first
time, though so young) to the communion-table. Fear not to
approach it; look at me, and on my face, when I bless the elements,
and be thou strong in the strength of the Lord. Norman Adams,
return to your home. Go into the chamber where your father died.
Let your knees wear out the part of the floor on which he kneeled. It
is somewhat worn already; you have seen the mark of your father’s
knees. Who knows, but that pardon and peace may descend from
Heaven upon such a sinner as thou? On none such as thou have mine
eyes ever looked, in knowledge, among all those who have lived and
died under my care, for three generations. But great is the unknown
guilt that may be hidden even in the churchyard of a small quiet
parish like this. Dost thou feel as if God-forsaken? Or, oh! say it unto
me, canst thou, my poor son, dare to hope for repentance?”
The pitiful tone of the old man’s trembling voice, and the motion
of his shaking and withered hands, as he lifted them up almost in an
attitude of benediction, completed the prostration of that sinner’s
spirit. All his better nature, which had too long been oppressed under
scorn of holy ordinances, and the coldness of infidelity, and the
selfishness of lawless desires that insensibly harden the heart they do
not dissolve, now struggled to rise up and respect its rights. “When I
remember what I once was, I can hope—when I think what I now am,
I only, only fear.”
A storm of rain and wind had come on, and Mary Simpson slept in
the manse that night. On the ensuing Sabbath she partook of the
sacrament. A woeful illness fell upon Norman Adams; and then for a
long time no one saw him, or knew where he had gone. It was said
that he was in a distant city, and that he was a miserable creature,
that never again could look upon the sun. But it was otherwise
ordered. He returned to his farm, greatly changed in face and person,
but even yet more changed in spirit.
The old minister had more days allotted to him than he had
thought, and was not taken away for some summers. Before he died,
he had reason to know that Norman Adams had repented in tears of
blood, in thoughts of faith, and in deeds of charity; and he did not
fear to admit him, too, in good time, to the holy ordinance, along
with Mary Simpson, then his wife, and the mother of his children.
THE WARDEN OF THE MARCHES:
A TRADITIONARY STORY OF ANNANDALE.

The predatory incursions of the Scots and English borderers, on


each other’s territories, are known to every one in the least
acquainted with either the written or traditional history of his
country. These were sometimes made by armed and numerous
bodies, and it was not uncommon for a band of marauders to take
advantage of a thick fog or a dark night for plundering or driving
away the cattle, with which they soon escaped over the border, where
they were generally secure. Such incursions were so frequent and
distressing to the peaceable and well-disposed inhabitants that they
complained loudly to their respective governments; in consequence
of which some one of the powerful nobles residing on the borders
was invested with authority to suppress these depredations, under
the title of Warden of the Marches. His duty was to protect the
frontier, and alarm the country by firing the beacons which were
placed on the heights, where they could be seen at a great distance,
as a warning to the people to drive away their cattle, and, collecting
in a body, either to repel or pursue the invaders, as circumstances
might require. The wardens also possessed a discretionary power in
such matters as came under their jurisdiction. The proper discharge
of this important trust required vigilance, courage, and fidelity, but it
was sometimes committed to improper hands, and consequently the
duty was very improperly performed.
In the reign of James V. one of these wardens was Sir John
Charteris of Amisfield, near Dumfries, a brave but haughty man, who
sometimes forgot his important trust so far as to sacrifice his public
duties to his private interests.
George Maxwell was a young and respectable farmer in
Annandale, who had frequently been active in repressing the petty
incursions to which that quarter of the country was exposed. Having
thereby rendered himself particularly obnoxious to the English
borderers, a strong party was formed, which succeeded in despoiling
him, by plundering his house and driving away his whole live stock.
At the head of a large party he pursued and overtook the “spoil-
encumbered foe;” a fierce and bloody contest ensued, in which
George fell the victim of a former feud, leaving his widow, Marion, in
poverty, with her son Wallace, an only child in the tenth year of his
age. By the liberality of her neighbours, the widow was replaced in a
small farm; but by subsequent incursions she was reduced to such
poverty that she occupied a small cottage, with a cow, which the
kindness of a neighbouring farmer permitted to pasture on his fields.
This, with the industry and filial affection of her son, now in his
twentieth year, enabled her to live with a degree of comfort and
contented resignation.
With a manly and athletic form, Wallace Maxwell inherited the
courage of his father, and the patriotic ardour of the chieftain after
whom he had been named; and Wallace had been heard to declare,
that although he could not expect to free his country from the
incursions of the English borderers, he trusted he should yet be able
to take ample vengeance for the untimely death of his father.
But although his own private wrongs and those of his country had
a powerful influence on the mind of Wallace Maxwell, yet his heart
was susceptible of a far loftier passion.
His fine manly form and graceful bearing had attractions for many
a rural fair; and he would have found no difficulty in matching with
youthful beauty considerably above his own humble station. But his
affections were fixed on Mary Morrison, a maiden as poor in worldly
wealth as himself; but nature had been more than usually indulgent
to her in a handsome person and fine features; and, what was of
infinitely more value, her heart was imbued with virtuous principles,
and her mind better cultivated than could have been expected from
her station in life. To these accomplishments were superadded a
native dignity, tempered with modesty, and a most winning
sweetness of manner. Mary was the daughter of a man who had seen
better days; but he was ruined by the incursions of the English
borderers; and both he and her mother dying soon after, Mary was
left a helpless orphan in the twentieth year of her age. Her beauty
procured her many admirers; and her unprotected state (for she had
no relations in Annandale) left her exposed to the insidious
temptations of unprincipled villainy; but they soon discovered that
neither flattery, bribes, nor the fairest promises, had the slightest
influence on her spotless mind. There were many, however, who
sincerely loved her, and made most honourable proposals; among
whom was Wallace Maxwell, perhaps the poorest of her admirers,
but who succeeded in gaining her esteem and affection. Mary and he
were fellow-servants to the farmer from whom his mother had her
cottage; and, on account of the troublesome state of the country,
Wallace slept every night in his mother’s house as her guardian and
protector. Mary and he were about the same age, both in the bloom
of youthful beauty; but both had discrimination to look beyond
external attractions; and, although they might be said to live in the
light of each other’s eyes, reason convinced them that the time was
yet distant when it would be prudent to consummate that union
which was the dearest object of their wishes.
A foray had been made by the English, in which their leader, the
son of a rich borderer, had been made prisoner, and a heavy ransom
paid to Sir John, the warden, for his release. This the avaricious
warden considered a perquisite of his office; and it accordingly went
into his private pocket. Soon after this, the party who had resolved
on ruining Wallace Maxwell for his threats of vengeance, took
advantage of a thick fog during the day, succeeded by a dark night, in
making an incursion on Annandale, principally for the purpose of
capturing the young man. By stratagem they effected their purpose;
and the widow’s cow, and Wallace her son, were both carried off as
part of the spoil. The youth’s life might have been in considerable
danger, had his capture not been discovered by the man who had
recently paid a high ransom for his own son, and he now took instant
possession of Wallace, resolving that he should be kept a close
prisoner till ransomed by a sum equal to that paid to the warden.
It would be difficult, if not impossible, to say whether the grief of
Widow Maxwell for her son, or that of Mary Morrison for her lover,
was greatest. But early in the ensuing morning the widow repaired to
Amisfield, related the circumstance to Sir John, with tears
beseeching him, as the plunderers were not yet far distant, to
despatch his forces after them, and rescue her son, with the property
of which she had been despoiled, for they had carried off everything,
even to her bed-clothes.
Wallace Maxwell had some time before incurred the warden’s
displeasure, whose mind was not generous enough either to forget or
forgive. He treated Marion with an indifference approaching almost
to contempt, by telling her that it would be exceedingly improper to
alarm the country about such a trivial incident, to which every
person in that quarter was exposed; and although she kneeled to
him, he refused to comply with her request, and proudly turned
away.
With a heavy and an aching heart, the widow called on Mary
Morrison on her way home to her desolate dwelling, relating the
failure of her application, and uttering direful lamentations for the
loss of her son; all of which were echoed by the no less desponding
maiden.
In the anguish of her distress, Mary formed the resolution of
waiting on the warden, and again urging the petition which had
already been so rudely rejected. Almost frantic, she hastened to the
castle, demanding to see Sir John. Her person was known to the
porter, and he was also now acquainted with the cause of her present
distress; she therefore found a ready admission. Always beautiful,
the wildness of her air, the liquid fire which beamed in her eyes, from
which tears streamed over her glowing cheeks, and the perturbation
which heaved her swelling bosom, rendered her an object of more
than ordinary interest in the sight of the warden. She fell at his feet
and attempted to tell her melancholy tale; but convulsive sobs stifled
her utterance. He then took her unresisting hand, raised her up, led
her to a seat, and bade her compose herself before she attempted to
speak.
With a faltering tongue, and eyes which, like the lightning of
heaven, seemed capable of penetrating a heart of adamant, and in all
the energy and pathos of impassioned grief, she told her tale,—
imploring the warden, if he ever regarded his mother, or if capable of
feeling for the anguish of a woman, to have pity on them, and
instantly exert himself to restore the most dutiful of sons, and the
most faithful of lovers, to his humble petitioners, whose gratitude
should cease only with their lives.
“You are probably not aware,” said he, in a kindly tone, “of the
difficulty of gratifying your wishes. Wallace Maxwell has rendered
himself the object of vengeance to the English borderers; and, before
now, he must be in captivity so secure, that any measure to rescue
him by force of arms would be unavailing. But, for your sake, I will
adopt the only means which can restore him, namely, to purchase his
ransom by gold. But you are aware that it must be high, and I trust
your gratitude will be in proportion.”
“Everything in our power shall be done to evince our gratitude,”
replied the delighted Mary, a more animated glow suffusing her
cheek, and her eyes beaming with a brighter lustre,—“Heaven reward
you.”
“To wait for my reward from heaven, would be to give credit to one
who can make ready payment,” replied the warden. “You, lovely
Mary, have it in your power to make me a return, which will render
me your debtor, without in any degree impoverishing yourself;”—and
he paused, afraid or ashamed to speak the purpose of his heart. Such
is the power which virgin beauty and innocence can exert on the
most depraved inclinations.
Although alarmed, and suspecting his base design, such was the
rectitude of Mary’s guileless heart, that she could not believe the
warden in earnest; and starting from his proffered embrace, she with
crimson blushes replied, “I am sure, sir, your heart could never
permit you so far to insult a hapless maiden. You have spoken to try
my affection for Wallace Maxwell; let me therefore again implore you
to take such measures as you may think best for obtaining his
release;” and a fresh flood of tears flowed in torrents from her eyes,
while she gazed wistfully in his face, with a look so imploringly
tender, that it might have moved the heart of a demon.
With many flattering blandishments, and much artful sophistry,
he endeavoured to win her to his purpose; but perceiving that his
attempts were unavailing, he concluded thus:—“All that I have
promised I am ready to perform; but I swear by Heaven, that unless
you grant me the favour which I have so humbly solicited, Wallace
Maxwell may perish in a dungeon, or by the hand of his enemies; for
he shall never be rescued by me. Think, then, in time, before you
leave me, and for his sake, and your own future happiness, do not
foolishly destroy it for ever.”
With her eyes flashing indignant fire, and her bosom throbbing
with the anguish of insulted virtue, she flung herself from his hateful
embrace, and, rushing from his presence, with a sorrowful and
almost bursting heart, left the castle.
Widow Maxwell had a mind not easily depressed, and although in
great affliction for her son, did not despair of his release. She was
ignorant of Mary’s application to the warden, and had been revolving
in her mind the propriety of seeking an audience of the king, and
detailing her wrongs, both at the hands of the English marauders and
Sir John. She was brooding on this when Mary entered her cottage,
and, in the agony of despairing love and insulted honour, related the
reception she had met from the warden. The relation confirmed the
widow’s half formed resolution, and steeled her heart to its purpose.
After they had responded each other’s sighs, and mingled tears
together, the old woman proposed waiting on her friend the farmer,
declaring her intentions, and, if he approved of them, soliciting his
permission for Mary to accompany her.
The warden’s indolent neglect of duty was a subject of general
complaint; the farmer, therefore, highly approved of the widow’s
proposal, believing that it would not only procure her redress, but
might be of advantage to the country. He urged their speedy and
secret departure, requesting that whatever answer they received
might not be divulged till the final result was seen; and next
morning, at early dawn, the widow and Mary took their departure for
Stirling. King James was easy of access to the humblest of his
subjects; and the two had little difficulty in obtaining admission to
the royal presence. Widow Maxwell had in youth been a beautiful
woman, and, although her early bloom had passed, might still have
been termed a comely and attractive matron, albeit in the autumn of
life. In a word, her face was still such as would have recommended
her suit to the king, whose heart was at all times feelingly alive to the
attraction of female beauty. But, on the present occasion, although
she was the petitioner, the auxiliary whom she had brought, though
silent, was infinitely the more powerful pleader; for Mary might be
said to resemble the half-blown rose in the early summer, when its
glowing leaves are wet with the dews of morning. James was so
struck with their appearance, that, before they had spoken, he
secretly wished that their petitions might be such as he could with

You might also like