Lab 1

Thursday, August 22

Topic: Connet to Oracle from PUCC PCs and Play MS Access.


Use your curator account to login PC.

To change the password of your curator account, please telnet curator.cc.purude.edu and use the command passwd to change it.


How to connect to Oracle from a PUCC PC:

The following procedure is out-dated.
Please check here to see how to connect to PUCC PCs.

  1. From "Applications" window, select "File Manager",

  2. From "File Manager" window, activate driver K,

  3. Select and click "course" on the left,
    double click "plus31.exe" on the right,

  4. Two windows appear: "Oracle SQL*Plus" and "Log on",
    From "Log on" window, input your Oracle login name and password,
    in "Host string", input csdb

  5. If SQL> appears in "Oracle SQL*Plus" window, Oracle is connected successfully. Otherwise, you should try again.

  6. Change your password of Oracle account:

    SQL> alter user your_login_name identified by new_password;

  7. Try the following Oracle commands:
    
    SQL> remark  this is a comment line, not an instruction
    
    SQL> -- another kind of comment line 
    
    SQL> /* another kind of comment line */
    
    SQL> /* Now let us test some Oracle's functions using DUAL 
            DUAL is a tiny table Oracle provides with only one
            row and one column in it. Try it!  */
    
    SQL> select SysDate from DUAL;
    
    SQL> select 2+3 from DUAL;
    
    SQL> select 10-4 from DUAL;
    
    SQL> select 23*4 from DUAL;
    
    SQL> select 4.5/3 from DUAL;
    
    SQL> select power(4,3) from DUAL;
    
    SQL> select ABS(-34.5) from DUAL;
    
    SQL> select CEIL(23.8) from DUAL;
    
    SQL> select cos(39.4) from DUAL;
    
    SQL> select exp(2) from DUAL;
    
    SQL> select LOG(2, 4) from DUAL;
    
    SQL> select ROUND(99.308, -1) from DUAL;
    
    SQL> select sqrt(36) from DUAL;
    
    SQL> select greatest(1, 2, 3, 4) from DUAL;
    
    SQL> select least(1, 2, 3, 4) from DUAL;
    
    SQL> /* Please see page 143 for details */
    
    SQL> select * from user_tables;
    
    SQL> /* If you did not created tables, it will prompt
            no rows selected  */
    
    SQL> /* There are some tables under TA's account. 
            Please try the following commands */
    
    SQL> select * from yfeng.employee;
    
    SQL> select * from yfeng.department;
    
    SQL> select * from yfeng.dept_locations;
    
    SQL> select * from yfeng.works_on;
    
    SQL> select * from yfeng.project;
    
    SQL> select * from yfeng.dependent;
    
    SQL> list;  /* list the last SQL command */
    
    SQL> /    /* repeat the last SQL command */
    
    SQL> /* Use describe command to see the defination of a table */
    
    SQL> describe yfeng.employee;
    
    SQL> describe yfeng.department;
    
    SQL> describe yfeng.dept_locations;
    
    SQL> describe yfeng.works_on;
    
    SQL> describe yfeng.project;
    
    SQL> describe yfeng.dependent;
    
    SQL> /* Use editor in SQL  */
    
    SQL> edit myfile.sql
    
    SQL> /* This file can be saved only under your directory.
            When you want to save this file, double click k:/
            then double click student and find your directory to 
            save it.   */ 
    
    
  8. Quit Oracle
    SQL> quit;
    

We will use SQL to create tables, insert records, select from tables, delete records (or rows), or drop table. Details will be discussed in class. Once these commands are discussed in class, we will practice them in lab.


Play MS Access

Microsoft Access is a DBMS running on MS windows.

From "Applications" window, select "Access 2.0". Please read the on-line help file "Cue Card" first, then try to play it. Once Professor explains some basic database concepts, we will work on the first project using MS Access.

There is a sample database under n:\dos\msoffice.43\access\sampaps\. To open it, select "open" icon on the menu and double click sampaps on the right. There are 3 .dbm files. Active one and open one of the tables to play.