现在的位置: 首页 > 综合 > 正文

http://db.grussell.org 测试答案 1

2013年02月02日 ⁄ 综合 ⁄ 共 2353字 ⁄ 字号 评论关闭
Tutorial 1, page 1 Context: jobs Engine: oracle

To follow this tutorial you need to be able to find tables stored in the database. Each database system has a different way of doing this. In this environment you can type

 CAT;

as an SQL command, and it will show you a list of tables which belong to the database relevent to the question being asked.

Use the cat command to identify the tables which belong to the database used for this question.

cat;
TABLENAME TABLETYPE
course TABLE
department TABLE
empcourse TABLE
employee TABLE
jobhistory TABLE

2

Tutorial 1, page 2 Context: jobs Engine: oracle

The CAT command is strictly a command possible only in this interface, and is not available on standard database systems. Each database system has its own approach. For instance in MySQL, you would type the command "show tables".

The main database for these tutorials is an Oracle system. The standard command in Oracle is

SELECT * FROM cat;
            

This command shows all database objects which a particular user has access to. Try the command and see what is produces.

SELECT * FROM cat;

TABLE_NAME TABLE_TYPE
EMPCOURSE SYNONYM
JOBHISTORY SYNONYM
EMPLOYEE SYNONYM
DEPARTMENT SYNONYM
COURSE SYNONYM
CONSTRUCTION SYNONYM
DRESSMAKER SYNONYM
ORDER_LINE SYNONYM
DRESS_ORDER SYNONYM
QUANTITIES SYNONYM
MATERIAL SYNONYM
GARMENT SYNONYM
JMCUST SYNONYM
TCUST SYNONYM
TSHIPD SYNONYM
TSUPL SYNONYM
MOVIE SYNONYM
MUSICIAN SYNONYM
COMPOSER SYNONYM
TSHIP SYNONYM
PERMIT SYNONYM
ROUTE SYNONYM
TRETN SYNONYM
TPURC SYNONYM
TPROD SYNONYM
CASTING SYNONYM
VEHICLE SYNONYM
MSP SYNONYM
RECEIPT SYNONYM
PERFORMER SYNONYM
BAND SYNONYM
BADGUY SYNONYM
PLACE SYNONYM
PLAYS_IN SYNONYM
TOTP SYNONYM
COMPOSITION SYNONYM
CONCERT SYNONYM
SHIPPED SYNONYM
TSTCK SYNONYM
TDLVR SYNONYM
CIA SYNONYM
HAS_COMPOSED SYNONYM
CAMERA SYNONYM
PARTY SYNONYM
IMAGE SYNONYM
ACTOR SYNONYM
TDLVRD SYNONYM
STOPS SYNONYM
PRODUCT SYNONYM
TPURCD SYNONYM
++ TRUNCATED ++

3

Tutorial 1, page 3 Context: jobs Engine: oracle

Each table in the database has a number of columns. These columns are known as attributes. To list attributes you use the SELECT command, listing all the attribute you are interested in (separated by commas) followed by FROM and then the name of the table. For instance, listing the attributes empno and surname from a table called employee would be:

SELECT empno,surname FROM employee;
            

Notice when you run the SQL the result is shown and then the computer assesses you answer. Make sure it shows 100% correct before trying the next question.

Try listing all course titles (the "cname" attribute) of the table "course".

select cname
from course

CNAME
Basic Accounting
Further Accounting
Issues In Administration
More Administration
Ada
Introduction To Ingres
New Topologies
LANs
Structural Stress Analysis
Taffic Flow Analysis

抱歉!评论已关闭.