Professional Documents
Culture Documents
?9
<9
>9
ALTER TABLE -o. ALTER co*umn Ch;_$our set +,T +'LL ALTER TABLE -o. ALTER co*umn Ch;_$our set 0ata tApe 0ecima* (62,2! ALTER TABLE -o. %R,P constraint
@9
B9
char;e_c)
89
ALTER TABLE -o. %R,P C,L'M+ o=ertimeChar;e ALTER TABLE -o. %R,P C,L'M+ ch;_hour %R,P TABLE -o. %R,P TABLE emp
6 9
669 629
29 'p0ate the emp*oAee fname to :im instea0 of :ames for emp*oAee 66B (Note: if no WHERE clause is used, then all records are updated) 'P%ATE emp SET emp_fname 5 (:im( "$ERE emp_num 5 66B /9 'p0ate the %ata.ase %esi;ner ch;_hour =a*ue .A 6 D 'P%ATE -o. SET ch;_hour 5 ch;_hour E 696 "$ERE -o._c*ass 5 (%ata.ase %esi;ner(
?9 Remo=e the row from the -o. ta.*e for -o. co0e PR3 ( Note: if no WHERE clause is used, then all records are deleted ) %ELETE &R,M -o. "$ERE -o._co0e 5 (PR3(
<9 Remo=e the :,B ta.*e an0 a** of it(s 0ata %R,P TABLE -o.
>9 Remo=e the emp*oAees from the emp*oAee ta.*e "$ERE the hire0ate is .efore 6F:anF8 %ELETE &R,M emp "$ERE hire0ate G (6F:anF8 (
@9 Remo=e the emp ta.*e an0 a** of it(s 0ata %R,P TABLE emp
&R,M "$ERE
29 Same Huestion as a.o=e, .ut on*A show the recor0s "$ERE the ch;_hour is G6 SELECT emp9emp_fname , emp9emp_*name , -o.9-o._c*ass , -o.9ch;_hour emp, -o. emp9-o._c*ass 5 -o.9-o._co0e -o.9ch;_hour 5 G 6
/9 Se*ect the hours wor)e0 an0 *astname an0 hire0ate for a** emp*oAees9 (Note: the default for all selects is to show all records that are joined. The above state ent has no further conditions for the WHERE clause) SELECT &R,M "$ERE emp9emp_*name , emp9hire0ate , pro-_emp9hour emp, pro-_emp emp9emp_num 5 pro-_emp9emp_num
?9 Create a =iew ca**e0I ",R2_#+&, which wi** se*ect the hours wor)e0 an0 *astname an0 hire0ate for a** emp*oAees hire0 .efore 6F-anF 29 (Note: the default for all selects is to show all records that are joined. The above state ent has no further conditions for the WHERE clause) CREATE C#E" ",R2_#+&, as SELECT emp9emp_*name , emp9hire0ate , pro-_emp9hour &R,M emp, pro-_emp "$ERE emp9emp_num 5 pro-_emp9emp_num A+% emp9hire0ate G (6F-anF 2( <9 Se*ect emp*oAee fname an0 *name an0 a** pro-ects that theA are wor)in; on9 Sa=e this se*ect statement as a =iew ca**e0I EMP_PR,:ECTS (Note: the default for all selects is to show all records that are joined. The above state ent has no further conditions for the WHERE clause) CREATE C#E" EMP_PR,:ECTS as SELECT emp9emp_fname , emp9emp_*name , pro-ect9pro-_name &R,M emp, pro-ect , pro-_emp "$ERE pro-_emp9pro-_num 5 pro-ect9pro-_num A+% pro-_emp9emp_num 5 emp9emp_num >9 Se*ect emp*oAee fname an0 *name an0 a** pro-ects that theA are wor)in; on for pro-ect 6B9 SELECT &R,M "$ERE A+% A+% emp9emp_fname , emp9emp_*name , pro-ect9pro-_name emp, pro-ect , pro-_emp pro-_emp9pro-_num 5 pro-ect9pro-_num pro-_emp9emp_num 5 emp9emp_num pro-ect9pro-_num 5 6B
@9 Se*ect a** pro-ect names an0 -o. c*ass 0escriptions that the pro-ect reHuires9 Sa=e this se*ect statement as a =iew ca**e0I EMP_:,B_S2#LLS CREATE C#E" EMP_:,B_S2#LLS as SELECT pro-ect9pro-_name , -o.9-o._c*ass &R,M pro-ect , -o. , emp, pro-_emp "$ERE pro-_emp9pro-_num 5 pro-ect9pro-_num A+% pro-_emp9emp_num 5 emp9emp_num A+% emp9-o._c*ass 5 -o.9-o._co0e
B9 Se*ect a** pro-ect names an0 -o. c*ass 0escriptions that the pro-ect reHuires for on*A the -o. co0e of %B%9 Sa=e this statement as a =iew ca**e0I %ATABASE_%ES#3+ERS CREATE C#E" %ATABASE_%ES#3+ERS as SELECT pro-ect9pro-_name , -o.9-o._c*ass &R,M pro-ect , -o. , emp, pro-_emp "$ERE pro-_emp9pro-_num 5 pro-ect9pro-_num A+% pro-_emp9emp_num 5 emp9emp_num A+% emp9-o._c*ass 5 -o.9-o._co0e A+% emp9-o._c*ass 5 (%B%(
89 Se*ect customer first an0 *ast name, cre0it *imit, an0 sa*esrep first an0 *ast name "$ERE the cre0it *imit is 45 6< 9 SELECT customer9first_name, customer9*ast_name, customer9cre0it_*imit, sa*esrep9*ast_name as sa*esLast+ame, sa*esrep9first_name as sa*es&irst+ame &R,M premiere7customer, premiere7sa*esrep "$ERE customer9cre0it_*imit 45 6<