100% found this document useful (2 votes)
9 views

Practical Guide to Using SQL in Oracle 1st Edition Richard Walsh Earp pdf download

The document provides a practical guide to using SQL in Oracle, authored by Richard Walsh Earp and Sikha Saha Bagui, published by Wordware Publishing in 2008. It covers various aspects of SQL, including database models, commands, and the software engineering process related to relational databases. The guide is designed for both beginners and developers looking to enhance their SQL skills in Oracle environments.

Uploaded by

mirmecontin34
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
9 views

Practical Guide to Using SQL in Oracle 1st Edition Richard Walsh Earp pdf download

The document provides a practical guide to using SQL in Oracle, authored by Richard Walsh Earp and Sikha Saha Bagui, published by Wordware Publishing in 2008. It covers various aspects of SQL, including database models, commands, and the software engineering process related to relational databases. The guide is designed for both beginners and developers looking to enhance their SQL skills in Oracle environments.

Uploaded by

mirmecontin34
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Practical Guide to Using SQL in Oracle 1st

Edition Richard Walsh Earp pdf download

https://ebookfinal.com/download/practical-guide-to-using-sql-in-
oracle-1st-edition-richard-walsh-earp/

Explore and download more ebooks or textbooks


at ebookfinal.com
We believe these products will be a great fit for you. Click
the link to download now, or visit ebookfinal
to discover even more!

Database Systems Using Oracle A Simplified Guide to SQL


and PL SQL 2nd Edition Nilesh Shah

https://ebookfinal.com/download/database-systems-using-oracle-a-
simplified-guide-to-sql-and-pl-sql-2nd-edition-nilesh-shah/

Murach s Oracle SQL and PL SQL for Developers 2nd Edition


Joel Murach

https://ebookfinal.com/download/murach-s-oracle-sql-and-pl-sql-for-
developers-2nd-edition-joel-murach/

Treating Self Injury A Practical Guide 1st Edition Barent


W. Walsh Phd

https://ebookfinal.com/download/treating-self-injury-a-practical-
guide-1st-edition-barent-w-walsh-phd/

SQL QuickStart Guide The Simplified Beginner s Guide to


SQL Clydebank Technology

https://ebookfinal.com/download/sql-quickstart-guide-the-simplified-
beginner-s-guide-to-sql-clydebank-technology/
Oracle SQL Recipes A Problem Solution Approach 1st Edition
Grant Allen

https://ebookfinal.com/download/oracle-sql-recipes-a-problem-solution-
approach-1st-edition-grant-allen/

Treating Self Injury Second Edition A Practical Guide


Barent W. Walsh Phd

https://ebookfinal.com/download/treating-self-injury-second-edition-a-
practical-guide-barent-w-walsh-phd/

Healthy SQL A Comprehensive Guide to Healthy SQL Server


Performance 1st Edition Robert Pearl

https://ebookfinal.com/download/healthy-sql-a-comprehensive-guide-to-
healthy-sql-server-performance-1st-edition-robert-pearl/

Expert PL SQL Practices for Oracle Developers and DBAs 1st


Edition John Beresniewicz

https://ebookfinal.com/download/expert-pl-sql-practices-for-oracle-
developers-and-dbas-1st-edition-john-beresniewicz/

Working with Specialized Language A Practical Guide to


Using Corpora 1st Edition Lynne Bowker

https://ebookfinal.com/download/working-with-specialized-language-a-
practical-guide-to-using-corpora-1st-edition-lynne-bowker/
Practical Guide to Using SQL in Oracle 1st Edition
Richard Walsh Earp Digital Instant Download
Author(s): Richard Walsh Earp
ISBN(s): 9781598220636, 1598220632
Edition: 1
File Details: PDF, 3.75 MB
Year: 2008
Language: english
Practical Guide to
Using SQL in Oracle ®

Richard Walsh Earp


and
Sikha Saha Bagui

Wordware Publishing, Inc.


Library of Congress Cataloging-in-Publication Data

Earp, Richard Walsh, 1940-


