14 Pages

Lecture_10_01(null)

Course: CS 157, Fall 2009
School: San Jose State
Rating:
 
 
 
 
 

Word Count: 441

Document Preview

features Example Advanced 6: Get all parts whose names begin with the letter C. SELECT PARTS.* FROM PARTS LIKE 'C%'; WHERE PARTS.PNAME PN -P5 P6 PNAME COLOR ----- ----CAM BLUE COG RED WEIGHT ---------12 19 CITY --------Paris London In general, a "LIKE predicate" takes the form SQL -29 column-name LIKE character-string-constant Characters within that constant are interpreted as follows : * The...

Register Now

Unformatted Document Excerpt

Coursehero >> California >> San Jose State >> CS 157

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
features Example Advanced 6: Get all parts whose names begin with the letter C. SELECT PARTS.* FROM PARTS LIKE 'C%'; WHERE PARTS.PNAME PN -P5 P6 PNAME COLOR ----- ----CAM BLUE COG RED WEIGHT ---------12 19 CITY --------Paris London In general, a "LIKE predicate" takes the form SQL -29 column-name LIKE character-string-constant Characters within that constant are interpreted as follows : * The _ character ( break or underscore ) stands for any single character. * The % character (percent) stands for any sequence of n characters ( where n may be zero ) * All other characters simply stand for themselves. SQL -30 Example 7 : ADDRESS LIKE '%Berkeley%' will evaluate to true if address contains the sting "Berkeley" anywhere inside it. SNUM LIKE 'S_ _' will evaluate to true if SNUM is exactly three characters long and the first is an "S". CITY NOT LIKE '%E%' SQL -31 will evaluate to true if CITY does not contain an "E" SQL -32 Null Value 1.Value unknown 2.Value inapplicable: For example spouse column for single man. 3.Value Withhold SQL -33 Null Value Suppose for the sake of example S5 has a status value NULL, rather than 30. Example 8 : Get supplier numbeer for supplier with status not equal to 25. SQL -34 SELECT FROM WHERE SNUM, STATUS SUPPLIERS STATUS > 25 OR NULL = NULL; The results S# S3 (S5 is not qualified) SQL> 3 2 4 5 6 7 8 SELECT SNAME FROM SUPPLIERS WHERE SNUM IN ( SELECT SNUM FROM SHIPMENTS WHERE PNUM = 'P2' ) ; SQL -35 SNAME --------Smith Jones Blake Clark Null Value None of the following are true STATUS > 25 STATUS <= 25 STATUS = 25 STATUS <> 25 STATUS =NULL SQL -36 STATUS <> NULL ***The last two are illegal (Null has different syntax) Null Value A special form: column-name is [not] NULL Example 9 SELECT FROM SNUM SUPPLIERS SQL -37 WHERE STATUS is NULL; The results S# S5 Example 10 : SELECT FROM WHERE SNUM, STATUS Suppliers STATUS IS NULL; SQL -38 (S5 is qualified) The results S#, P# (All are qualified) SQL -39 Full queries Example 11 : Get supplier names for suppliers who does supply part P2. 1) SELECT FROM WHERE SNUN SUPPLIERS SNUM IN (SELECT SNUM FROM SHIPMENTS WHER...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

