Progress
SQL-92
Guide and Reference


Populate the Table

This section contains an SQL-92 script that inserts and updates data in the team table.

Team_upd.sql
--------------------------------------------------------------------- 
-- File Name: Team_upd.sql
-- Purpose:  Populates the team table in a copy of the
--           sports2000 database.
-- Requirements:
--           (1) Database must be running.
--           (2) Team table must exist -- see Team_cre.sql
--           (3) Submit this script to SQL Explorer as an input file
--               (character mode) or as a run file (GUI mode)
-- Revision History:
-- Date                Author                     Change 
-- ----                ------                     -------
-- 11/99               DB-DOC                     Created
-----------------------------------------------------------------------

insert into team (EmpNum, Firstname, Lastname, State)
     select EmpNum, Firstname, Lastname, State from pub.employee
     where state = ’MA’ ;
update team
     set sport = ’tennis1’ where state = ’MA’ ; 
commit work ;

insert into team (EmpNum, Firstname, Lastname, State)
     select EmpNum, Firstname, Lastname, State from pub.employee
     where state = ’NY’ ;
update team
     set sport = ’volleyball1’ where state = ’NY’ ; 
commit work ;     

insert into team (EmpNum, Firstname, Lastname, State)
     select EmpNum, Firstname, Lastname, State from pub.employee
     where state = ’NH’ ;
update team
     set sport = ’tennis2’ where state = ’NH’ ; 
commit work ;

insert into team (EmpNum, Firstname, Lastname, State)
     select EmpNum, Firstname, Lastname, State from pub.employee
     where state = ’TX’ ;
update team
     set sport = ’volleyball2’ where state = ’TX’ ; 
commit work ; 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095