0 ratings0% found this document useful (0 votes) 86 views6 pagesSQL Ex
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Two-Minute Drill 45
JY TWO-MINUTE DRILL
Position the Server Technologies
The Oracle database stores and manages access to us
The Oracle Application Server runs applications that
database.
Oracle Enterprise Manager isa tool for managing dats
and, ifdesied, the entire computing environment,
Languages buile into the database for application dev.
PLISQL, and Java.
Understand Relational Structures
Data must be normalized into two-dimensional tables.
Tables are linked through primary and foreign keys.
Summarize the SQL Language
The DML commands are SELECT, INSERT, UPDATE,
The DDL commands are CREATE, ALTER, DROP, RE}
and COMMENT.
The DCL commands are GRANT and REVOKE.
The TCL commands are COMMIT, ROLLBACK, and Si
Use the Client Tools | \
G SQL*Plus is a command-line utility installed into the O
SQL Developer is a graphical tool installed into its own.
Both tools require a database connection, consisting of a
and a connect identifier.
Create the Demonstration Schemas _
The demonstration schemas are provided by Oracle to:
must be created before they can be use46 Chapter |: Oracle Server Technologies and the Relational Paradigm,
SELF TEST
Position the Server Technologies
1. What components of the IT environment can Oracle Enterprise Manager Grid Control
manage? (Choose the best answer.)
Oracle databases
Oracle application servers
‘Third-party products
‘The server machines
Allof the above
mone>
2. What languages can run within the database? (Choose all that apply.)
A SQL
c
PLISQL
Java
Any other language linked to the OCI libraries
mone
Understand Relational Structures
3. Data that is modeled into a form suitable for processing in a relational database may be
described as being (Choose the best answer.)
A. Fitst normal form
B. Third normal form
C. Abnormal form
D. Paranormal form
4, An entity-relationship diagram shows data modeled into (Choose the best answer.)
A. Twordimensional tables
B, Multidimensional tables
. Hierarchical structures
D. Objectoriented structuresSelTest 47
Summarize the SQL Language
5.
SQL is a set-oriented language. Which of these features is a consequence of this! (Choose the
best answer.)
A. Individual rows must have a unique identifier,
B. Sets of users can be managed in groups.
C. SQL statements can be placed within blocks of code in other languages, such as Java and
PLISQL.
D. One starement can affect multiple rows.
Which of these constructs is not part of the SQL language? (Choose all chat apply.)
Iteration, based on DO..WHILE
Ieeration, based on FOR.NEXT
Branching, based on IF. THEN. ELSE
‘Transaction control, based on COMMIT.
‘Transaction control, based on ROLLBACK
mOne>
Use the Client Tools
7.
Which of these statements reganding SQL Developer are correct? (Choose two answers.)
A. SQL Developer cannot connect to databases earlier than release 10g.
B. SQL Developer can be installed outside an Oracle Home.
C. SQL Developer can store passwords
BD. SQL Developer relies on an LDAP directory for name resolution,
Which of the following are requirements for using SQL Developer! (Choose two correct
answers.)
A Java Runtime Environment
The OCI libraries
‘A name resolution method such as LDAP or a TNSNAMES.ORA file
‘The SQL*Plus libraries
A graphical terminal
mone>4B Chapter |: Oracle Server Technologies and the Relational Paradigm,
Create the Demonstration Schemas
9. Where may the demonstration schemas be created? (Choose the best answer.)
A. The demonstration schemas must be created in a demonstration database
B._ The demonstration schemas cannot be created in a production database.
C. The demonstration schemas can be created in any database,
D. The demonstration schemas can be created in any database if the demonstration user is
created first
10, How can you move a schema from one user to another! (Choose the best answer)
‘A. Use the ALTER SCHEMA MOVE... command.
You cannot move a schema from one user to another.
A schema can only be moved if tis empty (or ifall objects within it have been dropped)
goe
Ateach the new user to the schema, then detach the old user from the schema.
LAB QUESTION
The OE schema includes these tables:
ml CUSTOMERS
INVENTORIES
ORDERS
ORDER_ITEMS
PRODUCT_DESCRIPTIONS
PRODUCT_INFORMATION
lm WAREHOUSES
A. CUSTOMER can place many ORDERS, and an order can have many ORDER_ITEMS. Each
item will be of one product, described by its PRODUCT_INFORMATION, and each product may
have several PRODUCT_DESCRIPTIONS, in different languages. There are a number of WARE-
HOUSES, each of which can store many products; one product may be stored in many warehouses.
‘An INVENTORIES entry relates products to warehouses, showing how much of each product is in
each warehouse.
Sketch out this schema as an entity-telationship diagram, showing the many-to-one connections
between the tables and ensuring that there are no many-to-many connections.SelTestAnswers 49
SELF TEST ANSWERS
Position the Server Technologies
1. @_E. Grid Control ean manage the complete environment (according to Oracle Corporation).
A.B, C, D. Alllof these can be managed by Grid Conttol
2. DZ A,C,D. SQL, PL/SQL, and Java can all run in the database.
&_B, E. Cannot run inside the database, and OCI is used by extemal processes to connect to
the database; it does not run within it,
Understand Relational Structures
3. ZB, Third normal form is the usual form aimed for by systems analysts when they normalize
data into relational structures
‘A, C, D. A is wrong because first normal form is only the first stage of data normalization.
Cand D would be more suitable to the X-Files than to a database.
4, Q_ A. The relational model uses two-dimensional tables.
B,C, D. Bis wrong because two dimensions is the limit for relational structures. Cand D
are wrong because they refer to nontelational structures (though there are facilities within the
Oracle database for simulating them)
Summarize the SQL Language
5. Z_D. Inasetoriented language, one command can affect many rows (a set), whereas a
procedural language processes rows one by one.
A,B, C. A is wrong because while rows should have a unique a identifier in a well designed
application, this is not actually a requirement. B is wrong because users cannot be grouped in
the Oracle environment. C is wrong because (even though the statement is correct) it is not
relevant to the question,
6 Z_A,B,C. These are all procedural constructions, which are not part ofa set-oriented,
language. They ate all used in PLISQL.
BD, E. These are SQU’ transaction control statements.
Use the Client Tools
7. B,C. Bis correct because SQL Developer can be installed in its own directory. Cis correct
because passwords can be saved as part of a connection definition (though this may not be a
ood idea).
A, D. A is wrong because the Oracle Net protocol lets SQL Developer connect to a
number of versions of the database. D is wrong because LDAP is only one of several techniques
for name resolution.SO Chapter |: Oracle Server Technologies and the Relational Paradigm
8. Z_A,E, Ais correct because SQL Developer is written in Java and therefore requites a Java
Runtime Environment. Eis correct because SQL Developer needs a graphies terminal to display
windows,
B_B,C, D. Bis wrong because SQL Developer uses JDBC to connect to databases, not
CL. Cis wrong because, while SQL Developer can use LDAP ora TNSNAMES.ORA file,
ican also use and store the basic connection details. Dis wrong because SQL Developer is a
completely independent product.
Create the Demonstration Schemas
9. © C. The demonstration schemas can be created in any database, either at database creation
time of by running scripts later.
A,B, D.A and B are wrong because, while they may be good practice, they are not a
technical requitement. D is wrong because it fails to understand that a schema can only be (and
always is) created with a user.
10, B.A schema and a user are inseparable
A,C, D. A is wrong because there is no such command. C and D are wrong because they
assume the impossible: that you can separate a user ftom his or her schema.
LAB ANSWER
Figure 1-12 shows a solution.
‘cusTomens ORDERS ORDER TENS
Anentiy-
reltionship
diagram
PRODUCT
seseribing the OF WAREHOUSES INVENTORIES INFORMATION
schema
PRODUCT
DESCRIPTIONS