San Jose State - CS - 157
SQL (Structured Query Language )SQL - Original spelled SEQUEL - was first defined by Chamberlain and others at the IBM Research Laboratory in San Jose, California. A prototype implementation of the language was built at the IBM Sam Jose Laboratory,
San Jose State - CS - 10
http:/download.oracle.com/otn/nt/oracle10g/xe/10201/OracleXE.exe Follow the instructions
San Jose State - CS - 157
http:/download.oracle.com/otn/nt/oracle10g/xe/10201/OracleXE.exe Follow the instructions
San Jose State - CS - 157
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|22 Aug 2006 14:03:44 -0000 vti_extenderversion:SR|4.0.2.7802 vti_backlinkinfo:VX|classes/cs157a/cs157a_notes_2006.html classes/cs157a/cs157a_oracle.html classes/cs157a/cs157a_notes1.html classes/cs157a/
San Jose State - CS - 157
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|20 Sep 2007 08:50:26 -0000 vti_extenderversion:SR|4.0.2.7802 vti_backlinkinfo:VX|classes/cs157a/cs157a_notes_2006.html classes/cs157a/cs157a_notes1.html classes/cs157a/cs157a_notes3.html
San Jose State - CS - 157
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|09 Aug 2007 06:19:40 -0000 vti_extenderversion:SR|4.0.2.7802 vti_backlinkinfo:VX|classes/cs157a/cs157a_notes_2006.html
San Jose State - CS - 157
Advanced ExamplesSelect E.dno, count(distinct Lname) as ct from employee E group by E.dno having count(*) &gt;1;SQL -29
San Jose State - CS - 157
FDs:G 1G 2G 3Bk,Wk G1,G2,G3( (a) R5(Bn,Wk,G1,G2,G3)
San Jose State - CS - 157
1. Please download S_Database files again; 2. db-1 scripts are updated 3. They were uploaded into Oracle 8, as Teacher had difficult to log into Oracle 10g 4. The project was explained.Join QueriesEquiJoin EquiJoin involves the join of two or more
San Jose State - CS - 157
First Normal Form Relations ( 1 NF )A relation is said to be 1NF if all underlying domains contain atomic values only. so any normalized relation is in 1NF.G# G1 G2 G3 G4 G5 SNAME SMITH, ADAMS JONES, BLAKE BLAKE CLARK ADAMS STATUS 20, 30 10, 30 30
San Jose State - CS - 157
Please download S_Database files again; db-1 scripts are updatedJoin QueriesEquiJoin EquiJoin involves the join of two or more tables using the equality operator. The equijoin by definition produces a result containing two identical columns. Examp
San Jose State - CS - 157
1. Please download S_Database files again; 2. db-1 scripts are updated 3. They were uploaded into Oracle 8, as Teacher had difficult to log into Oracle 10g 4. The project was explained.
San Jose State - CS - 157
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|14 Oct 2007 15:31:56 -0000 vti_extenderversion:SR|4.0.2.7802 vti_backlinkinfo:VX|classes/cs157a/cs157a_notes2.html
San Jose State - CS - 157
Create the database using the give scripts. 2. Write SQL to retrieve data a. Retrieve all car makers Select a car maker b. Then select a model for this car maker c. Then select a year for this model d. The screen should display all engine &amp; etc descr
San Jose State - CS - 157
Write a Java and SQL to retrieve the social security number of each employee who works over 15 hours on at least one project.import java.sql.*; class selectEmp { public static void main (String args []) throws SQLException { / Load the Oracle JDBC d
San Jose State - CS - 157
Create the database using the give scripts. Write SQL to retrieve data a. Retrieve all car makers Select a car maker b. Then select a model for this car maker c. Then select a year for this model d. The screen should display all engine &amp; etc descript
San Jose State - CS - 157
SQL (Structured Query Language )SQL - Original spelled SEQUEL - was first defined by Chamberlain and others at the IBM Research Laboratory in San Jose, California. A prototype implementation of the language was built at the IBM Sam Jose Laboratory,
San Jose State - CS - 157
1. Motivation: Anomaly (intent, DB-actions DB-consequences (more than your intent; in extension level) 2. Solutions are in intension level: Normal Form (FD=ffd; 3. Database Design Theory (the updated are in RedColor 10/29/2007) Different Levels of
San Jose State - CS - 157
CALAIS 86 CALAIS 86CUSTOM CRUISER 86 CUSTOM CRUISER 86CUTLASS CIERA 86 CUTLASS CIERA 86CUTLASS SUPREME 86 CUTLASS SUPREME 86DELTA 88 ROYALE (F
San Jose State - CS - 157
FOX 79 1.6 L4 97 2994.00 80 79 1.6 L4 97 2994.00 FOX
San Jose State - CS - 157
X1 82 X1 82X9 82 X9 82BRAVA 81 BRAVA 81131 78 131 78X1
San Jose State - CS - 157
1,123456789,1,NULL1,123456789,2,7.55,666884444,3,40.06,453453453,1,20.06,453453453,2,20.02,333445555,2,10.02,333445555,3,10.02,333445555,10,10.02,333445555,20,10.03,999887777,30,30.03,999887777,10,10.07,987987987,10,35.07,987987987,30,5.0
San Jose State - CS - 157
THE PROCEDURES OF CREATING SMALL DATABASESTEP 1: Run CLEATIT.SQL.in run sql command to clear the tables and table sequences.STEP 2: Run CREATEIT.SQL. in run sql command to create the tables and table sequences.STEP 3: Select the content of popula
San Jose State - CS - 157
RESEARCH,5,2,33344555,1988-05-22ADMINISTRATION,4,4,987654321,1995-01-01HEADQUARTERS,1,8,99887777,1981-06-19
San Jose State - CS - 157
THE PROCEDURES OF LOADING LARGE DATABASE BY SQLLRD COMMANDSTEP 1: Run CLEATIT.SQL.in SQL*PLUS to clear the tables and table sequences.STEP 2: Run CREATEIT.SQL. in SQL*PLUS to create the tables and table sequences.STEP 3: Execute builddb2a.pl t
San Jose State - CS - 157
AMC86ALLIANCE 1.4L4 85 NS AMC86ALLIANCE 1.4L4 85 827 AMC86ALLIANCE 1.7L4 105 NS AMC86EAGLE 2.5L4 151 NS AMC86EAGLE 4.2L6 258 579 AMC86ENCORE 1.4L4 85 NS AMC86ENCORE 1.4L4 85 827 AMC86ENCORE 1.7L4 105 NS AMC85ALLIANCE 1.4L4 85 NS AMC85ALLIANCE 1.4L4 8
San Jose State - CS - 157
ALLIANCE 86 ALLIANCE 86EAGLE 86 EAGLE 86ENCORE 86 ENCORE 86ALLIANCE 85 ALLIANCE 85EAGLE
San Jose State - CS - 157
SAAB TURBO 85 SAAB TURBO 85
San Jose State - CS - 157
LUV 82 LUV 82LUV 80 LUV 80LUV 75 LUV 75ASTRO 86 ASTRO 86SAFARI
San Jose State - CS - 157
BRAT GL (4WD) 85 BRAT GL (4WD) 85HATCHBACK GL (4WD) 85 HATCHBACK GL (4WD) 85HATCHBACK GL (2WD) 85 HATCHBACK GL (2WD) 85HATCHBACK STD (2WD) 85 HATCHBACK STD (2WD) 85SEDAN TURBO (4WD)
San Jose State - CS - 157
CONTINENTAL 86 5.0 V8 302 870.00 MARK VII 86 5.0 V8 302 870.00 TOWN C
San Jose State - CS - 157
251 16 7/16X17 1/4X1 1/4 (2 ROW) 3 1/4 X 17 1/2 1 5/8 X 16 13/16 1 1/4 - LEFT FRONT FLANGE 6 IN 109.79 10.00 255 14 9/16X18 7/16X 1 1/4 (2 ROW) 2 1/4 X 18 9/16 2 1/4 X 18 9/16
San Jose State - CS - 157
284 17 3/8X25X2 (3 ROW) 3 X 25 1/8 2 1/2 X 25 1/8 1 3/4 - RIGHT SADDLE MOUNT 12 IN 174.08 10.00 302 16 1/8 X 25 X 2 (3 ROW) 2 1/2 X 25 5/16 2 1/2 X 25 5/16
San Jose State - CS - 157
BRAT GL (4WD) 85 A/T 1.8 L4 109 7893.00 BRAT GL (4WD) 85 M/T 1.8 L4 109 5831.00 HATCHB
San Jose State - CS - 157
GIANG GIANGVU UTHUY THUYNGUYEN UBINH CAMBINH UTYLIN T.Y.LIN STUAN BUITUAN U
San Jose State - CS - 157
LOADSTAR AL W/O PTO,M/T V 304 864.00 LOADSTAR AL W/O PTO,M/T V 345 864.00 LOADST
San Jose State - CS - 157
928 85928 85
San Jose State - CS - 157
B100 VAN/WAGON 86 B100 VAN/WAGON 86B200 VAN/WAGON 86 B200 VAN/WAGON 86B300 VAN/WAGON 86 B300 VAN/WAGON 86D100 (2WD) PICKUP 86 D100 (2WD) PICKUP 86D200 (2WD) PICKUP
San Jose State - CS - 157
CAMRY 86 CAMRY 86CELICA LIFTBACK 86 CELICA LIFTBACK 86CELICA SPORT COUPE 86 CELICA SPORT COUPE 86CELICA SUPRA 86 CELICA SUPRA 86COROLLA
San Jose State - CS - 157
COLT 83 COLT 83HATCHBACK 83 HATCHBACK 83SAPPORO 83 SAPPORO 83CHALLENGER 83 CHALLENGER 83CHAMP
San Jose State - CS - 157
CARAVELLE 86 CARAVELLE 86GRAN FURY 86 GRAN FURY 86HORIZON 86 HORIZON 86TURISMO 86 TURISMO 86RELIANT
San Jose State - CS - 157
LE CAR 82 LE CAR 82LE CAR 81 LE CAR 81LE CAR 79 LE CAR 79
San Jose State - CS - 157
200SX 86 TURBO 1.8 L4 110 665.00 200SX 86 2.0 L4 122 7881.00 300ZX
San Jose State - CS - 157
240 D (123 SERIES) 83 240 D (123 SERIES) 83240 (123 SERIES) 82 240 (123 SERIES) 82240 D (123 SERIES) 81 240 D (123 SERIES) 81280 CE (123 SERIES) 81 280 CE (123 SERIES) 81280 E (123 SERIES)
San Jose State - CS - 157
1,JOHN,B,SMITH,123456789,1965-01-09,731 FONDREN HOUSTON TX,M,30000,2,333445555,52,FRANKLIN,T,WONG,333445555,1955-12-08,638 VOSS HOUSTON TX,M,40000,8,888665555,53,ALICIA,J,ZELAYA,999887777,1968-07-19,3321 CASTLE SPRING TX,F,25000,4,987654321,44,JEN
San Jose State - CS - 157
PRODUCTX,1,BELLAIRE,5PRODUCTY,2,SUGARLAND,5PRODUCTZ,3,HOUSTON,5COMPUTERIZATION,10,STAFFORD,4REORGANIZATION,20,HOUSTON,1NEWBENEFITS,30,STAFFORD,4
San Jose State - CS - 157
1,HOUSTON4,STAFFORD5,BELLAIRE5,SUGARLAND5,HOUSTON
San Jose State - CS - 257
Project Knowledge Based Intelligent Search EngineProject Components Web Crawler (will be given) Text Processor (Will be Given) Granule Finder Geometry of Granular Structure Graph of Granular StructurreText Processing1. Input Datahttp:/kdd.
San Jose State - CS - 257
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|06 Mar 2006 14:18:56 -0000 vti_extenderversion:SR|4.0.2.7802 vti_cacheddtm:TX|06 Mar 2006 14:18:56 -0000 vti_filesize:IR|24576 vti_cachedlinkinfo:VX| vti_cachedsvcrellinks:VX| vti_cachedtitle:SR|Introdu
San Jose State - CS - 257
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|06 Feb 2005 04:28:18 -0000 vti_extenderversion:SR|4.0.2.7802 vti_cacheddtm:TX|06 Feb 2005 04:28:18 -0000 vti_filesize:IR|46592 vti_cachedlinkinfo:VX| vti_cachedsvcrellinks:VX| vti_cachedtitle:SR|Introdu
San Jose State - CS - 257
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|20 Feb 2008 22:12:58 -0000 vti_extenderversion:SR|4.0.2.7802 vti_cacheddtm:TX|20 Feb 2008 22:12:58 -0000 vti_filesize:IR|32256 vti_cachedlinkinfo:VX| vti_cachedsvcrellinks:VX| vti_cachedtitle:SR|Introdu
San Jose State - CS - 257
08/23/2006CS157AAn Overview ofDatabase Management SystemsTsau Young Lin - T. Y. LinPh.D. Yale University Professor of Computer Science, San Jos State University http:/www.cs.sjsu.edu/~tylin/Overview - 1Possible Approaches transaction m
San Jose State - CS - 267
2006/08/24 12:09:08 Thu 63.150.149.226 /home/tylin/public_html/classes/cs267/cs267_greensheet.php Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.32006/08/24 12:10:40 Thu 63.150.149.226 http:/
San Jose State - CS - 267
pooja.ambekar@gmail.comnima.gougol@gmail.comrahul_jain1507@hotmail.commandeep.jandir@gmail.comkheraankit@gmail.comjahnaviy2k@yahoo.comlprakash_21@yahoo.co.inemily2sj@yahoo.comvivmos@yahoo.comannapurnamutta@gmail.comsmeetaps@yahoo.comsharma
San Jose State - CS - 267
Dear CS267 ClassesAll grades have been entered1. Quiz, question/answers, seminar, conference and etc consitiute 10%2. Your lectures is 20%3. Term paper + &quot;final&quot; will constitute 70%In case 1, we calibrate by the class average at 80
San Jose State - CS - 257
vti_encoding:SR|utf8-nlvti_timelastmodified:TR|07 Feb 2008 16:33:06 -0000vti_extenderversion:SR|4.0.2.7802
San Jose State - CS - 257
vti_encoding:SR|utf8-nlvti_timelastmodified:TR|11 Feb 2008 02:26:30 -0000vti_extenderversion:SR|4.0.2.7802
San Jose State - CS - 257
CS257An Overview ofDatabase Management SystemsTsau Young Lin - T. Y. LinPh.D. Yale University Professor of Computer Science, San Jos State University http:/www.cs.sjsu.edu/~tylin/Overview - 1CURRENT STATE OF JOB MARKET Shifting in the Pra
San Jose State - ENVS - 001
Understanding the Global Biodiversity Crisis: Part 2EnvS 001 Dr. Lynne TrulioInformation in this talk is compiled from: Miller (2007), Living in the Environment (15th edition). Other sources, with dates of material, as noted in the talk
San Jose State - ENVS - 001
Writing Assignment 3 Guidance: General Points and Specifics on the Paper PartsGeneral Points Use same essay format and style guidelines as the first two papers Paper should be 2-4 pages long Put the References Cited section right after the text a
San Jose State - ENVS - 185
Environmental Impact Analysis (EnvS/UrbP 185) Spring 2007Dr. Rachel E. O'Malley romalley@email.sjsu.edu x4-5424Class Meets: Thursdays 9:0011:45 a.m. ENG 327 Office Hours: Monday s: 9:3012:30; WSQ 118b 1unit Service Activity: 2 hours weeklyC