Elmasri 6e_ISM 105

March 5, 2019 | Author: Gaziza Yestemirova | Category: Sql, Information Retrieval, Databases, Application Software, Information Science
Share Embed Donate


Short Description

Soutions...

Description

Chapter 5: More SQL: Complex Queries, Triggers, Views, Views, and Schema Modification

CHAPTER 5: More SQL: Complex Queries, Triggers, Views, and S!ema Modi"ia#ion Answers #o Sele#ed Exerises

5$5 - Specif the following additional !ueries on the data"ase of #igure $%5 in SQL% Show

the !uer results if applied to the data"ase of #igure $%&% 'a( #or each department whose a)erage emploee salar is more than *$+,+++, retrie)e the department name and the num"er of emploees woring for that department% '"( Suppose we want the num"er of male emploees in each department rather than all emploees 'as in xercise 5%.a(% Can we specif this !uer in SQL/ 0h 0 h or wh not/  Answers:

'a( SLCT 123M, C42T '6( #74M 1837TM2T, M8L49 07 12M;72= 3V= 'S3L379( ? $++++

7esult: 123M 12M;7 C42T'6( 7esearch 5 .  3dministration . $ ead!uarters @ @ '"( The !uer ma still "e specified in SQL " using a nested !uer as follows 'not all implementations ma support this tpe of !uer(: SLCT 123M, C42T '6( #74M 1837TM2T, M8L49 07 12M;7STS ' SLCT 6 #74M =731E7847T 07 Student2um"er< ST12T%Student2um"er 321 24T'=rade2 ' SLCT SS2 #74M M8L49 07 S87SS2 < HGGG&&5555F ( c( SLCT L23M #74M M8L49 07 S3L379 ?< @++++ I ' SLCT M>2'S3L379( #74M M8L49(

5$' J 2o solution pro)ided%

5$( J 2o solution pro)ided%

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF