Вы находитесь на странице: 1из 6

Appendix A

This appendix describes the lab environment that will be used during the class.

Lab Environment
DBC
UNIX userids uljc01 uljc02 uljcxx

Teradata_Factory AU
Accounts Customer Trans Useful Teradata Commands in BTEQ:
.LOGON tpdid/username HELP SESSION; HELP USER username; HELP 'SQL sqlcommand'; SHOW TABLE tablename; SELECT COUNT(*) FROM tname; DELETE tablename ALL; DROP TABLE tablename; EXEC macroname; .RUN FILE=filename .QUIT - logon to Teradata - displays session information - lists objects owned by user - help for an SQL command - shows table creation syntax - provides count of rows - deletes all rows in a table - drops table from the database - executes a macro - executes a file of commands - exits BTEQ

DS
Orders Orders_2003

PD
Department Employee Emp_Phone Job tljc01
Accounts
Orders

LJC_Students
tljc02
Accounts
Orders

tljcxx
Accounts Orders

Useful UNIX Commands:


ls -l pg (or more) filename vi (or vedit) filename cp file1 file2 mv filename newname rm filename exit - long listing of UNIX files) - view contents of text file - create or edit a text file - copies file1 to file2 - renames a file - delete a file - exits UNIX

AU Tables
AU.Accounts (10,000 Rows)
Account Number Number Street PK UPI 20024010 20031023 20049873 20031134
Integer

City

State

Zip Code

Balance Forward

Balance Current

123 3456 100 10


Integer

Harbor Blvd. 186th St. Western Av. Heather Rd.


Char(25)

Torrance Glendale Las Vegas S. Monica


Char(20)

CA CA NV CA
Char(2)

90323 90451 97345 92345


Integer

1000.00 1500.00 400.00 6020.00


Dec(10,2)

900.00 1700.00 400.00 5312.00


Dec(10,2)

AU.Customer (7,000 Rows)


Customer Number PK UPI Last Name First Name Social Security

AU.Trans (15,000 Rows)


Trans Number PK NUPI Trans Date Account Number Trans ID Trans Amount

13021 18765 11023 1123


Integer

Smith Jones Wilson Omaguchi


Char(30)

George Barbara John Sandra


Char(20)

456788765 987453498 495028367 234904587


Integer

4653 3241 1298 11026


Integer

2002-02-11 2002-02-08 2002-02-08 2002-02-13


Date

20024020 20034567 20024005 20024020


Integer

2009 DEP 2987 DEP


Char(4)

-50.00 160.00 -70.00 20.00


Dec(10,2)

PD Tables
Employee (1000 Rows)
Employee Number PK UPI 100001 100797 100002
Integer

Job (66 Rows)


Job Code FK 3000 3017 3001
Integer

Dept Number FK 1001 1048 1001


Integer

Emp_Mgr Number FK ? 100791 100001


Integer

Last Name

First Name

Salary Amount

Job Code PK UPI

Job Description

DeBosse Myers Smith


Char(20)

Ibee Ruth Steve

200000.00 41000.00 110000.00

3000 3001 3017


Integer

President Senior Mgmt Analyst L2


Char(20)

Varchar(20) Decimal (10,2)

Department (60 Rows)


Dept Number PK Dept Name Dept_Mgr Number FK Budget Amount

Emp_Phone (2000 Rows)


Employee Number Area Code PK Phone Number Extension

UPI
1048 1050 1028
Integer

FK
Design SW Design Services Engineering SW
Char(20)

100791 100811 100441


Integer

1000000.00 1000000.00 3000000.00


Decimal (10,2)

NUPI 100001 100001 100389


Integer

937 937 858


SmallInt

5100001 4100001 4852815


Integer

1001 1001 815


Integer

DS Tables
Orders (3600 Rows)
o_orderid o_custid o_orderstatus o_totalprice o_ordedate o_orderrpriority o_clerk o_shippriority o_comment

PK
UPI 100001 103501 101400

FK,NN
1001 1451 1080 C C C 1,005.00 1,005.00 1,150.00 2000-01-02 2002-12-01 2001-02-28 10 10 10 Jack .. Dee ... Fred ... 20 20 20 In Stock In Stock In Stock

Integer

Integer

CHAR(1)

Decimal (10,2)

Date

SmallInt

Char(16)

SmallInt

Varchar(79)

Orders_2003 (1200 Rows) - Same Layout

vi (or vedit) Commands


vi filename vedit filename

Movement and other


h j k l space w b 0 $ G nG ^f ^b ^l /str . move cursor to left move cursor down a line move cursor up a line move cursor to right move cursor to right move a word to right move a word to left go to start of a line (zero) go to end of a line go to end of file go to line n scroll forward 1 screen scroll back 1 screen refresh the screen search forward for str repeat last command

Modification
r x X 5x dw dd d$ dG cw C J yy 3yy p P u replace 1 character delete char under cursor delete char before cursor delete 5 characters delete a word delete the line delete the rest of the line delete rest of the file change a word change rest of the line join 2 lines together yank or copy a line yank or copy 3 lines put yanked line(s) after line put yanked line(s) before line undo last command

Input mode
i I a A o O R insert before cursor insert at beginning of line insert after cursor insert at end of line open a new line below open a new line above Replace mode and insert after <cr> ESC exits input & colon modes

Colon mode
:w :w fname :wq :q! :e fname :r fname :!cmd :set smd write or save the file write new file name write and quit quit and dont save edit another file read in a file run UNIX command set showmode on

Вам также может понравиться