Practical guide to using SQL in Oracle / by Richard Walsh Earp and Sikha Saha Bagui.
p. cm.
Includes index.
ISBN-13: 978-1-59822-063-6
ISBN-10: 1-59822-063-2 (pbk.)
1. SQL (Computer program language. 2. Oracle (Computer file)
3. Database management. I. Bagui, Sikha Saha, 1964-. II. Title.
QA76.73.S67B344 2008
005.75'65--dc22 2008034585
CIP

© 2008, Wordware Publishing, Inc.


All Rights Reserved
1100 Summit Avenue, Suite 102
Plano, Texas 75074

No part of this book may be reproduced in any form or by


any means without permission in writing from
Wordware Publishing, Inc.

Printed in the United States of America

ISBN-13: 978-1-59822-063-6
ISBN-10: 1-59822-063-2
10 9 8 7 6 5 4 3 2 1
0809

Oracle is a registered trademark and PL/SQL and SQL*Plus are trademarks of Oracle Corporation in the United
States and other countries. UNIX is a registered trademark of The Open Group in the United States and other
countries.
Other brand names and product names mentioned in this book are trademarks or service marks of their
respective companies. Any omission or misuse (of any kind) of service marks or trademarks should not be
regarded as intent to infringe on the property of others. The publisher recognizes and respects all marks used by
companies, manufacturers, and developers as a means to distinguish their products.
This book is sold as is, without warranty of any kind, either express or implied, respecting the contents of this
book and any disks or programs that may accompany it, including but not limited to implied warranties for the
book’s quality, performance, merchantability, or fitness for any particular purpose. Neither Wordware Publishing,
Inc. nor its dealers or distributors shall be liable to the purchaser or any other person or entity with respect to
any liability, loss, or damage caused or alleged to have been caused directly or indirectly by this book.

All inquiries for volume purchases of this book should be addressed to Wordware
Publishing, Inc., at the above address. Telephone inquiries may be made by calling:
(972) 423-0090
Dedicated to my wife, Brenda,
and
my children, Beryl, Rich, Gen and Mary Jo

R.W.E.

Dedicated to my father, Santosh Saha, and mother, Ranu Saha,


and
my husband, Subhash Bagui,
and
my sons, Sumon and Sudip,
and
my brother and his wife, Pradeep and Shyamasri, and nieces,
Priyashi and Piyali

S. S.B.
This page intentionally left blank.
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

Prologue The Software Engineering Process and Relational Databases . . . . . . . . 1


What Is a Database? . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Database Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
The Hierarchical Model . . . . . . . . . . . . . . . . . . . . . . . 3
Other Cardinalities . . . . . . . . . . . . . . . . . . . . . . . 6
The Network Model . . . . . . . . . . . . . . . . . . . . . . . . . 8
Contemporary Databases: The Relational Model . . . . . . . . . 9
The First, Second, and Third Normal Forms . . . . . . . . . . . . . 11
The First Normal Form . . . . . . . . . . . . . . . . . . . . . . 12
Non-1NF to First Normal Form (1NF) . . . . . . . . . . . . 13
The Second Normal Form . . . . . . . . . . . . . . . . . . . . . 14
Non-2NF to 2NF. . . . . . . . . . . . . . . . . . . . . . . . 16
The Third Normal Form . . . . . . . . . . . . . . . . . . . . . . 18
Non-3NF to 3NF. . . . . . . . . . . . . . . . . . . . . . . . 19
What Is the Software Engineering Process?. . . . . . . . . . . . . . 20

Chapter 1 Getting Started with Oracle. . . . . . . . . . . . . . . . . . . . . . . . . 25


Getting Started with Oracle in UNIX . . . . . . . . . . . . . . . . . 26
Signing on to Oracle in UNIX . . . . . . . . . . . . . . . . . . . 26
Setting Your System Parameters . . . . . . . . . . . . . . . . . . . 27
Setting the PAUSE Parameter . . . . . . . . . . . . . . . . . . 28
Setting the Prompt Parameter. . . . . . . . . . . . . . . . . . . 28
Showing Timing Statistics . . . . . . . . . . . . . . . . . . . . . 29
Viewing a List of System Parameters . . . . . . . . . . . . . . . 29
Oracle’s HELP Command in UNIX . . . . . . . . . . . . . . . . 30
Using Oracle Commands . . . . . . . . . . . . . . . . . . . . . . . . 31
Understanding SQL and Its Sublanguage . . . . . . . . . . . . . 31
Using SELECT Statement Syntax . . . . . . . . . . . . . . . . . . . 32
Re-executing a Command . . . . . . . . . . . . . . . . . . . . . 33
Accessing Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

v
Contents

Adding Comments to Statements . . . . . . . . . . . . . . . . . . . 35


A Few More Examples and Further Comments about Case . . . 36
Editing SQL Statements . . . . . . . . . . . . . . . . . . . . . . . . 36
Option 1: Editing SQL Statements Using an Editor . . . . . . . 37
Defining an Editor . . . . . . . . . . . . . . . . . . . . . . . 37
Editing the Buffer . . . . . . . . . . . . . . . . . . . . . . . 37
Saving the Buffer . . . . . . . . . . . . . . . . . . . . . . . 39
Using GET . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Using a Script File to Save Your Query . . . . . . . . . . . 40
Option 2: Editing SQL Statements or Queries Using SQLPLUS 41
Using the CHANGE Command . . . . . . . . . . . . . . . . 41
Using the LIST Command . . . . . . . . . . . . . . . . . . 42
Using the APPEND Command . . . . . . . . . . . . . . . . 43
Using the INPUT Command . . . . . . . . . . . . . . . . . 45
Using INPUT to Insert a Line . . . . . . . . . . . . . . . . 47
Using the DELETE Command . . . . . . . . . . . . . . . . 49
Displaying the Student-Course Database . . . . . . . . . . . . . . . 50
Displaying the Course Table (the Course Relation) . . . . . . . 50
Creating a Synonym for the Course Table . . . . . . . . . . . . . . . 51
Deleting a Synonym . . . . . . . . . . . . . . . . . . . . . . . . 52
Introducing the Oracle Data Dictionary . . . . . . . . . . . . . . . . 52
Using DESC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Using a Convention for Writing SQL Statements . . . . . . . . . . . 55
Printing Query Results and Using Host . . . . . . . . . . . . . . . . 56
Signing Off from Oracle . . . . . . . . . . . . . . . . . . . . . . . . . 58
Exercises for Chapter 1. . . . . . . . . . . . . . . . . . . . . . . . . 59

Chapter 2 More “Beginning” SQL Commands . . . . . . . . . . . . . . . . . . . . . 63


An Extended SELECT Statement . . . . . . . . . . . . . . . . . . . 63
SELECTing Attributes (Columns) . . . . . . . . . . . . . . . . 65
Using ORDER BY . . . . . . . . . . . . . . . . . . . . . . . . . 66
SELECTing Rows . . . . . . . . . . . . . . . . . . . . . . . . . 70
Using AND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Using OR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Using BETWEEN . . . . . . . . . . . . . . . . . . . . . . . . . 73
A Simple CREATE TABLE Command . . . . . . . . . . . . . . . . 75
Inserting Values into an Existing Table . . . . . . . . . . . . . . . . 76
INSERT INTO..VALUES . . . . . . . . . . . . . . . . . . . . . 76
INSERT INTO..SELECT . . . . . . . . . . . . . . . . . . . . . 79
The UPDATE Command . . . . . . . . . . . . . . . . . . . . . . . . 82
The DELETE Command . . . . . . . . . . . . . . . . . . . . . . . . 84
Deleting a Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
vi
Contents

ROLLBACK, COMMIT, and SAVEPOINT . . . . . . . . . . . . . . 85


The ALTER TABLE Command . . . . . . . . . . . . . . . . . . . . 92
Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Common Number Data Types . . . . . . . . . . . . . . . . . . . 95
CHAR Data Type. . . . . . . . . . . . . . . . . . . . . . . . . . 97
VARCHAR2 Data Type . . . . . . . . . . . . . . . . . . . . . . 98
NCHAR and NVARCHAR2 Data Types. . . . . . . . . . . . . . 98
LONG, RAW, LONG RAW, and BOOLEAN Data Types. . . . . 99
Large Object (LOB) Data Types. . . . . . . . . . . . . . . . . . 99
Abstract Data Types . . . . . . . . . . . . . . . . . . . . . . . 100
The XML Data Type . . . . . . . . . . . . . . . . . . . . . . . 100
The DATE Data Type and Type Conversion Functions . . . . 101
Entering Four-Digit Years . . . . . . . . . . . . . . . . . . 105
Exercises for Chapter 2 . . . . . . . . . . . . . . . . . . . . . . . . 107

Chapter 3 Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111


The Cartesian Product. . . . . . . . . . . . . . . . . . . . . . . . . 112
The Join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Join Using ANSI Join Syntax . . . . . . . . . . . . . . . . . . . 115
Theta Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Qualifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Table Aliases and an Introduction to Multi-table Joins. . . . . . . . 118
More on Comments . . . . . . . . . . . . . . . . . . . . . . . . . . 119
More on Multiple Table Joins and Join Conditions . . . . . . . . . . 121
Column Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
COUNT and Rownum . . . . . . . . . . . . . . . . . . . . . . . . . 128
Using COUNT. . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Using Rownum . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Outer Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Left Outer Join . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Right Outer Join. . . . . . . . . . . . . . . . . . . . . . . . . . 132
Handling Full Outer Joins . . . . . . . . . . . . . . . . . . . . 133
Outer Join with an AND Condition . . . . . . . . . . . . . . . . 135
Chaining Outer Joins . . . . . . . . . . . . . . . . . . . . . . . 136
Self Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Self Join and Outer Join . . . . . . . . . . . . . . . . . . . . . . 139
Exercises for Chapter 3 . . . . . . . . . . . . . . . . . . . . . . . . 139

Chapter 4 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145


The COUNT Function. . . . . . . . . . . . . . . . . . . . . . . . . 146
Using SELECT and COUNT with DISTINCT. . . . . . . . . . 148

vii
Contents

More Basic Functions . . . . . . . . . . . . . . . . . . . . . . . . . 149


Aggregate Functions. . . . . . . . . . . . . . . . . . . . . . . . . . 150
Row-level Functions. . . . . . . . . . . . . . . . . . . . . . . . . . 151
The NVL Function . . . . . . . . . . . . . . . . . . . . . . . . 151
String Functions . . . . . . . . . . . . . . . . . . . . . . . . . 152
The SUBSTR and INSTR Functions . . . . . . . . . . . . 153
The RPAD and LPAD Functions . . . . . . . . . . . . . . 157
The LTRIM and RTRIM Functions . . . . . . . . . . . . . 158
The LENGTH Function . . . . . . . . . . . . . . . . . . . 158
Matching Substrings Using LIKE . . . . . . . . . . . . . . 159
LIKE as an Existence Match . . . . . . . . . . . . . . . . 159
LIKE with a Positioned Match and a Wildcard . . . . . . . 163
The UPPER and LOWER Functions . . . . . . . . . . . . 164
The Data Dictionary Revisited . . . . . . . . . . . . . . . . . . . . 165
Exercises for Chapter 4 . . . . . . . . . . . . . . . . . . . . . . . . 167

Chapter 5 Query Development, Privileges, and Derived Structures . . . . . . . . . 175


Query Development . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Using SAVE and EDIT . . . . . . . . . . . . . . . . . . . . . . 176
Deleting a Query . . . . . . . . . . . . . . . . . . . . . . . . . 181
Parentheses in SQL Expressions . . . . . . . . . . . . . . . . . . . 182
Derived Structures . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Using the CREATE OR REPLACE VIEW Statements . . 185
Adding ORDER BY to CREATE OR REPLACE
VIEW Statements . . . . . . . . . . . . . . . . . . . . 186
Developing a Query Using Views . . . . . . . . . . . . . . 188
Creating Special View Column Names . . . . . . . . . . . 188
Granting and Revoking Privileges on Tables and Views. . . . . . . 190
Query Development and Derived Structures . . . . . . . . . . . . 191
Step 1: Developing a Query Step-by-Step . . . . . . . . . . . . 192
Step 2: Using a Derived Structure . . . . . . . . . . . . . . . . 195
Option 1: Make Your Query a View . . . . . . . . . . . . . 195
Option 2: Create a Temporary Table . . . . . . . . . . . . 196
Option 3: Use an Inline View . . . . . . . . . . . . . . . . 197
Option 4: Use a Snapshot . . . . . . . . . . . . . . . . . . 199
Exercises for Chapter 5 . . . . . . . . . . . . . . . . . . . . . . . . 200

Chapter 6 Set Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205


UNION Operations . . . . . . . . . . . . . . . . . . . . . . . . . . 206
The IN and NOT..IN Predicates . . . . . . . . . . . . . . . . . . . 208
Using IN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209

viii
Contents

Using NOT..IN . . . . . . . . . . . . . . . . . . . . . . . . . . 212


The Difference Operation . . . . . . . . . . . . . . . . . . . . . . . 217
Exercises for Chapter 6 . . . . . . . . . . . . . . . . . . . . . . . . 222

Chapter 7 Subqueries versus Joins. . . . . . . . . . . . . . . . . . . . . . . . . . 227


The IN Subquery. . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
The Subquery as a Join . . . . . . . . . . . . . . . . . . . . . . . . 230
When the Join Cannot Be Turned into a Subquery. . . . . . . . . . 232
More Examples Involving Joins and IN . . . . . . . . . . . . . . . . 234
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Subqueries with Operators . . . . . . . . . . . . . . . . . . . . . . 240
Exercises for Chapter 7 . . . . . . . . . . . . . . . . . . . . . . . . 242

Chapter 8 GROUP BY and HAVING . . . . . . . . . . . . . . . . . . . . . . . . . . 247


Aggregates/Column Functions . . . . . . . . . . . . . . . . . . . . 247
The GROUP BY Clause . . . . . . . . . . . . . . . . . . . . . . . . 248
GROUP BY and ORDER BY . . . . . . . . . . . . . . . . . . . 251
The HAVING Clause . . . . . . . . . . . . . . . . . . . . . . . . . 253
HAVING and WHERE . . . . . . . . . . . . . . . . . . . . . . 254
GROUP BY and HAVING: Aggregates of Aggregates . . . . . . . . 256
Auditing IN Subqueries . . . . . . . . . . . . . . . . . . . . . . . . 258
Nulls Revisited. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Exercises for Chapter 8 . . . . . . . . . . . . . . . . . . . . . . . . 265

Chapter 9 Correlated Subqueries . . . . . . . . . . . . . . . . . . . . . . . . . . 269


Non-Correlated Subqueries . . . . . . . . . . . . . . . . . . . . . . 269
Correlated Subqueries. . . . . . . . . . . . . . . . . . . . . . . . . 271
Existence Queries and Correlation . . . . . . . . . . . . . . . . . . 274
EXISTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
From IN to EXISTS. . . . . . . . . . . . . . . . . . . . . . . . 282
NOT EXISTS . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
SQL Universal and Existential Qualifiers — the “for all” Query . . 291
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Exercises for Chapter 9 . . . . . . . . . . . . . . . . . . . . . . . . 301

Chapter 10 CREATE TABLE and SQLLOADER. . . . . . . . . . . . . . . . . . . . . . . 307


The “Simple” CREATE TABLE . . . . . . . . . . . . . . . . . . . 308
The NOT NULL Constraint . . . . . . . . . . . . . . . . . . . . . . 309
PRIMARY KEY Constraints . . . . . . . . . . . . . . . . . . . . . 312

ix
Contents

Creating the PRIMARY KEY Constraint . . . . . . . . . . . . 313


At the Column Level . . . . . . . . . . . . . . . . . . . . . 313
At the Table Level . . . . . . . . . . . . . . . . . . . . . . 313
Using the ALTER TABLE Command . . . . . . . . . . . . 314
Adding a Concatenated Primary Key . . . . . . . . . . . . . . 314
Another Example of Adding a Concatenated Primary Key . . . 315
The UNIQUE Constraint . . . . . . . . . . . . . . . . . . . . . . . 316
The CHECK Constraint . . . . . . . . . . . . . . . . . . . . . . . . 317
Referential Integrity . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Defining the Referential Integrity Constraint . . . . . . . . . . 320
Adding the Foreign Key after Tables Are Created . . . . . . . 321
Using DELETE and the Referential Constraint . . . . . . . . . 322
ON DELETE RESTRICT . . . . . . . . . . . . . . . . . . 322
ON DELETE CASCADE . . . . . . . . . . . . . . . . . . 323
ON DELETE SET NULL . . . . . . . . . . . . . . . . . . 324
More on Constraint Names . . . . . . . . . . . . . . . . . . . . . . 324
SQLLOADER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
SQLLOADER Example 1 . . . . . . . . . . . . . . . . . . . . . 327
Another SQLLOADER Example . . . . . . . . . . . . . . . . . 330
Exercises for Chapter 10 . . . . . . . . . . . . . . . . . . . . . . . 331

Chapter 11 Multiple Commands, START Files, and Reports in SQLPLUS . . . . . . . . 335


Creating a File (a START Table) and Starting It . . . . . . . . . . . 336
A START File (Script) with Editing Features . . . . . . . . . . . . 337
Using the DECODE, GREATEST, and LEAST Functions . . . . . 342
DECODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
GREATEST and LEAST . . . . . . . . . . . . . . . . . . . . . 345
Adding Reporting Features to a START File. . . . . . . . . . . . . 347
A New and Improved Script . . . . . . . . . . . . . . . . . . . . . . 349
Using START Files with ACCEPT and PROMPT . . . . . . . . . . 354
Using START Files with Positional Input . . . . . . . . . . . . . . 355
Exercises for Chapter 11 . . . . . . . . . . . . . . . . . . . . . . . 357

Chapter 12 Beginning PL/SQL: Anonymous Blocks, Procedures,


Functions, and Packages . . . . . . . . . . . . . . . . . . . . . . . 361
Anonymous Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Elementary Procedures with Sequence Structures . . . . . . . . . 364
A Simple Example of a Procedure . . . . . . . . . . . . . . . . 365
Reusing a Procedure . . . . . . . . . . . . . . . . . . . . . . . 367
Deleting a Procedure . . . . . . . . . . . . . . . . . . . . . . . 367
Adding a Parameter List to a Procedure . . . . . . . . . . . . . 368
Performing More than One Action in a Procedure . . . . . . . 369

x
Contents

Procedures with Selection and Iteration Control Structures . . 371


Example of a Procedure with Selection . . . . . . . . . . . 371
Example of a Procedure with Iteration . . . . . . . . . . . 372
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Example of a Function . . . . . . . . . . . . . . . . . . . . . . 374
Deleting a Function . . . . . . . . . . . . . . . . . . . . . . . . 375
Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Creating a Package . . . . . . . . . . . . . . . . . . . . . . . . 376
Another Approach to Creating This Package . . . . . . . . . . 379
Deleting a Package . . . . . . . . . . . . . . . . . . . . . . . . 380
Defining a PL/SQL INDEX BY Table . . . . . . . . . . . . . . . . . 380
Using a PL/SQL Table . . . . . . . . . . . . . . . . . . . . . . 382
Exercises for Chapter 12 . . . . . . . . . . . . . . . . . . . . . . . 384

Chapter 13 Introduction to Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . 387


What Is a Trigger? . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
A Simple Trigger Example . . . . . . . . . . . . . . . . . . . . . . 389
How the Trigger Worked . . . . . . . . . . . . . . . . . . . . . 391
Row-Level Triggers versus Statement-Level Triggers . . . . . . . 392
Enabling and Disabling Triggers . . . . . . . . . . . . . . . . . . . 392
Enabling All Triggers for a Table . . . . . . . . . . . . . . . . 393
Deleting Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Values in the Trigger . . . . . . . . . . . . . . . . . . . . . . . . . 393
Using WHEN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Performance Issues Using WHEN . . . . . . . . . . . . . . . . 395
A Trigger Where One Table Affects Another Trigger . . . . . . . . 395
Mutating Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Exercises for Chapter 13 . . . . . . . . . . . . . . . . . . . . . . . 400

Chapter 14 SQL and XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405


Overview of XML . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
Oracle and XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
XMLFOREST . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
Using XMLELEMENT . . . . . . . . . . . . . . . . . . . . . . 409
Using XMLATTRIBUTES . . . . . . . . . . . . . . . . . . . . 412
Creating a Table Using the XMLType Data Type . . . . . . . . . . 414
Inserting Values into Tables with an XMLType Data Type . . 415
Extracting Information Using XPATH . . . . . . . . . . . . . . 417
Using EXTRACTVALUE . . . . . . . . . . . . . . . . . . 417
Using EXISTSNODE . . . . . . . . . . . . . . . . . . . . 417
Exercises for Chapter 14 . . . . . . . . . . . . . . . . . . . . . . . 418

xi
Contents

Appendix A Some UNIX Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 421


Commonly Used UNIX Commands . . . . . . . . . . . . . . . . . . 421
Summary Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
Other Miscellaneous Commands . . . . . . . . . . . . . . . . . . . 424
Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Using vi as Your Editor . . . . . . . . . . . . . . . . . . . . . . 425
Other vi Commands . . . . . . . . . . . . . . . . . . . . . 426
Using joe as Your Editor . . . . . . . . . . . . . . . . . . . . . 427

Appendix B The Data Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429


Beginning to Explore the Data Dictionary . . . . . . . . . . . . . . 430
Choosing a View from the Dictionary. . . . . . . . . . . . . . . . . 434
Choosing the View You Want to See . . . . . . . . . . . . . . . 434
Describing the View You Want to See . . . . . . . . . . . . . . 435
Finding the “Right” Columns . . . . . . . . . . . . . . . . . . 436
Finding out How Many Rows Are in the View . . . . . . . . . 436
Views of TABLES. . . . . . . . . . . . . . . . . . . . . . . . . 439
Other Objects — Tablespaces and Constraints . . . . . . . . . . . 440
Views of Tablespaces . . . . . . . . . . . . . . . . . . . . . . . 441
Views of Constraints . . . . . . . . . . . . . . . . . . . . . . . 443
Exercises for Appendix B . . . . . . . . . . . . . . . . . . . . . . . 445

Appendix C The Student Database and Other Tables Used in This Book . . . . . . . 447
The Student-Course Database . . . . . . . . . . . . . . . . . . . . 447
Entity Relationship Diagram of the Student-Course Database . . . 449
Other Tables Used in This Book . . . . . . . . . . . . . . . . . . . 450

Appendix D Glossary of Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453

Appendix E Important Commands and Functions . . . . . . . . . . . . . . . . . . . 467

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479

xii
Preface

Why This Book?


In recent years we have seen a dramatic increase in the
popularity of Oracle. Oracle is now the most widely used
database on the market. Due to this dramatic increase in
popularity, more and more schools and training organiza-
tions are using Oracle to teach database principles and
concepts. And given the current technological climate, the
computer industry needs application developers who can
write Oracle SQL code efficiently.
This book employs a step-by-step systematic
approach to learning Oracle SQL, database principles,
and concepts. It starts by presenting simple Oracle SQL
commands and functions, and slowly moves into more
complex query development and PL/SQL; it also intro-
duces SQL/XML. Each chapter includes numerous
examples, and if readers wish they can run these exam-
ples themselves using Oracle. Each chapter ends with a
series of exercises that reinforce and build on chapter
material. In doing these exercises, it is our hope and
expectation that readers will learn SQL and the underly-
ing principles of relational databases. As such, we do not
include the “answers” to the exercises.

xiii
Preface

Oracle and SQL


SQL is an abbreviation for SEQUEL (Structured English
Query Language), and was originally an IBM product.
Since the 1970s, when SEQUEL was introduced, it has
become the de facto standard “language” for accessing
relational databases. SQL is not really a language as
much as it is a database query tool. In this book, we will
concentrate on using the Oracle database engine to learn
and use SQL.
SQL allows you to define relational databases and
create tables; in this sense, SQL is a Data Definition Lan-
guage (DDL). Oracle also provides a utility called
SQL*Loader to load the created database with data.
After the database is created and populated, SQL pro-
vides a way to modify the database definition by using
DDL. It also allows you to query the relational database
in a most flexible way as well as change the data (i.e., per-
form data manipulation). Therefore, SQL is a Data
Manipulation Language (DML) as well as a DDL.
This book covers SQL as it is invoked via SQL*Plus,
which is a command-line system to launch interactive
commands. SQL*Plus is a powerful Oracle product that
takes your instructions for Oracle, checks them for cor-
rectness, submits them to the Oracle database engine,
and then modifies or reformats the response Oracle gives.
In short, SQL*Plus makes interacting with Oracle
smooth and easy.

Audience and Coverage


This book can be used in conjunction with standard data-
base texts used in universities and colleges; it can also be
used as a “stand-alone” text to learn SQL and Oracle. For
this latter scenario, we included a Prologue chapter. The
Prologue provides basic database background material
needed to begin using SQL and relational databases.

xiv
Preface

This book can be divided into two parts. Chapters 1


through 10 cover topics meant for introductory-level
database learning or a beginning SQL/Oracle class.
Chapters 11 through 14 contain a preview of advanced
topics that are usually covered in advanced database
classes. These chapters assume that the reader has some
programming background or experience.
The Prologue introduces some of the database terms
that will be used throughout the book and shows how and
why the relational database model fits into the database
world of today. Chapter 1 begins in a step-by-step man-
ner, beginning with “signing on.” Then it covers basic
Oracle/SQL topics such as SELECT, INSERT, and DELETE
(DML commands). Simple editing concepts are also intro-
duced in this chapter. Chapter 2 covers additional
beginning SQL commands and builds on the material in
Chapter 1. Chapter 3 introduces joins, which is a way to
put relational tables together. Chapters 4 and 5 get into
basic Oracle functions and query development as well as
the use of views and other derived structures. Chapter 6
covers simple set operations; Chapters 7, 8, and 9 cover
more advanced queries including using subqueries,
aggregate functions, and correlated subqueries. Chapters
10 through 13 introduce still more advanced SQL con-
cepts such as the load utility, start files, reports, some
introductory PL/SQL, and triggers. Chapter 14 intro-
duces SQL/XML. As we mentioned earlier, we have
included exercises at the end of every chapter to bolster
the material in the chapter and incorporate a review of
the chapter’s topics.
Appendix A presents some common UNIX com-
mands. Appendix B covers data dictionary concepts.
Appendix C illustrates the Student-Course tables and
other tables that have been used throughout the book. In
addition, we have provided a glossary of terms and a list
of important commands and functions for your reference.
Overall, we feel that this book is ideal for a beginning
Oracle user to get an overview of what SQL and Oracle

xv
Preface

entails. The book gives a very good “feel” for what Oracle
is and the many ways Oracle can be used.

Supplements
The exercises at the end of each chapter are drawn from
databases that we created and that can be downloaded
from http://www.cs.uwf.edu/~sbagui/. The download
instructions are also available at this web site. The files
can also be downloaded from http://www.wordware.com/
files/sql-oracle.

xvi
Acknowledgments

Our special thanks are due to our editors, Tim McEvoy,


Martha McCuller, and Beth Kohler.
We would also like to thank Dean Jane Halonen,
Interim President Judy Bense, and Interim Provost
Chula King for their inspiration, encouragement, support,
and true leadership. We would also like to express our
gratitude to Dr. Richard Podemski on the same endeavor.
Our sincere thanks also go to Dr. Leo TerHaar, chair,
Computer Science Department, for his advice, guidance,
and support, and encouraging us to complete this book,
and Dr. Norman Wilde and Dr. Ed Rodgers for their con-
tinuing support and encouragement throughout past
years. And, last but not least, we would like to thank our
fellow faculty members and Diana Walker for their con-
tinuous support.

— Richard Earp and Sikha Bagui

xvii
This page intentionally left blank.
Prologue |

Prologue

The Software
Engineering Process
and Relational
Databases

This chapter is provided for those readers who wish to


study SQL and database topics but feel that they lack suf-
ficient relational database background. It is not intended
to replace a course about databases; a theoretical data-
base course is often taught concurrently with a study of
this material.
We begin with some preliminary definitions and a
short history of databases; this material is followed by a
description of how and why the relational database model
fits into the database world of today. We then delve into a
more detailed description of relational databases and nor-
mal forms. Finally, we provide a brief explanation of
software engineering. Some knowledge of how software

1
Discovering Diverse Content Through
Random Scribd Documents
knowledge and instructed others, and read the Qurʾān. He will be brought
into the presence of God, and will be given to understand the benefits he
had received, which he will be sensible of and acknowledge; and God will
say, ‘What didst thou do in gratitude thereof?’ He will reply, ‘I learned
knowledge and taught others, and I read the Qurʾān to please Thee.’ Then
God will say, ‘Thou liest, for thou didst study that people might call thee
learned, and thou didst read the Qurʾān for the name of the thing.’ Then
God will order him to be dragged upon his face and precipitated into hell.
The third, a man to whom God shall have given abundant wealth; and he
shall be called into the presence of God, and will be reminded of the
benefits which he received, and he will acknowledge and confess them; and
God will say, ‘What return didst thou in return for them?’ He will say, ‘I
expended my wealth to please thee, in all those ways which Thou hast
approved.’ God will say, ‘Thou liest, for thou didst it that people might
extol thy liberality’; after which he will be drawn upon his face and thrown
into the fire.”

As to the place where they are to be assembled to Judgment, the Qurʾān and
Traditions agree that it will be on the earth, but in what part of the earth is
not agreed. Some say their Prophet mentioned Syria for the place; others, a
white and even tract of land, without inhabitants or any signs of buildings.
Al-G͟ hazzālī imagines it will be a second earth, which he supposes to be of
silver; and others an earth which has nothing in common with ours, but the
name; having, it is possible, heard something of the new heavens and new
earth, mentioned in Scripture (Rev. xxi. 1 ); whence the Qurʾān has this
expression, “on the day wherein the earth shall be changed into another
earth.” (Sūrah xiv. 49 .)

The end of the Resurrection the Muḥammadans declare to be, that they who
are so raised may give an account of their actions, and receive the reward
thereof. And that not only mankind, but the genii and irrational animals also
shall be judged on this great day; when the unhorned cattle shall take
vengeance on the horned, till entire satisfaction shall be given to the
injured.
As to mankind, when they are all assembled together, they will not be
immediately brought to judgment, but the angels will keep them in their
ranks and order while they attend for that purpose; and this attendance,
some say, is to last forty years, others seventy, others three hundred; nay,
some say no less than fifty thousand years, each of them vouching their
Prophet’s authority. During this space they will stand looking up to heaven,
but without receiving any information or orders thence, and are to suffer
grievous torments, both the just and the unjust, though with manifest
difference. For the limbs of the former, particularly those parts which they
used to wash in making the ceremonial ablution before prayer, shall shine
gloriously. And their sufferings shall be light in comparison, and shall last
no longer than the time necessary to say the appointed prayers; but the latter
will have their faces obscured with blackness, and disfigured with all the
marks of sorrow and deformity. What will then occasion not the least of
their pain, is a wonderful and incredible sweat, which will even stop their
mouths, and in which they will be immersed in various degrees, according
to their demerits, some to the ankles only and some to the knees, some to
the middle, some so high as their mouth, and others as their ears. And this
sweat will be provoked not only by that vast concourse of all sorts of
creatures mutually pressing and treading on one another’s feet, but by the
near and unusual approach of the sun, which will be then no farther from
them than the distance of a mile, or (as some translate the word, the
signification of which is ambiguous) than the length of a bodkin. So that
their skulls will boil like a pot, and they will be all bathed in sweat. From
this inconvenience, however, the good will be protected by the shade of
God’s throne; but the wicked will be so miserably tormented with it, also
with hunger and thirst, and a stifling air, that they will cry out, “Lord,
deliver us from this anguish, though thou send us into hell-fire!” What they
fable of the extraordinary heat of the sun on this occasion, the
Muḥammadans certainly borrowed from the Jews, who say that, for the
punishment of the wicked in the Last Day, that planet shall be drawn forth
from its sheath, in which it is now put up, lest it should destroy all things by
its excessive heat.

When those who have risen shall have waited the limited time, the
Muḥammadans believe God will at length appear to judge them,
Muḥammad undertaking the office of intercessor, after it shall have been
declined by Adam, Noah, Abraham, Moses, and Jesus, who shall beg
deliverance only for their own souls. (Mishkāt, book xxiii. ch. xii.) On this
solemn occasion God will come in the clouds, surrounded by angels, and
will produce the books wherein the actions of every person are recorded by
their guardian angels, and will command the prophets to bear witness
against those to whom they have been respectively sent. Then everyone will
be examined concerning all his words and actions, uttered and done by him
in this life; not as if God needed any information in those respects, but to
oblige the person to make public confession and acknowledgment of God’s
justice. The particulars of which they shall give an account, as Muḥammad
himself enumerated them, are: of their time, how they spent it; of their
wealth, by what means they acquired it, and how they employed it; of their
bodies, wherein they exercised them; of their knowledge, what use they
made of it. It is said, however, that Muḥammad has affirmed that no less
than seventy thousand of his followers should be permitted to enter Paradise
without any previous examination; which seems to be contradictory to what
is said above. To the questions, it is said, each person shall answer, and
make his defence in the best manner he can, endeavouring to excuse
himself by casting the blame of his evil deeds on others; so that a dispute
shall arise even between the soul and the body, to which of them their guilt
ought to be imputed: the soul saying, “O Lord, my body I received from
thee; for thou createdst me without a hand to lay hold with, till I came and
entered into this body; therefore punish it eternally, but deliver me.” The
body on the other side will make this apology, “O Lord, thou createdst me
like a stock of wood, having neither hand that I could lay hold with, nor
foot that I could walk with, till this soul, like a ray of light, entered into me,
and my tongue began to speak, my eye to see, and my foot to walk;
therefore punish it eternally, but deliver me.”

But God will propound to them the following parable of the blind man and
the lame man, which, as well as the preceding dispute, was borrowed by the
Muḥammadans from the Jews. (Gemara, Sanhedr., ch. xi.)

A certain king having a pleasant garden, in which were ripe fruits, set two
persons to keep it. One of them was blind, and the other lame, the former
not being able to see the fruit nor the latter to gather it. The lame man,
however, seeing the fruit, persuaded the blind man to take him upon his
shoulders, and by that means he easily gathered the fruit, which they
divided between them. The lord of the garden coming some time after, and
inquiring after his fruit, each began to excuse himself: the blind man said he
had no eyes to see with, and the lame man that he had no feet to approach
the trees. But the king, ordering the lame man to be set on the blind, passed
sentence on and punished them both. And in the same manner will God deal
with the body and the soul. As these apologies will not avail on that day, so
will it also be in vain for anyone to deny his evil actions, since men and
angels and his own members, nay, the very earth itself, will be ready to bear
witness against him.

Though the Muḥammadans assign so long a space for the attendance of the
resuscitated before their trial, yet they tell us the trial itself will be over in
much less time, and, according to an expression of Muḥammad, familiar
enough to the Arabs, will last no longer than while one may milk an ewe, or
than the space between two milkings of a she-camel. Some, explaining
those words so frequently used in the Qurʾān, “God will be swift in taking
an account,” say that he will judge all creatures in the space of half a day,
and others that it will be done in less time than the twinkling of an eye.

At this examination they also believe that each person will have the book
wherein all the actions of his life are written delivered to him, which books
the righteous will receive in their right hand, and read with great pleasure
and satisfaction; but the ungodly will be obliged to take them against their
wills in their left, which will be bound behind their backs, their right hand
being tied up to their necks.

To show the exact Justice which will be observed on this great day of trial,
the next thing they describe is the mīzān or “balance,” wherein all things
shall be weighed. They say it will be held by Gabriel, and that it is of so
vast a size that its two scales, one of which hangs over Paradise, and the
other over hell, are capacious enough to contain both heaven and earth.
Though some are willing to understand what is said in the Qurʾān
concerning this balance allegorically, and only as a figurative representation
of God’s equity, yet the more ancient and orthodox opinion is that it is to be
taken literally; and since words and actions, being mere accidents, are not
capable of being themselves weighed, they say that the books wherein they
are written will be thrown into the scales, and according as those wherein
the good or the evil actions are recorded shall preponderate, sentence will
be given; those whose balances laden with their good works shall be heavy
will be saved, but those whose balances are light will be condemned. Nor
will anyone have cause to complain that God suffers any good action to
pass unrewarded, because the wicked for the good they do have their
reward in this life, and therefore can expect no favour in the next.

The old Jewish writers make mention as well of the books to be produced at
the last day, wherein men’s actions are registered, as of the balance wherein
they shall be weighed, and the Scripture itself seems to have given the first
notion of both. But what the Persian Magi believe of the balance comes
nearest to the Muḥammadan opinion. They hold that on the day of judgment
two angels, named Mihr and Surush, will stand on the bridge aṣ-Ṣirāt̤ , to
examine every person as he passes; that the former, who represents the
divine mercy, will hold a balance in his hand, to weigh the actions of men;
that according to the report he shall make thereof to God, sentence will be
pronounced, and those whose good works are found more ponderous, if
they turn the scale but by the weight of a hair, will be permitted to pass
forward to Paradise; but those whose good works shall be found light will
be by the other angel, who represents God’s Justice, precipitated from the
bridge into hell.

This examination being past, and everyone’s works weighed in a just


balance, that mutual retaliation will follow, according to which every
creature will take vengeance one of another, or have satisfaction made them
for the injuries which they have suffered. And since there will be no other
way of returning like for like, the manner of giving this satisfaction will be
by taking away a proportionable part of the good works of him who offered
the injury, and adding it to those of him who suffered it. Which being done,
if the angels (by whose ministry this is to be performed) say, “Lord, we
have given to every one his due, and there remaineth of this person’s good
works so much as equalleth the weight of an ant,” God will of his mercy
cause it to be doubled unto him, that he may be admitted into Paradise. But
if, on the contrary, his good works be exhausted, and there remain evil
works only, and there be any who have not yet received satisfaction from
him, God will order that an equal weight of their sins be added unto his, that
he may be punished for them in their stead, and he will be sent to hell laden
with both. This will be the method of God’s dealing with mankind.

As to brutes, after they shall have likewise taken vengeance of one another,
as we have mentioned above, He will command them to be changed into
dust, wicked men being reserved to more grievous punishment, so that they
shall cry out, on hearing this sentence pronounced on the brutes, “Would to
God that we were dust also!”

As to the genii, many Muḥammadans are of opinion that such of them as


are true believers will undergo the same fate as the irrational animals, and
have no other reward than the favour of being converted into dust, and for
this they quote the authority of their Prophet. But this, however, is judged
not so very reasonable, since the genii, being capable of putting themselves
in the state of believers as well as men, must consequently deserve, as it
seems, to be rewarded for their faith, as well as to be punished for their
infidelity. Wherefore some entertain a more favourable opinion, and assign
the believing genii a place near the confines of Paradise, where they will
enjoy sufficient felicity, though they be not admitted into that delightful
mansion. But the unbelieving genii, it is universally agreed, will be
punished eternally, and be thrown into hell with the infidels of mortal race.
It may not be improper to observe that under the denomination of
unbelieving genii the Muḥammadans comprehend also the devil and his
companions.

The trials being over and the assembly dissolved, the Muḥammadans hold
that those who are to be admitted into Paradise will take the right-hand way,
and those who are destined to hell-fire will take the left, but both of them
must first pass the bridge, called in Arabic aṣ-Ṣirāt̤ , which they say is laid
over the midst of hell, and described to be finer than a hair and sharper than
the edge of a sword; so that it seems very difficult to conceive how anyone
shall be able to stand upon it, for which reason most of the sect of the
Muʿtazilites reject it as a fable, though the orthodox think it a sufficient
proof of the truth of this article that it was seriously affirmed by him who
never asserted a falsehood, meaning their Prophet; who, to add to the
difficulty of the passage, has likewise declared that this bridge is beset on
each side with briars and hooked thorns, which will, however, be no
impediment to the good, for they shall pass with wonderful ease and
swiftness, like lightning, or the wind, Muḥammad and his Muslims leading
the way, whereas the wicked, what with the slipperiness and extreme
narrowness of the path, the entangling of the thorns, and the extinction of
the light which directed the former to Paradise, will soon miss their footing,
and fall down headlong into hell, which is gaping beneath them.

RETALIATION. [qisas.]

REUBEN. Heb. ‫‏ְר אּוֵבן‬‎Reubain. Jacob’s first-born son. Referred to in the


Qurʾān, Sūrah xii. 10 : “A speaker from amongst them said, ‘Slay not
Joseph, but throw him into the bottom of the pit: some of the travellers may
pick him up.’”

Al-Baiẓāwī, the commentator, says the name of Joseph’s oldest brother was
either Yahūẕā, or Rūbīl. Josephus gives the name as Roubel, and explains it
as the “pity of God.” (Ant. i. 19, s. 8.)

REVELATION. [inspiration, prophets.]

REVENGE. [qisas.]
RIBĀ ( ‫ربا‬‎ ). “Usury.” A term in Muslim law defined as “an excess
according to a legal standard of measurement or weight, in one or two
homogeneous articles opposed to each other in a contract of exchange, and
in which such excess is stipulated as an obligatory condition on one of the
parties without any return.”

The word ribā appears to have the same meaning as the Hebrew ‫‏ֶנֶׁשְך‬‎
neshec, which included gain, whether from the loan of money, or goods, or
property of any kind. In the Mosaic law, conditions of gain for the loan of
money or goods were rigorously prohibited. See Exod. xxii. 25 ; Lev. xxv.
36 . [usury.]

RIBĀT̤ ( ‫رباط‬‎ ). A station or fort on the frontier of an enemy’s country,


erected for the accommodation of Muslim warriors (Hamilton’s Hidāyah,
vol. ii. p. 357.)

RICHES. Arabic daulah ( ‫دولة‬‎), Qurʾān lix. 7, māl (‫مال‬‎), kas̤ ratu ʾl-
māl (‫كثرة المال‬‎ ), “Great wealth.” Muḥammad is related to have
said, “Whoever desires the world and its riches in a lawful manner, in order
to withhold himself from begging, or to provide a livelihood for his family,
or to be kind to his neighbours, will appear before God in the Last Day with
his face as bright as a full moon. But whoever seeks the riches of the world
for the sake of ostentation, will appear before God in his anger. (Mishkāt,
book xxii. ch. xxiii.)
In the Qurʾān it is said:—

Sūrah xviii. 44 : “Wealth (māl) and children are an adornment of this


world, but enduring good works are better with thy Lord as a recompense,
and better as a hope.”

Sūrah viii. 28 : “Know that your wealth and your children are but a
temptation.”

In the iiird Sūrah, 12, 13 , the possessions of this world are contrasted with
those of the world to come in the following language: “Seemly unto men is
a life of lusts, of women, and children, and hoarded talents of gold and
silver, and of horses well-bred, and cattle, and tilth:—that is the provision
for the life of this world; but God, with Him is the best resort. Say, ‘But
shall we tell you of a better thing than this?’ For those who fear are gardens
with their Lord, beneath which rivers flow; they shall dwell therein for aye,
and pure wives and grace from God; the Lord looks on His servants, who
say, ‘Lord, we believe; pardon Thou our sins and keep us from the torment
of the fire,’—upon the patient, the truthful, the devout, and those who ask
for pardon at the dawn.”

RIKĀZ ( ‫ركاز‬‎). Treasures buried in the earth, particularly those treasures


which have been buried at some remote period.

In the Hidāyah, the word rikāz includes kanz, “treasure,” or other property
buried in the earth, and maʿdin, “mines.” Such treasures are subject to a
zakāt of a fifth. (Hamilton’s Hidāyah, vol. i. p. 39.)

RINGS. Arabic k͟ hātim ( ‫خاتم‬‎ ), pl. k͟ hawātim. Silver signet-rings are


lawful, but a gold ring is not allowed. (See Ṣaḥīḥu ʾl-Buk͟ hārī, p. 871.)
Ibn ʿUmar says, “The Prophet took a gold ring and put it on his right hand,
but he afterwards threw it away, and took a silver ring, on which was
engraved Muḥammadun Rasūlu ʾllāh, i.e. ‘Muḥammad the Messenger of
God,’ and he said, ‘Let none of you engrave on your ring like mine.’ And
when he wore the ring he used to have the signet under his finger and close
to the palm of his hand.” ʿAlī says the ring was on the little finger of the left
hand, and that Muḥammad forbade a ring being worn upon the fore or
middle finger.

Anas says the Prophet’s ring was of silver and on his right hand.

Modern Muslims usually wear a silver ring on the little finger of the right
hand, with a signet of cornelian or other stone, upon which is engraved the

wearer’s name, with the addition of the word ʿabdu ( ‫عبد‬‎ ), “His servant,”
meaning the servant or worshipper of God. This signet-ring is used for
signing documents, letters, &c. A little ink is daubed upon it with one of the
fingers, and it is pressed upon the paper—the person who uses the ring
having first touched the paper with his tongue and moistened the place upon
which the impression is to be made. There is no restriction in Muslim law
regarding rings for women. They are generally of gold, and are worn on the
fingers, in the ears, and in the nose.

RIQQ ( ‫رق‬‎). The servitude of a slave. [slavery.]

RISĀLAH ( ‫رسالة‬‎). Apostleship. The office of an apostle or prophet.


[prophets.]
RISING UP. Arabic qiyām ( ‫قيام‬‎ ). It is a subject of discussion amongst
students of the Traditions, as to whether or not it is incumbent on a Muslim
to rise up when a visitor or stranger approaches.

Abū Umāmah says: “The Prophet came out of his house leaning on a stick,
and we stood up to meet him, and he said, ‘Do not stand up like the
Gentiles who give honour to others.’ ”

Anas says: “There was no one more beloved by the Companions than the
Prophet; but when they saw him, they used not to rise, for they knew he
disliked it.”

Abū Hurairah says: “The Prophet used to sit with us in the mosque and talk,
and when he rose up, we also rose, and remained standing till we saw him
enter his house.”

The general practice amongst Muḥammadans is according to the last


tradition, but it is held to be very overbearing for a person to require others
to rise for him.

Muʿāwiyah says that “the Prophet said, ‘He who is pleased at other people
rising for him, does but prepare a place for himself in the fire of hell.’”
(Mishkāt, book xxii. ch. iv.) [salutation.]

RITES. Arabic mansak, mansik ( ‫منسك‬‎ ), pl. manāsik. The rites and
ceremonies attending religious worship in general. Qurʾān, Sūrah xxii. 35 :
“To every nation we appointed rites (mansak) to mention the name of God
over the brute beasts which he has provided for them.
The term mansik is more frequently used for a place of sacrifice, while
mansak applies to religious observances, but the plural manāsik is common
to both, and rendered by Professor Palmer and Mr. Rodwell in their
translations of the Qurʾān, “rites.”

The principal rites of the Muslim religion are the Hajj, or Pilgrimage to
Makkah, with the ceremonies at the Makkan Temple [hajj]; the daily ritual
of the liturgical prayers [prayer]; the marriage and funeral ceremonies; and,
with the Shīʿahs, the ceremonies of the Muḥarram. The sacrifice on the
great festival, although primarily part of the Makkan Pilgrimage
ceremonies, is celebrated in all parts of Islām on the ʿĪdu ʾl-Aẓḥā, or Feast
of Sacrifice. [idu ʾl-azha.] The ceremony of Ẕikr can hardly be said to be
one of the rites of orthodox Islām, although it is common in all parts of the
Muslim world; it belongs rather to the mystic side of the Muḥammadan
religion. [sufi, zikr.]

RIVER. Arabic nahr ( ‫نهر‬‎ ), pl. anhār; Heb. ‫‏ָנָהר‬‎nahar. The word ‫بحر‬‎
baḥr, “sea,” being also used for a large river. [sea.]

According to Muḥammadan law rivers are of three descriptions:

1. Those which are not the property of any, and of which the waters have
not been divided, like the Tigris and the Euphrates. The care of these rivers,
being the duty of the State, and the charge of keeping them in order must be
defrayed from the public treasury, but these expenses must be disbursed
from the funds of tribute and capitation-tax, and not from those of tithe and
alms.

2. Rivers which are appropriated and divided, and yet at the same time
public rivers on which boats sail. The clearing of such rivers must be done
at the expense of the proprietors, although its waters are used for the public
benefit.
3. Water-courses which are held in property and divided, and on which no
boats sail. The keeping of such streams rests entirely with the proprietors.

In countries where much of the cultivation of land depends upon irrigation,


the right to water, or as it is called in Arabic shirb, is a subject of much
litigation, and chapters are devoted to the consideration of the subject in the
Hidāyah, Fatāwā-i-ʿAlamgīrī, Durru ʾl-Muk͟ htār, and other works on
Muslim law.

For the Rivers of Paradise, see eden.

RIWĀYAH ( ‫رواية‬‎ ). Relating the words of another. A word used for both
an ordinary narrative, and also for an authoritative tradition. [tradition.]

RIYĀʾ ( ‫رياء‬‎). “Hypocrisy; dissimulation.” Condemned in the Qurʾān.


Sūrah ii. 266 : “O ye who believe! make not your alms void by reproaches
and injury, like him who spendeth his substance to be seen of men, and
believeth not in God, and in the Last Day, for the likeness of such an one is
that of a rock with a thin soil upon it, on which rain falleth, but leaveth it
hard.”

Sūrah iv. 41, 42 : “We have made ready a shameful chastisement for the
unbelievers, and for those who bestow their substance in alms to be seen of
men, and believe not in God and in the Last Day.”
RIẒĀʿ ( ‫رضاع‬‎ ). A legal term, which means sucking milk from the breast
of a woman for a certain time. The period of fosterage. [fosterage.]

RIẒWĀN ( ‫رضوان‬‎). The name of the gardener or keeper of Paradise.

ROAD OF GOD. Arabic sabīlu ʾllāh ( ‫سبيل هللا‬‎ ). An expression


used in the Qurʾān and Traditions for any good act, but especially for
engaging in a religious war. [sabilu ʾllah.]

ROMAN. [greeks.]

ROSARY. Arabic subḥah ( ‫سبحة‬‎ ). The rosary amongst


Muḥammadans consists of 100 beads, and is used by them for counting the
ninety-nine attributes of God, together with the essential name Allāh [god];
or the repetition of the Tasbīḥ (“O Holy God!”), the Taḥmīd (“Praised be
God!”), and the Takbīr (“God is Great!”), or for the recital of any act of

devotion. It is called in Persian and in Hindūstānī the Tasbīḥ ( ‫تسبيح‬‎).


The introduction of the rosary into Christendom in ascribed by Pope Pius
V., in a Bull, a.d. 1596, to Dominic, the founder of the Black Friars (a.d.
1221), and it is related that Paul of Pherma, an Egyptian ascetic of the
fourth century, being ordered to recite 300 prayers, collected as many
pebbles which he kept in his bosom, and threw out one by one at every
prayer, which shows that the rosary was probably not in use at that period.

ʿAbdu ʾl-Ḥaqq, the commentator on the Mishkātu ʾl-Maṣābiḥ, says that in


the early days of Islām the Muḥammadans counted God’s praises on small
pebbles, or on the fingers, from which the Wahhābīs maintain that their
Prophet did not use a rosary. It seems probable that the Muslims borrowed
the rosary from the Buddhists, and that the Crusaders copied their Muslim
opponents and introduced it into Christendom.

ROZAH ( ‫روزه‬‎ ). The Persian word for the Arabic ṣaum, or fasting.
[fasting, ramazan.]

RUBʿ ( ‫ربع‬‎ ). A fourth. A legal term used in Muḥammadan law, e.g. “a


fourth,” or the wife’s portion when her husband dies without issue.
RUḤ ( ‫روح‬‎ ), pl. arwāḥ; Heb. ‫‏רּוַח‬‎ruakh, “spirit; soul; life.” Ibnu ʾl-As̤ īr,
author of the Nihāyah, says it is the nervous fluid or animal spirit. A
vaporous substance, which is the principle of vitality and of sensation, and
of voluntary motion.

In the Kitābu ʾt-Taʿrifāt, it is defined as a subtle body, the source of which


is the hollow of the corporeal heart, and which diffuses itself into all the
other parts of the body by means of the pulsing veins and arteries. See also
Gen. ix. 4 : “Flesh with the life thereof, which is the blood thereof.” Many
of the ancients believed the soul to reside in the blood. (See Virgil’s Æn., ix.
p. 349.) The breath which a man breathes and which pervades the whole

body. Called in Persian jān ( ‫جان‬‎). The philosophers say it is the blood,
by the exhausting of which life ceases. The word is generally rendered in
Hindūstānī as of the feminine gender, but Arabic authors render it as often
masculine as feminine. (See Lane’s Arabic Dictionary, in loco.)

In the Qurʾān the word is sometimes used for Jesus, who is known as Rūḥu
ʾllāh (“the Spirit of God”), for the angel Gabriel, and also for life, grace,
soul, and the Spirit of Prophecy. (A complete list of texts is given in the
article spirit.)

According to the Kitābu ʾt-Taʿrīfāt, p. 76, spirit is of three kinds:—

(1) Ar-Rūḥu ʾl-Insānī ( ‫الروح االنسانى‬‎ ), “the human spirit,” by


which is understood the mind of man, which distinguishes him from the
animal, and which is given to him, by the decree of God, from heaven, of
the true essence of which we know nothing. It is this spirit which is
sometimes united to the body and sometimes separated from it, as in sleep
or death.
(2) Ar-Rūḥu ʾl-Ḥaiwānī ( ‫الروح الحيوانى‬‎ ), “the animal spirit,” by
which is understood the life, the seat of which is in the heart, and which
moves in the veins with the pulsations of the body.

(3) Ar-Rūḥu ʾl-Aʿz̤ am, ( ‫الروح االعظم‬‎ ), “the exalted spirit,” that
human spirit which is connected with the existence of God, but the essence
of which is unknown to all but the Almighty. The spiritual faculty in man. It
is called also al-ʿAqlu ʾl-Awwal, “the first intelligence”; al-Ḥaqīqatu ʾl-
Muḥammadīyah, “the essence of Muḥammad”; an-Nafsu ʾl-Wāḥidah, “the
single essence”; al-Ḥaqīqatu ʾl-Samāwīyāh, “The original spirit of man first
created by God.”

The following terms are also found in Muslim works:—

Ar-Rūḥu ʾn-Nabātī ( ‫الروح النباتى‬‎), “the vegetable spirit.”


Ar-Rūḥu ʾt̤ -T̤ abiʿī ( ‫الروح الطبعى‬‎), “the animal spirit.”
Ar-Rūḥu ʾl-Ilāhī ( ‫الروح اللهى‬‎), “the divine spirit.”
Ar-Rūḥu ʾs-Suflī ( ‫)الروح السفلى‬, “the lower spirit,” which is
said to belong merely to animal life.

Ar-Rūḥu ʾl-ʿUlwī ( ‫الروح العلوى‬‎), “the lofty or heavenly spirit.”


Ar-Rūḥu ʾl-Jārī ( ‫الروح الجارى‬‎ ), “the travelling spirit,” or that
which leaves the body in sleep and gives rise to dreams.

Ar-Rūḥu ʾl-Muḥkam ( ‫الروح المحكم‬‎ ), “the resident spirit,” which


is said never to leave the body, even after death.
Rūḥu ʾl-Ilqāʾ (‫روح االلقاء‬‎ ), “the spirit of casting into.” Used for
Gabriel and the spirit of prophecy. [spirit.]

ar-RŪḤU ʾL-AMĪN ( ‫الروح االمين‬‎ ). “The faithful spirit.” Occurs


in the Qurʾān, Sūrah xxvi. 193 : “Verily from the Lord of the Worlds hath
this book come down; the faithful spirit hath come down with it upon thy
heart, that thou mayest become a warner in the clear Arabic tongue.” It is
supposed to refer to the Angel Gabriel. [spirit.]

RŪḤU ʾLLĀH ( ‫روح هللا‬‎ ). “The Spirit of God.” According to


Muḥammad, it is the special Kalimah, or title of Jesus. See the Qurʾān.

Sūratu ʾn-Nisāʾ (iv.), 169 : “The Messiah, Jesus, the son of Mary, is only
an Apostle of God, and His Word, which He conveyed into Mary and a
spirit proceeding from Himself.” (Rūḥun min-hu).

Sūratu ʾl-Ambyāʾ (xxi.), 91 : “Into whom (Mary) we breathed of our


spirit.”

Sūratu ʾt-Taḥrīm (lxvi.), 12 : “Into whose womb we breathed of our


spirit.”

It is also used in the Qurʾān for Adam, Sūratu ʾs-Sajdah (xxxii.), 8 ; Sūratu
ʾl-Ḥijr (xv.), 29 ; and Sūratu Ṣād (xxxviii.), 72 ; where it is said that God
breathed his spirit into Adam, but Adam is never called Rūḥu ʾllāh in any
Muḥammadan book. [spirit, jesus.]
RŪḤU ʾL-QUDUS ( ‫روح القدس‬‎ ). “The Holy Spirit” (lit. “Spirit of
Holiness”). The expression only occurs three times in the Qurʾān:—

Sūrah ii. 81 : “We gave Jesus the Son of Mary manifest signs and aided
him with the Holy Spirit.”

Sūrah ii. 254 : “Of them is one to whom God spoke (i.e. Moses); and we
have raised some of them degrees; and we have given Jesus the son of Mary
manifest signs, and strengthened him by the Holy Spirit.”

Sūrah v. 109 : “When God said, ‘O Jesus, son of Mary! remember my


favours towards thee and towards thy mother, when I aided thee with the
Holy Spirit, till thou didst speak to men in the cradle, and when grown up.’”

Al-Baiẓāwī says the meaning of the expression Rūḥu ʾl-Qudus is the Angel
Gabriel, although some understand it to refer to the spirit of Jesus, and
others to the Gospel of Jesus, whilst some think it is the Ismu ʾl-Aʿz̤ am, or
“the exalted name of God,” whereby Jesus raised the dead. (See Tafsīru ʾl-
Baiẓāwī, p. 65.) [spirit, holy spirit.]

RUINOUS BUILDINGS. The owner of a ruinous wall in any building is


responsible for any accident occasioned by its fall, after having received
due warning and requisition to pull it down, and a person building a
crooked wall is responsible for the damage occasioned by its falling. But
the owner of a ruinous house is not responsible for accidents occasioned by
the fall of any article from it, unless such article belong to him. (Hidāyah,
Grady’s Ed., pp. 664, 665.)
RUK͟ H (‫رخ‬‎ ). The name of a monstrous bird, which is said to have power
sufficient to carry off a live elephant. (G͟ hīyas̤ u ʾl-Lug͟ hah, in loco.)

ar-RUKNU ʾL-YAMĀNĪ ( ‫الركن اليمانى‬‎ ). The Yamānī pillar.


The south corner of the Kaʿbah, said to be one of the most ancient parts of
the temple. [masjidu ʾl-haram.]

Burkhardt says: “In the south-east corner of the Kaʿbah, or as the Arabs call
it, Rokn el Yamany, there is another stone about five feet from the ground; it
is one foot and a half in length, and two inches in breadth, placed upright,
and of the common Meccah stone. This the people walking round the
Kaʿbah touch only with the right hand; they do not kiss it.” (Captain Burton
says he had frequently seen it kissed by men and women.)

Burton remarks: “The Rukn el Yamani is a corner facing the south. The part
alluded to (by Burkhardt) is the wall of the Kaʿbah, between the Shami and
Yemani angles, distant about three feet from the latter, and near the site of
the old western door, long since closed. The stone is darker and redder than
the rest of the wall. It is called El Mustajab (or Mustajab min el Zunub, or
Mustajab el Dua, “where prayer is granted”). Pilgrims here extend their
arms, press their bodies against the building, and beg pardon for their sins.”
(El Medinah and Mecca, vol. ii. p. 160.)

RUKŪʿ ( ‫ركوع‬‎ ). A posture in the daily prayers. An inclination of the


head with the palms of the hands resting upon the knees. [prayers.]
THE RUKUʿ.

RULE OF FAITH. The Muḥammadan rule of faith is based upon what are
called the four foundations of orthodoxy, namely, the Qurʾān, or, as it is
called, Kalāmu ʾllāh, “the Word of God; the Ḥadīs̤ (pl. Aḥādīs̤ ), or the
traditions of the sayings and practice of Muḥammad; Ijmāʿ, or the consent
of the Mujtahidūn, or learned doctors; and Qiyās, or the analogical
reasoning of the learned.

In studying the Muḥammadan religious system, it must be well understood


that Islām is not simply the religion of the Qurʾān, but that all
Muḥammadans, whether Sunnī, Shīʿah, or Wahhābī, receive the Traditions
as an authority in matters of faith and practice. The Sunnī Muḥammadans
arrogate to themselves the title of traditionists; but the Shīʿahs also receive
the Ḥadīs̤ as binding upon them, although they do not acknowledge the
same collection of traditions as those received by their opponents. [qurʾan,
traditions, ijmaʿ, qiyas, religion, islam.]

RULERS. The ideal administration of the Muslim world, as laid down in


the Traditions, is that the whole of Islām shall be under the dominion of one
Imām or leader, who is the K͟ halīfah (‫خليفة‬‎ ), or vicegerent, of the
Prophet on earth. The rulers of provinces under this Imām are called Amīr

‫امير‬‎
( ) (pl. Umarāʾ). The Eastern titles of Sult̤ ān and Shāh are not
established in the Muḥammadan religion. The word Malik, Heb. ‫‏ֶמֶלְך‬‎
Melekh, occurs in the Qurʾān for a “king” and is used for King Saul (Sūrah
ii. 248 ). The word is still retained in Asia for the chiefs of villages.

In the Qurʾān (Sūrah iv. 62 ), believers are enjoined to “obey the Apostle
and those in authority,” but the chief injunctions are found in the Traditions.

In the Mishkātu ʾl-Maṣābiḥ, book xvi. ch. i., the following sayings of
Muḥammad regarding rulers are recorded:—

“Whoever obeys me obeys God, and whoever disobeys me disobeys God.


Whoever obeys the Amīr obeys me. An Imām is nothing but a shield to
fight behind, by which calamities are avoided; and if he orders you to
abstain from that which is unlawful, he will have great regard; but if he
enjoins that which God has forbidden, he will bear the punishment of his
own acts.”

“If God appoints as your Amīr a man who is a slave, with his ears and nose
cut off, and who puts people to death according to God’s book, then you
must listen and obey him in all things.”

“If a negro slave is appointed to rule over you, you must listen to him and
obey him, even though his head be like a dried grape.”

“It is indispensable for every Muslim to listen to and approve the orders of
the Imām, whether he likes or dislikes, so long as he is not ordered to sin
and act contrary to law. When he is ordered to sin, he must neither attend to
it nor obey it.”

“There is no obedience due to sinful commands, nor to any order but what
is lawful.”
“He who shall see a thing in his ruler which he dislikes, let him be patient,
for verily there is not one who shall separate a body of Muslims the breadth
of a span, and he dies, but he dies like the people of ignorance.”

“The best Imāms are those you love, and those who love you, and those
who pray for compassion on you, and you on them; and the worst of Imāms
are those you hate, and those who hate you; and those whom you curse, and
who curse you. Auf said, “O Prophet of God! when they are our enemies
and we theirs, may we not fight against them?” He said, “No, so long as
they keep on foot the prayers amongst you.” This he repeated. “Beware, he
who shall be constituted your ruler, see if he does anything in disobedience
to God, and if he does, hold it in displeasure, but do not withdraw
yourselves from his obedience.”

“There will be Amīrs among you, some of whose actions you will find
conformable to law, and some contrary thereto; then when anyone who
shall say to their faces, ‘These acts are contrary to law,’ verily he shall be
pure; and he who has known their actions to be bad, and has not told them
so to their faces, has certainly not remained free from responsibility, and he
who has seen a bad act and obeyed it, is their companion in it.” The
Companions said, “May we not fight them?” The Prophet said, “No, so long
as they perform prayers.”

“He who is disobedient to the Imām will come before God on the Day of
Resurrection without a proof of his faith, and he who dies without having
obeyed the Imām, dies as the people of ignorance.”

“Prophets were the governors of the children of Israel, and when one died,
another supplied his place; and verily there is no prophet after me, and the
time is near when there will be after me a great many K͟ halīfahs.” The
Companions said, “Then what do you order us?” The Prophet said, “Obey
the K͟ halīfah, and give him his due; for verily God will ask about the duty of
the subject.”

“When two K͟ halīfahs have been set up, put the last of them to death, and
preserve the other, because the second is a rebel.”
“Whoever wishes to make divisions amongst my people, kill with a sword.”

“He who acknowledges an Imām must obey him as far as in his power, and
if another pretender comes, kill him.”

“Verily the time is near that you will be ambitious of ruling; and it is at
hand that this love of rule will be a cause of sorrow at the Resurrection,
although the possession of it appears pleasant, and its departure
unpleasant.”

“That is the best of men who dislikes power.”

“Beware! you are all guardians of the subject, and you will all be asked
about your obedience. The Imām is the guardian of the subject, and he will
be asked respecting this. A man is as a shepherd to his own family, and will
be asked how they behaved, and about his conduct to them; and a wife is a
guardian to her husband’s house and children and will be interrogated about
them; and a slave is a shepherd to his master’s property, and will be asked
about it, whether he took good care of it or not.”

“There is no Amīr who oppresses the subject and dies, but God forbids
Paradise to him.”

“Verily the very worst of Amīrs are those who oppress the subject.”

“O God! he who shall be ruler over my people and shall throw them into
misery, O God! cast him into misery; and he who shall be chief of my
people and be kind to them, then be kind to him.”

“Verily, just princes will be upon splendid pulpits on the right hand of God;
and both God’s hands are right.”

“God never sent any Prophet, nor ever made any K͟ halīfah, but had two
counsellors with him, one of them directing lawful deeds (that is, a good
angel), and the other sin (that is, the devil). He is guarded from sin whom
God has guarded.” [khalifah.]
ar-RŪM ( ‫الروم‬‎ ). The Arabic form of the Latin Roma, or Romanus. The
ancient Byzantine, or Eastern Roman Empire. Still used in Eastern
countries as a name for the Turkish Empire.

The title of the xxxth Sūrah of the Qurʾān, which opens with the word.
“The Greeks are overcome in the highest parts of the land; but after being
overcome they shall overcome in a few years.” [greeks.]

RUQAIYAH ( ‫رقية‬ ). A daughter of Muḥammad by his wife K͟ hadījah.


She was married to ʿUtbah, the son of Abū Lahab, but being divorced by
her husband, she was married to ʿUs̤ mān, the third K͟ halīfah.

RUQBĀ ( ‫رقبى‬‎ ). Lit. “Waiting.” Giving a thing on condition that if the


donor die before the receiver it shall become the property of the receiver
and his heirs; but if the receiver die first, the property given shall return to
the donor. It is forbidden in Muslim law, because it exposes each of the
parties to the temptation of wishing for the other’s death.

RUQYAH ( ‫رقية‬‎ ). “Enchanting.” The use of spells. The word used in the
Ḥadīs̤ for exorcism and incantation. [exorcism.]
RŪYĀʾ ( ‫روياء‬‎ ). “A dream; a vision. A term used in the Qurʾān for the
visions of the Prophets. It occurs five times. Once for the vision of Joseph
(Sūrah xii. 5 ); twice for the dream of the Egyptian king (Sūrah v. 43 );
once for the vision of Abraham (Sūrah xxxvii. 105 ); once for
Muḥammad’s vision (Sūrah xvii. 62 .). [dreams.]
S.
ṢĀʿ (‫صاع‬‎ ) or ṢUWĀʿ ( ‫صواع‬‎ ). A certain measure used for measuring
corn, and upon which depend the decisions of Muslims relating to measures
of capacity. It occurs in the Qurʾān, Sūrah xii. 72 , for the drinking-cup
placed by Joseph in his brother’s pack.

The compiler of the Tāju ʾl-ʿArūs, says that according to five different
readers of the Qurʾān, it is given ṣuwāʿ in that verse, but in the majority of
texts it is ṣāʿ.

The Qāmūs explains ṣuwāʿ as a certain vessel from which one drinks, and
ṣāʿ, a measure of capacity. Its invariable measure being, according to
ancient authorities, four times the quantity of corn that fills two hands of a
man of moderate size.

Al-Baiẓāwī records, besides ṣuwāʿ and ṣāʿ, the reading ṣauʿ and ṣuwāg͟ h.

SABAʾ ( ‫سبا‬‎ ). (1) A tribe of Yaman, whose dwelling-places are called


Maʾrib, mentioned in the xxxivth Sūrah of the Qurʾān (entitled the Sūratu
Sabaʾ), verse 14:—

“A sign there was to Sabaʾ in their dwelling places:—two gardens, the one
on the right hand and the other on the left:—‘Eat ye of your Lord’s supplies,
and give thanks to him: Goodly is the country, and gracious is the Lord!’

“But they turned aside: so we sent upon them the flood of Iram; and we
changed them their gardens into two gardens of bitter fruit and tamarisk and
some few jujube trees.

“Such was our retribution on them for their ingratitude.”

M. Caussin de Perceval, Hist. des Arabes, vol. iii., as well as M. de Sacy,


fix this event in the second century of the Christian era.

(2) Also the name of a province referred to in the Qurʾān, Sūrah xxvii. 21 ,
where it seems to be identical with the Sheba ‫‏ֵׁשָבא‬‎of the Bible, or the
country of the Queen of Sheba:—

“Nor tarried it (the lapwing) long ere it came and said, ‘I have gained the
knowledge that thou knowest not, and with sure tidings have I come to thee
from Sabaʾ:

“ ‘I found a woman reigning over them, gifted with everything, and she hath
a splendid throne;

“And I found her and her people worshipping the sun instead of God; and
Satan hath made their works fair seeming to them, so that he hath turned
them from the Way: wherefore they are not guided,

“To the worship of God, who bringeth to light the secret things of heaven
and earth, and knoweth what men conceal and what they manifest:

“God: there is no god but He! the lord of the glorious throne!”

For a discussion of the identity of the Sabaʾ of Arabia with the Sheba of the
Bible, refer to the word Sheba in Smith’s Dictionary of the Bible.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like