Annotation of 42BSD/ingres/source/support/demodb.sh, revision 1.1.1.1

1.1       root        1: :      "@(#)demodb.sh  7.1     2/6/81"
                      2: if test "$1" = "" ; then
                      3:        echo no database name specified
                      4:        exit
                      5: fi
                      6: echo creating database $1 -- please wait
                      7: if creatdb $2 $1 ; then echo loading relations ; else exit; fi
                      8: ingres -s $2 $1 << 'EOF'
                      9:        create item (
                     10:                number is i2,
                     11:                name is c20,
                     12:                dept is i2,
                     13:                price is i2,
                     14:                qoh is i2,
                     15:                supplier is i2)
                     16: 
                     17:        create sale (
                     18:                number is c6,
                     19:                date is c8,
                     20:                store is i2,
                     21:                dept is i2,
                     22:                item is i2,
                     23:                quantity is i2,
                     24:                employee is i2,
                     25:                credit is c8)
                     26: 
                     27:        create employee (
                     28:                number is i2,
                     29:                name is c20,
                     30:                salary is i2,
                     31:                manager is i2,
                     32:                birthdate is i2,
                     33:                startdate is i2)
                     34: 
                     35:        create dept (
                     36:                number is i2,
                     37:                name is c20,
                     38:                store is i2,
                     39:                floor is i2,
                     40:                manager is i2)
                     41: 
                     42:        create supplier (
                     43:                number is i2,
                     44:                name is c15,
                     45:                city is c15,
                     46:                state is c6)
                     47: 
                     48:        create store (
                     49:                number is i2,
                     50:                city is c15,
                     51:                state is c6)
                     52: 
                     53:        create parts (
                     54:                pnum is i2,
                     55:                pname is c20,
                     56:                color is c8,
                     57:                weight is i2,
                     58:                qoh is i2)
                     59: 
                     60:        create supply (
                     61:                snum is i2,
                     62:                pnum is i2,
                     63:                jnum is i2,
                     64:                shipdate is c8,
                     65:                quan is i2)
                     66: 
                     67: 
                     68:        copy item (number is i2,
                     69:                name is c20,
                     70:                dept is i2,
                     71:                price is i2,
                     72:                qoh is i2,
                     73:                supplier is i2)
                     74:        from "{pathname}/demo/item"
                     75: 
                     76:        copy sale (
                     77:                number is c6,
                     78:                date is c8,
                     79:                store is i2,
                     80:                dept is i2,
                     81:                item is i2,
                     82:                quantity is i2,
                     83:                employee is i2,
                     84:                credit is c8)
                     85:        from "{pathname}/demo/sale"
                     86: 
                     87:        copy employee (
                     88:                number is i2,
                     89:                name is c20,
                     90:                salary is i2,
                     91:                manager is i2,
                     92:                birthdate is i2,
                     93:                startdate is i2)
                     94:        from "{pathname}/demo/employee"
                     95: 
                     96:        copy dept (
                     97:                number is i2,
                     98:                name is c20,
                     99:                store is i2,
                    100:                floor is i2,
                    101:                manager is i2)
                    102:        from "{pathname}/demo/dept"
                    103: 
                    104:        copy supplier (
                    105:                number is i2,
                    106:                name is c15,
                    107:                city is c15,
                    108:                state is c6)
                    109:        from "{pathname}/demo/supplier"
                    110: 
                    111:        copy store (
                    112:                number is i2,
                    113:                city is c15,
                    114:                state is c6)
                    115:        from "{pathname}/demo/store"
                    116: 
                    117:        copy parts (
                    118:                pnum is i2,
                    119:                pname is c20,
                    120:                color is c8,
                    121:                weight is i2,
                    122:                qoh is i2)
                    123:        from "{pathname}/demo/parts"
                    124: 
                    125:        copy supply (
                    126:                snum is i2,
                    127:                pnum is i2,
                    128:                jnum is i2,
                    129:                shipdate is c8,
                    130:                quan is i2)
                    131:        from "{pathname}/demo/supply"
                    132: 
                    133:        range of i is item
                    134:        define permit all on i to all
                    135: 
                    136:        range of s is sale
                    137:        define permit all on s to all
                    138: 
                    139:        range of e is employee
                    140:        define permit all on e to all
                    141: 
                    142:        range of d is dept
                    143:        define permit all on d to all
                    144: 
                    145:        range of s is supplier
                    146:        define permit all on s to all
                    147: 
                    148:        range of s is store
                    149:        define permit all on s to all
                    150: 
                    151:        range of p is parts
                    152:        define permit all on p to all
                    153: 
                    154:        range of s is supply
                    155:        define permit all on s to all
                    156:        \g
                    157:        \q
                    158: EOF
                    159: echo database $1 created

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.