SQL> select table_name from user_tables; TABLE_NAME ------------------------------ CONTINENTS LIST MODELS CAMPUSES CARMAKERS COUNTRIES MAKES CARDATA ST SHARKS AIRPORTS TABLE_NAME ------------------------------ MARATHON FACULTY DISCENR DISCIPLINES ENROLLMENTS DEGREES FEES FLIGHTS AIRLINES TEACHERS LEAGUES TABLE_NAME ------------------------------ ATTENDANCE T ST01 NOPKEY PK ROOMS CUSTOMERS MINEFIELD RECEIPTS ITEMS FOO1 TABLE_NAME ------------------------------ BEERS MYBOOKS BEERS1 FOO2 FOO3 FOO4 FOO5 BARS DRINKS BEERS2 LIKETEST TABLE_NAME ------------------------------ TIMES CHECKIN FOOBAR ATT2007 SEARCH KODIE CNTR ATTN LOCATIONS STUFF VECTORPAIRS TABLE_NAME ------------------------------ VECTORS FST AGGS PTS MYLIST ALLELES MYVECTORS CC SPECIES ATTRIBUTES TYPES TABLE_NAME ------------------------------ ANEW POKEMON EVOLUTION REACTORS 70 rows selected. SQL> select * from fst; SOU ABBR NFLIGHTS --- --------------- ---------- MMI UAL 3 ALI UAL 2 ALM UAL 2 AAF UAL 3 ARC UAL 3 AFO UAL 2 APG UAL 2 AKC UAL 3 APV UAL 1 ADK UAL 3 CVO UAL 3 SOU ABBR NFLIGHTS --- --------------- ---------- ATO UAL 2 ATE UAL 3 AQY UAL 2 KKI UAL 3 ALB UAL 2 ADG UAL 3 ACV UAL 2 AHD UAL 3 AHT UAL 2 ALX UAL 2 APN UAL 1 SOU ABBR NFLIGHTS --- --------------- ---------- AED UAL 2 MRI USAir 3 ALB USAir 2 ALX USAir 2 APV USAir 1 ACV USAir 2 ARB USAir 3 OTS USAir 3 APG USAir 2 AMA USAir 3 AGN USAir 3 SOU ABBR NFLIGHTS --- --------------- ---------- ESF USAir 2 APN USAir 1 ATS USAir 2 ALI USAir 2 JLH Delta 3 OTS Delta 3 ATW Delta 4 AHT Delta 2 ANN Delta 3 AXB Delta 2 APV Delta 1 SOU ABBR NFLIGHTS --- --------------- ---------- AID Delta 1 AFO Delta 2 EDF Delta 3 ANB Delta 2 ASY Delta 4 ARX Delta 3 AUK Delta 3 ALI Delta 2 ASX Delta 3 ANC Southwest 3 ATS Southwest 2 SOU ABBR NFLIGHTS --- --------------- ---------- LTS Southwest 3 AFO Southwest 2 ARB Southwest 3 AAF Southwest 3 ADT Southwest 2 APV Southwest 1 AET Southwest 3 AYZ Southwest 4 WKK Southwest 3 ANN Southwest 3 ANQ Southwest 3 SOU ABBR NFLIGHTS --- --------------- ---------- AHH Southwest 2 ALI Southwest 2 ALS American 4 AHT American 2 ALE American 4 DYS American 3 AXS American 2 QAW American 3 ASX American 3 ALM American 2 APV American 1 SOU ABBR NFLIGHTS --- --------------- ---------- TDW American 2 AFO American 2 ASY American 4 ARX American 3 AOS American 3 ANW American 2 AND American 3 AMN American 2 ALZ Northwest 2 ANB Northwest 2 APG Northwest 2 SOU ABBR NFLIGHTS --- --------------- ---------- AKP Northwest 2 ALI Northwest 2 AXG Northwest 6 ABR Northwest 2 AEL Northwest 2 AIB Northwest 3 AAF Northwest 3 OTS Northwest 3 NAB Northwest 3 NDV Northwest 3 AOS Northwest 3 SOU ABBR NFLIGHTS --- --------------- ---------- AXX Northwest 3 RFK Northwest 2 OTS Continental 3 APN Continental 1 ALX Continental 2 AIA Continental 3 AKI Continental 5 KQA Continental 3 MMI Continental 3 ESF Continental 2 ABR Continental 2 SOU ABBR NFLIGHTS --- --------------- ---------- AXS Continental 2 NGZ Continental 2 AKP Continental 2 AST Continental 3 ATS Continental 2 AET Continental 3 ARB Continental 3 AED Continental 2 ABQ JetBlue 5 ANP JetBlue 4 APN JetBlue 1 SOU ABBR NFLIGHTS --- --------------- ---------- ALM JetBlue 2 AHF JetBlue 3 DYS JetBlue 3 JLH JetBlue 3 EDF JetBlue 3 ASE JetBlue 2 CAK JetBlue 3 ANB JetBlue 2 ACV JetBlue 2 AID JetBlue 1 AIK JetBlue 2 SOU ABBR NFLIGHTS --- --------------- ---------- AAF JetBlue 3 AEL JetBlue 2 ACV Frontier 2 ALN Frontier 3 ATS Frontier 2 AMA Frontier 3 ADT Frontier 2 AQY Frontier 2 ALZ Frontier 2 JLH Frontier 3 ANV Frontier 4 SOU ABBR NFLIGHTS --- --------------- ---------- VJI Frontier 4 AHF Frontier 3 ANI Frontier 3 ASE Frontier 2 HMN Frontier 4 QAW AirTran 3 ADR AirTran 2 AMN AirTran 2 NGZ AirTran 2 AIV AirTran 3 AHN AirTran 2 SOU ABBR NFLIGHTS --- --------------- ---------- ALB AirTran 2 AED AirTran 2 ANN AirTran 3 ABL AirTran 3 ABI AirTran 4 APG AirTran 2 APV AirTran 1 AXS Allegiant 2 AIK Allegiant 2 LTS Allegiant 3 ANY Allegiant 4 SOU ABBR NFLIGHTS --- --------------- ---------- AXN Allegiant 3 ANA Allegiant 2 ABR Allegiant 2 AHT Allegiant 2 ALZ Allegiant 2 TDW Allegiant 2 AKO Allegiant 2 AQY Allegiant 2 AMW Virgin 3 AKK Virgin 4 ADM Virgin 4 SOU ABBR NFLIGHTS --- --------------- ---------- ADT Virgin 2 LTS Virgin 3 AEX Virgin 2 ATO Virgin 2 ANB Virgin 2 AID Virgin 1 ABY Virgin 4 AHN Virgin 2 APV Virgin 1 RLI Virgin 5 186 rows selected. SQL> select table_name from user_tables; TABLE_NAME ------------------------------ CONTINENTS LIST MODELS CAMPUSES CARMAKERS COUNTRIES MAKES CARDATA ST SHARKS AIRPORTS TABLE_NAME ------------------------------ MARATHON FACULTY DISCENR DISCIPLINES ENROLLMENTS DEGREES FEES FLIGHTS AIRLINES TEACHERS LEAGUES TABLE_NAME ------------------------------ ATTENDANCE T ST01 NOPKEY PK ROOMS CUSTOMERS MINEFIELD RECEIPTS ITEMS FOO1 TABLE_NAME ------------------------------ BEERS MYBOOKS BEERS1 FOO2 FOO3 FOO4 FOO5 BARS DRINKS BEERS2 LIKETEST TABLE_NAME ------------------------------ TIMES CHECKIN FOOBAR ATT2007 SEARCH KODIE CNTR ATTN LOCATIONS STUFF VECTORPAIRS TABLE_NAME ------------------------------ VECTORS FST AGGS PTS MYLIST ALLELES MYVECTORS CC SPECIES ATTRIBUTES TYPES TABLE_NAME ------------------------------ ANEW POKEMON EVOLUTION REACTORS 70 rows selected. SQL> select count(*) from stuff; COUNT(*) ---------- 2 SQL> select count(*) from beers; COUNT(*) ---------- 4 SQL> select * from stuff, beers; ID VAL NAME ---------- ---------- ------------------------------ BREWERY TYPE -------------------------------------------------- -------------------- 1 2 Guinness Guinness stout 1 2 Pale Ale Sierra Nevada 1 2 Zhiguli lager ID VAL NAME ---------- ---------- ------------------------------ BREWERY TYPE -------------------------------------------------- -------------------- 1 2 Knights Valley California L'Apres-Midi 4 Guinness Guinness stout 4 Pale Ale Sierra Nevada ID VAL NAME ---------- ---------- ------------------------------ BREWERY TYPE -------------------------------------------------- -------------------- 4 Zhiguli lager 4 Knights Valley California L'Apres-Midi 8 rows selected. SQL> set linesize 200 SQL> run 1* select * from stuff, beers ID VAL NAME BREWERY TYPE ---------- ---------- ------------------------------ -------------------------------------------------- -------------------- 1 2 Guinness Guinness stout 1 2 Pale Ale Sierra Nevada 1 2 Zhiguli lager 1 2 Knights Valley California L'Apres-Midi 4 Guinness Guinness stout 4 Pale Ale Sierra Nevada 4 Zhiguli lager 4 Knights Valley California L'Apres-Midi 8 rows selected. SQL> select * from stuff; ID VAL ---------- ---------- 1 2 4 SQL> insert into stuff values(3,5); 1 row created. SQL> insert into stuff values(5,3); 1 row created. SQL> select * from stuff; ID VAL ---------- ---------- 1 2 4 3 5 5 3 SQL> select * 2 from stuff s1, stuff s2 3 where s1.ID < s2.val 4 ; ID VAL ID VAL ---------- ---------- ---------- ---------- 1 2 1 2 1 2 5 3 1 2 3 5 3 5 3 5 4 3 5 SQL> select * 2 from stuff s1 3 where stuff.val = 2; where stuff.val = 2 * ERROR at line 3: ORA-00904: "STUFF"."VAL": invalid identifier SQL> select * 2 from stuff s1 3 where val=2' 4 ; ERROR: ORA-01756: quoted string not properly terminated SQL> select * from stuff s1 where val = 2; ID VAL ---------- ---------- 1 2 SQL> select * from stuff s1 where s1.val = 2; ID VAL ---------- ---------- 1 2 SQL> select * from pokemon where pokedexid < 10; POKEDEXID NAME ---------- -------------------- 1 Bulbasaur 2 Ivysaur 3 Venusaur 4 Charmander 5 Charmeleon 6 Charizard 7 Squirtle 8 Wartortle 9 Blastoise 9 rows selected. SQL> select name from pokemon where pokedexid < 10; NAME -------------------- Bulbasaur Ivysaur Venusaur Charmander Charmeleon Charizard Squirtle Wartortle Blastoise 9 rows selected. SQL> select table_name from user_tables; TABLE_NAME ------------------------------ CONTINENTS LIST MODELS CAMPUSES CARMAKERS COUNTRIES MAKES CARDATA ST SHARKS AIRPORTS TABLE_NAME ------------------------------ MARATHON FACULTY DISCENR DISCIPLINES ENROLLMENTS DEGREES FEES FLIGHTS AIRLINES TEACHERS LEAGUES TABLE_NAME ------------------------------ ATTENDANCE T ST01 NOPKEY PK ROOMS CUSTOMERS MINEFIELD RECEIPTS ITEMS FOO1 TABLE_NAME ------------------------------ BEERS MYBOOKS BEERS1 FOO2 FOO3 FOO4 FOO5 BARS DRINKS BEERS2 LIKETEST TABLE_NAME ------------------------------ TIMES CHECKIN FOOBAR ATT2007 SEARCH KODIE CNTR ATTN LOCATIONS STUFF VECTORPAIRS TABLE_NAME ------------------------------ VECTORS FST AGGS PTS MYLIST ALLELES MYVECTORS CC SPECIES ATTRIBUTES TYPES TABLE_NAME ------------------------------ ANEW POKEMON EVOLUTION REACTORS 70 rows selected. SQL> slect * from species; SP2-0734: unknown command beginning "slect * fr..." - rest of line ignored. SQL> select * from species; POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 1 12 Seed 2 12 Seed 3 12 Seed 4 10 Lizard 5 10 Flame 6 10 Flame 7 11 Tiny Turtle 8 11 Turtle 9 11 Shellfish 10 7 Worm 11 7 Cocoon POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 12 7 Butterfly 13 7 Hairy Bug 14 7 Cocoon 15 7 Poison Bee 16 1 Tiny Bird 17 1 Bird 18 1 Bird 19 1 Mouse 20 1 Mouse 21 1 Tiny Bird 22 1 Beak POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 23 4 Snake 24 4 Cobra 25 13 Mouse 26 13 Mouse 27 5 Mouse 28 5 Mouse 29 4 Poison Pin 30 4 Poison Pin 31 4 Drill 33 4 Poison Pin 34 4 Drill POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 35 1 Fairy 36 1 Fairy 37 10 Fox 38 10 Fox 39 1 Balloon 40 1 Balloon 41 4 Bat 42 4 Bat 43 12 Weed 44 12 Weed 45 12 Flower POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 46 7 Mushroom 47 7 Mushroom 48 7 Insect 49 7 Poison Moth 50 5 Mole 51 5 Mole 52 1 Scratch Cat 53 1 Classy Cat 54 11 Duck 55 11 Duck 56 2 Pig Monkey POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 57 2 Pig Monkey 58 10 Puppy 59 10 Legendary 60 11 Tadpole 61 11 Tadpole 62 11 Tadpole 63 14 Psi 64 14 Psi 65 14 Psi 66 2 Superpower 67 2 Superpower POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 68 2 Superpower 69 12 Flower 70 12 Flycatcher 71 12 Flycatcher 72 11 Jellyfish 73 11 Jellyfish 74 6 Rock 75 6 Rock 76 6 Megaton 77 10 Fire Horse 78 10 Fire Horse POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 79 11 Dopey 80 11 Hermit Crab 81 13 Magnet 82 13 Magnet 84 1 Twin Bird 85 1 Triple Bird 86 11 Sea Lion 87 11 Sea Lion 88 4 Sludge 89 4 Sludge 90 11 Bivalve POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 91 11 Bivalve 92 8 Gas 93 8 Gas 94 8 Shadow 95 6 Rock Snake 96 14 Hypnosis 97 14 Hypnosis 98 11 River Crab 99 11 Pincer 100 13 Ball 101 13 Ball POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 102 12 Egg 103 12 Coconut 104 5 Lonely 105 5 Bone Keeper 106 2 Kicking 107 2 Punching 108 1 Licking 109 4 Poison Gas 110 4 Poison Gas 111 5 Spikes 112 5 Drill POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 113 1 Egg 114 12 Vine 115 1 Parent 116 11 Dragon 117 11 Dragon 118 11 Goldfish 119 11 Goldfish 120 11 Star Shape 121 11 Mysterious 122 14 Barrier 123 7 Mantis POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 124 15 Human Shape 125 13 Electric 126 10 Spitfire 127 7 Stag Beetle 128 1 Wild Bull 129 11 Fish 130 11 Atrocious 131 11 Transport 132 1 Transform 133 1 Evolution 134 11 Bubble Jet POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 135 13 Lightning 136 10 Flame 137 1 Virtual 138 6 Spiral 139 6 Spiral 140 6 Shellfish 141 6 Shellfish 142 6 Fossil 143 1 Sleeping 144 15 Freeze 145 13 Electric POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 146 10 Flame 147 16 Dragon 148 16 Dragon 149 16 Dragon 150 14 Genetic 151 14 New Species 152 12 Leaf 153 12 Leaf 154 12 Herb 155 10 Fire Mouse 156 10 Volcano POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 157 10 Volcano 158 11 Big Jaw 159 11 Big Jaw 160 11 Big Jaw 161 1 Scout 162 1 Long Body 163 1 Owl 164 1 Owl 165 7 Five Star 166 7 Five Star 167 7 String Spit POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 168 7 Long Leg 169 4 Bat 170 11 Angler 171 11 Light 172 13 Tiny Mouse 173 1 Star Shape 174 1 Balloon 175 1 Spike Ball 176 1 Happiness 177 14 Tiny Bird 178 14 Mystic POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 179 13 Wool 180 13 Wool 181 13 Light 182 12 Flower 183 11 Aqua Mouse 184 11 Aqua Rabbit 185 6 Imitation 186 11 Frog 187 12 Cottonweed 188 12 Cottonweed 189 12 Cottonweed POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 190 1 Long Tail 191 12 Seed 192 12 Sun 193 7 Clear Wing 194 11 Water Fish 195 11 Water Fish 196 14 Sun 197 17 Moonlight 198 17 Darkness 199 11 Royal 200 8 Screech POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 201 14 Symbol 202 14 Patient 203 1 Long Neck 204 7 Bagworm 205 7 Bagworm 206 1 Land Snake 207 5 FlyScorpion 208 9 Iron Snake 209 1 Fairy 210 1 Fairy 211 11 Balloon POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 212 7 Pincer 213 7 Mold 214 7 Single Horn 215 17 Sharp Claw 216 1 Little Bear 217 1 Hibernator 218 10 Lava 219 10 Lava 220 15 Pig 221 15 Swine 222 11 Coral POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 223 11 Jet 224 11 Jet 225 15 Delivery 226 11 Kite 227 9 Armor Bird 228 17 Dark 229 17 Dark 230 11 Dragon 231 5 Long Nose 232 5 Armor 233 1 Virtual POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 234 1 Big Horn 235 1 Painter 236 2 Scuffle 237 2 Handstand 238 15 Kiss 239 13 Electric 240 10 Live Coal 241 1 Milk Cow 242 1 Happiness 243 13 Thunder 244 10 Volcano POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 245 11 Aurora 246 6 Rock Skin 247 6 Hard Shell 248 6 Armor 249 14 Diving 250 10 Rainbow 251 14 Time Travel 252 12 Wood Gecko 253 12 Wood Gecko 254 12 Forest 255 10 Chick POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 256 10 Young Fowl 257 10 Blaze 258 11 Mud Fish 259 11 Mud Fish 260 11 Mud Fish 261 17 Bite 262 17 Bite 263 1 TinyRaccoon 264 1 Rushing 265 7 Worm 266 7 Cocoon POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 267 7 Butterfly 268 7 Cocoon 269 7 Poison Moth 270 11 Water Weed 271 11 Jolly 272 11 Carefree 273 12 Acorn 274 12 Wily 275 12 Wicked 276 1 TinySwallow 277 1 Swallow POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 278 11 Seagull 279 11 Water Bird 280 14 Feeling 281 14 Emotion 282 14 Embrace 283 7 Pond Skater 284 7 Eyeball 285 12 Mushroom 286 12 Mushroom 287 1 Slacker 288 1 Wild Monkey POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 289 1 Lazy 290 7 Trainee 291 7 Ninja 292 7 Shed 293 1 Whisper 294 1 Big Voice 295 1 Loud Noise 296 2 Guts 297 2 Arm Thrust 298 1 Polka Dot 299 6 Compass POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 300 1 Kitten 301 1 Prim 302 17 Darkness 303 9 Deceiver 304 9 Iron Armor 305 9 Iron Armor 306 9 Iron Armor 307 2 Meditate 308 2 Meditate 309 13 Lightning 310 13 Discharge POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 311 13 Cheering 312 13 Cheering 313 7 Firefly 314 7 Firefly 315 12 Thorn 316 4 Stomach 317 4 Poison Bag 318 11 Savage 319 11 Brutal 320 11 Ball Whale 321 11 Float Whale POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 322 10 Numb 323 10 Eruption 324 10 Coal 325 14 Bounce 326 14 Manipulate 327 1 Spot Panda 328 5 Ant Pit 329 5 Vibration 330 5 Mystic 331 12 Cactus 332 12 Scarecrow POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 333 1 Cotton Bird 334 16 Humming 335 1 Cat Ferret 336 4 Fang Snake 337 6 Meteorite 338 6 Meteorite 339 11 Whiskers 340 11 Whiskers 341 11 Ruffian 342 11 Rogue 343 5 Clay Doll POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 344 5 Clay Doll 345 6 Sea Lily 346 6 Barnacle 347 6 Old Shrimp 348 6 Plate 349 11 Fish 350 11 Tender 351 1 Weather 352 1 Color Swap 353 8 Puppet 354 8 Marionette POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 355 8 Requiem 356 8 Beckon 357 12 Fruit 358 14 Wind Chime 359 17 Disaster 360 14 Bright 361 15 Snow Hat 362 15 Face 363 15 Clap 364 15 Ball Roll 365 15 Ice Break POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 366 11 Bivalve 367 11 Deep Sea 368 11 South Sea 369 11 Longevity 370 11 Rendezvous 371 16 Rock Head 372 16 Endurance 373 16 Dragon 374 9 Iron Ball 375 9 Iron Claw 376 9 Iron Leg POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 377 6 Rock Peak 378 15 Iceberg 379 9 Iron 380 16 Eon 381 16 Eon 382 11 Sea Basin 383 5 Continent 384 16 Sky High 385 9 Wish 386 14 DNA 387 12 Tiny Leaf POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 388 12 Grove 389 12 Continent 390 10 Chimp 391 10 Playful 392 10 Flame 393 11 Penguin 394 11 Penguin 395 11 Emperor 396 1 Starling 397 1 Starling 398 1 Predator POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 399 1 Plump Mouse 400 1 Beaver 401 7 Cricket 402 7 Cricket 403 13 Flash 404 13 Spark 405 13 Gleam Eyes 406 12 Bud 407 12 Bouquet 408 6 Head Butt 409 6 Head Butt POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 410 6 Shield 411 6 Shield 412 7 Bagworm 413 7 Bagworm 414 7 Moth 415 7 Tiny Bee 416 7 Beehive 417 13 EleSquirrel 418 11 Sea Weasel 419 11 Sea Weasel 420 12 Cherry POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 421 12 Blossom 422 11 Sea Slug 423 11 Sea Slug 424 1 Long Tail 425 8 Balloon 426 8 Blimp 427 1 Rabbit 428 1 Rabbit 429 8 Magical 430 17 Big Boss 431 1 Catty POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 432 1 Tiger Cat 433 14 Bell 434 4 Skunk 435 4 Skunk 436 9 Bronze 437 9 Bronze Bell 438 6 Bonsai 439 14 Mime 440 1 Playhouse 441 1 Music Note 442 8 Forbidden POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 443 16 Land Shark 444 16 Cave 445 16 Mach 446 1 Big Eater 447 2 Emanation 448 2 Aura 449 5 Hippo 450 5 Heavyweight 451 4 Scorpion 452 4 Ogre Scorp 453 4 Toxic Mouth POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 454 4 Toxic Mouth 455 12 Bug Catcher 456 11 Wing Fish 457 11 Neon 458 11 Kite 459 12 Frost Tree 460 12 Frost Tree 461 17 Sharp Claw 462 13 Magnet Area 463 1 Licking 464 5 Drill POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 465 12 Vine 466 13 Thunderbolt 467 10 Blast 468 1 Jubilee 469 7 Ogre Darner 470 12 Verdant 471 15 Fresh Snow 472 5 Fang Scorp 473 15 Twin Tusk 474 1 Virtual 475 14 Blade POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 476 6 Compass 477 8 Gripper 478 15 Snow Land 479 13 Plasma 480 14 Knowledge 481 14 Emotion 482 14 Willpower 483 9 Temporal 484 11 Spatial 485 10 Lava Dome 486 1 Colossal POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 487 8 Renegade 488 14 Lunar 489 11 Sea Drifter 490 11 Seafaring 491 17 Pitch-Black 492 12 Gratitude 493 1 Alpha 494 14 Victory 495 12 Grass Snake 496 12 Grass Snake 497 12 Regal POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 498 10 Fire Pig 499 10 Fire Pig 500 10 Mega Fire Pig 501 11 Sea Otter 502 11 Discipline 503 11 Formidable 504 1 Scout 505 1 Lookout 506 1 Puppy 507 1 Loyal Dog 508 1 Big-Hearted POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 509 17 Devious 510 17 Cruel 511 12 Grass Monkey 512 12 Thorn Monkey 513 10 High Temp 514 10 Ember 515 11 Spray 516 11 Geyser 517 14 Dream Eater 518 14 Drowsing 519 1 Tiny Pigeon POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 520 1 Wild Pigeon 521 1 Proud 522 13 Electrified 523 13 Thunderbolt 524 6 Mantle 525 6 Ore 526 6 Compressed 527 14 Bat 528 14 Courting 529 5 Mole 530 5 Subterrene POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 531 1 Hearing 532 2 Muscular 533 2 Muscular 534 2 Muscular 535 11 Tadpole 536 11 Vibration 537 11 Vibration 538 2 Judo 539 2 Karate 540 7 Sewing 541 7 Leaf-Wrapped POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 542 7 Nurturing 543 7 Centipede 544 7 Curlipede 545 7 Megapede 546 12 Cotton Puff 547 12 Windveiled 548 12 Bulb 549 12 Flowering 550 11 Hostile 551 5 Desert Croc 552 5 Desert Croc POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 553 5 Intimidation 554 10 Zen Charm 555 10 Blazing 556 12 Cactus 557 7 Rock Inn 558 7 Stone Home 559 17 Shedding 560 17 Hoodlum 561 14 Avianoid 562 8 Spirit 563 8 Coffin POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 564 11 Prototurtle 565 11 Prototurtle 566 6 First Bird 567 6 First Bird 568 4 Trash Bag 569 4 Trash Heap 570 17 Tricky Fox 571 17 Illusion Fox 572 1 Chinchilla 573 1 Scarf 574 14 Fixation POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 575 14 Manipulate 576 14 Astral Body 577 14 Cell 578 14 Mitosis 579 14 Multiplying 580 11 Water Bird 581 11 White Bird 582 15 Fresh Snow 583 15 Icy Snow 584 15 Snowstorm 585 1 Season POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 586 1 Season 587 13 Sky Squirrel 588 7 Clamping 589 7 Cavalry 590 12 Mushroom 591 12 Mushroom 592 11 Floating 593 11 Floating 594 11 Caring 595 7 Attaching 596 7 EleSpider POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 597 12 Thorn Seed 598 12 Thorn Pod 599 9 Gear 600 9 Gear 601 9 Gear 602 13 EleFish 603 13 EleFish 604 13 EleFish 605 14 Cerebral 606 14 Cerebral 607 8 Candle POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 608 8 Lamp 609 8 Luring 610 16 Tusk 611 16 Axe Jaw 612 16 Axe Jaw 613 15 Chill 614 15 Freezing 615 15 Crystallizing 616 7 Snail 617 7 Shell Out 618 5 Trap POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 619 2 Martial Arts 620 2 Martial Arts 621 16 Cave 622 5 Automaton 623 5 Automaton 624 17 Sharp Blade 625 17 Sword Blade 626 1 Bash Buffalo 627 1 Eaglet 628 1 Valiant 629 17 Diapered POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 630 17 Bone Vulture 631 10 Anteater 632 7 Iron Ant 633 17 Irate 634 17 Hostile 635 17 Brutal 636 7 Torch 637 7 Sun 638 9 Iron Will 639 6 Cavern 640 12 Grassland POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 641 3 Cyclone 642 13 Bolt Strike 643 16 Vast White 644 16 Deep Black 645 5 Abundance 646 16 Boundary 647 11 Colt 648 1 Melody 649 7 Paleozoic 647 rows selected. SQL> select * from species where pokedexid < 15; POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 1 12 Seed 2 12 Seed 3 12 Seed 4 10 Lizard 5 10 Flame 6 10 Flame 7 11 Tiny Turtle 8 11 Turtle 9 11 Shellfish 10 7 Worm 11 7 Cocoon POKEDEXID TYPEID GENUS ---------- ---------- -------------------- 12 7 Butterfly 13 7 Hairy Bug 14 7 Cocoon 14 rows selected. SQL> SQL> SELECT p.name, s.genus 2 FROM species s, pokemon p 3 WHERE s.pokedexid = p.pokedexid and 4 s.pokedexid <= 15 5 ; NAME GENUS -------------------- -------------------- Bulbasaur Seed Ivysaur Seed Venusaur Seed Charmander Lizard Charmeleon Flame Charizard Flame Squirtle Tiny Turtle Wartortle Turtle Blastoise Shellfish Caterpie Worm Metapod Cocoon NAME GENUS -------------------- -------------------- Butterfree Butterfly Weedle Hairy Bug Kakuna Cocoon Beedrill Poison Bee 15 rows selected. SQL> SQL> SELECT p.name AS Pokemon, s.genus AS "POKEMON SPECIES" 2 FROM species s, pokemon p 3 WHERE s.pokedexid = p.pokedexid and 4 s.pokedexid <= 15 5 ; POKEMON POKEMON SPECIES -------------------- -------------------- Bulbasaur Seed Ivysaur Seed Venusaur Seed Charmander Lizard Charmeleon Flame Charizard Flame Squirtle Tiny Turtle Wartortle Turtle Blastoise Shellfish Caterpie Worm Metapod Cocoon POKEMON POKEMON SPECIES -------------------- -------------------- Butterfree Butterfly Weedle Hairy Bug Kakuna Cocoon Beedrill Poison Bee 15 rows selected. SQL> set pagesize 20 SQL> describe attributes Name Null? Type ----------------------------------------------------------------------------------------------------------------- -------- ---------------------------------------------------------------------------- POKEDEXID NOT NULL NUMBER(38) HEIGHT NUMBER(38) WEIGHT NUMBER(38) BASEEXPERIENCE NUMBER(38) SQL> SQL> select p.name as POKEMON, a.height, a.weight, a.baseexperience 2 from attributes a, pokemon p 3 where a.pokedexid = p.pokedexid and 4 a.pokedexid <= 10 5 ; POKEMON HEIGHT WEIGHT BASEEXPERIENCE -------------------- ---------- ---------- -------------- Bulbasaur 7 69 64 Ivysaur 10 130 141 Venusaur 20 1000 208 Charmander 6 85 65 Charmeleon 11 190 142 Charizard 17 905 209 Squirtle 5 90 66 Wartortle 10 225 143 Blastoise 16 855 210 Caterpie 3 29 53 10 rows selected. SQL> SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 ; POKEMON HEIGHT WEIGHT A.WEIGHT/A.HEIGHT -------------------- ---------- ---------- ----------------- Bulbasaur 7 69 9.85714286 Ivysaur 10 130 13 Venusaur 20 1000 50 Charmander 6 85 14.1666667 Charmeleon 11 190 17.2727273 Charizard 17 905 53.2352941 Squirtle 5 90 18 Wartortle 10 225 22.5 Blastoise 16 855 53.4375 Caterpie 3 29 9.66666667 10 rows selected. SQL> SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ---------- Bulbasaur 7 69 9.85714286 Ivysaur 10 130 13 Venusaur 20 1000 50 Charmander 6 85 14.1666667 Charmeleon 11 190 17.2727273 Charizard 17 905 53.2352941 Squirtle 5 90 18 Wartortle 10 225 22.5 Blastoise 16 855 53.4375 Caterpie 3 29 9.66666667 10 rows selected. SQL> SQL> SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ---------- Bulbasaur 7 69 9.85714286 Ivysaur 10 130 13 Venusaur 20 1000 50 Charmander 6 85 14.1666667 Charmeleon 11 190 17.2727273 Charizard 17 905 53.2352941 Squirtle 5 90 18 Wartortle 10 225 22.5 Blastoise 16 855 53.4375 Caterpie 3 29 9.66666667 10 rows selected. SQL> SQL> SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ---------- Bulbasaur 7 69 9.85714286 Ivysaur 10 130 13 Venusaur 20 1000 50 Charmander 6 85 14.1666667 Charmeleon 11 190 17.2727273 Charizard 17 905 53.2352941 Squirtle 5 90 18 Wartortle 10 225 22.5 Blastoise 16 855 53.4375 Caterpie 3 29 9.66666667 10 rows selected. SQL> SQL> SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ---------- Bulbasaur 7 69 9.85714286 Ivysaur 10 130 13 Venusaur 20 1000 50 Charmander 6 85 14.1666667 Charmeleon 11 190 17.2727273 Charizard 17 905 53.2352941 Squirtle 5 90 18 Wartortle 10 225 22.5 Blastoise 16 855 53.4375 Caterpie 3 29 9.66666667 10 rows selected. SQL> column RATIO format 99.99 SQL> run 1 select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6* POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Bulbasaur 7 69 9.86 Ivysaur 10 130 13.00 Venusaur 20 1000 50.00 Charmander 6 85 14.17 Charmeleon 11 190 17.27 Charizard 17 905 53.24 Squirtle 5 90 18.00 Wartortle 10 225 22.50 Blastoise 16 855 53.44 Caterpie 3 29 9.67 10 rows selected. SQL> select count(*) from pokemon; COUNT(*) ---------- 647 SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 order by height 7 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Caterpie 3 29 9.67 Squirtle 5 90 18.00 Charmander 6 85 14.17 Bulbasaur 7 69 9.86 Ivysaur 10 130 13.00 Wartortle 10 225 22.50 Charmeleon 11 190 17.27 Blastoise 16 855 53.44 Charizard 17 905 53.24 Venusaur 20 1000 50.00 10 rows selected. SQL> SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 order by height DESC 7 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Venusaur 20 1000 50.00 Charizard 17 905 53.24 Blastoise 16 855 53.44 Charmeleon 11 190 17.27 Ivysaur 10 130 13.00 Wartortle 10 225 22.50 Bulbasaur 7 69 9.86 Charmander 6 85 14.17 Squirtle 5 90 18.00 Caterpie 3 29 9.67 10 rows selected. SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 order by a.weight/a.height 7 ; POKEMON HEIGHT WEIGHT A.WEIGHT/A.HEIGHT -------------------- ---------- ---------- ----------------- Caterpie 3 29 9.66666667 Bulbasaur 7 69 9.85714286 Ivysaur 10 130 13 Charmander 6 85 14.1666667 Charmeleon 11 190 17.2727273 Squirtle 5 90 18 Wartortle 10 225 22.5 Venusaur 20 1000 50 Charizard 17 905 53.2352941 Blastoise 16 855 53.4375 10 rows selected. SQL> SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 order by RATIO 7 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Caterpie 3 29 9.67 Bulbasaur 7 69 9.86 Ivysaur 10 130 13.00 Charmander 6 85 14.17 Charmeleon 11 190 17.27 Squirtle 5 90 18.00 Wartortle 10 225 22.50 Venusaur 20 1000 50.00 Charizard 17 905 53.24 Blastoise 16 855 53.44 10 rows selected. SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 order by a.baseexperience 7 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Caterpie 3 29 9.67 Bulbasaur 7 69 9.86 Charmander 6 85 14.17 Squirtle 5 90 18.00 Ivysaur 10 130 13.00 Charmeleon 11 190 17.27 Wartortle 10 225 22.50 Venusaur 20 1000 50.00 Charizard 17 905 53.24 Blastoise 16 855 53.44 10 rows selected. SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO, a.baseexperience 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 order by a.baseexperience 7 ; POKEMON HEIGHT WEIGHT RATIO BASEEXPERIENCE -------------------- ---------- ---------- ------ -------------- Caterpie 3 29 9.67 53 Bulbasaur 7 69 9.86 64 Charmander 6 85 14.17 65 Squirtle 5 90 18.00 66 Ivysaur 10 130 13.00 141 Charmeleon 11 190 17.27 142 Wartortle 10 225 22.50 143 Venusaur 20 1000 50.00 208 Charizard 17 905 53.24 209 Blastoise 16 855 53.44 210 10 rows selected. SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 order by pokedexID 7 ; order by pokedexID * ERROR at line 6: ORA-00918: column ambiguously defined SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10 6 order by p.pokedexID 7 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Bulbasaur 7 69 9.86 Ivysaur 10 130 13.00 Venusaur 20 1000 50.00 Charmander 6 85 14.17 Charmeleon 11 190 17.27 Charizard 17 905 53.24 Squirtle 5 90 18.00 Wartortle 10 225 22.50 Blastoise 16 855 53.44 Caterpie 3 29 9.67 10 rows selected. SQL> CREATE TABLE PFirst AS (select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid <= 10); Table created. SQL> select * from PFirst; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Bulbasaur 7 69 9.86 Ivysaur 10 130 13.00 Venusaur 20 1000 50.00 Charmander 6 85 14.17 Charmeleon 11 190 17.27 Charizard 17 905 53.24 Squirtle 5 90 18.00 Wartortle 10 225 22.50 Blastoise 16 855 53.44 Caterpie 3 29 9.67 10 rows selected. SQL> SQL> select p.name as POKEMON, a.height, a.weight, 2 a.weight/a.height AS RATIO 3 from attributes a, pokemon p 4 where a.pokedexid = p.pokedexid and 5 a.pokedexid >= 5 and a.pokedexid < 15; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Charmeleon 11 190 17.27 Charizard 17 905 53.24 Squirtle 5 90 18.00 Wartortle 10 225 22.50 Blastoise 16 855 53.44 Caterpie 3 29 9.67 Metapod 7 99 14.14 Butterfree 11 320 29.09 Weedle 3 32 10.67 Kakuna 6 100 16.67 10 rows selected. SQL> CREATE TABLE PNext AS ( 2 select p.name as POKEMON, a.height, a.weight, 3 a.weight/a.height AS RATIO 4 from attributes a, pokemon p 5 where a.pokedexid = p.pokedexid and 6 a.pokedexid >= 5 and a.pokedexid < 15); Table created. SQL> select * from PNext; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Charmeleon 11 190 17.27 Charizard 17 905 53.24 Squirtle 5 90 18.00 Wartortle 10 225 22.50 Blastoise 16 855 53.44 Caterpie 3 29 9.67 Metapod 7 99 14.14 Butterfree 11 320 29.09 Weedle 3 32 10.67 Kakuna 6 100 16.67 10 rows selected. SQL> SQL> (PFirst 2 UNION 3 PNext); (PFirst * ERROR at line 1: ORA-00928: missing SELECT keyword SQL> (SELECT * from PFirst) 2 UNION 3 (SELECT * FROM PNext); POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Blastoise 16 855 53.44 Bulbasaur 7 69 9.86 Butterfree 11 320 29.09 Caterpie 3 29 9.67 Charizard 17 905 53.24 Charmander 6 85 14.17 Charmeleon 11 190 17.27 Ivysaur 10 130 13.00 Kakuna 6 100 16.67 Metapod 7 99 14.14 Squirtle 5 90 18.00 Venusaur 20 1000 50.00 Wartortle 10 225 22.50 Weedle 3 32 10.67 14 rows selected. SQL> (SELECT * from PFIRST) 2 INTERSECT 3 (SELECT * from PNEXT) 4 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Blastoise 16 855 53.44 Caterpie 3 29 9.67 Charizard 17 905 53.24 Charmeleon 11 190 17.27 Squirtle 5 90 18.00 Wartortle 10 225 22.50 6 rows selected. SQL> (SELECT * from PFIRST) 2 MINUS 3 (SELECT * from PNEXT) 4 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Bulbasaur 7 69 9.86 Charmander 6 85 14.17 Ivysaur 10 130 13.00 Venusaur 20 1000 50.00 SQL> (SELECT * from PNEXT) 2 MINUS 3 (SELECT * from PFIRST) 4 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Butterfree 11 320 29.09 Kakuna 6 100 16.67 Metapod 7 99 14.14 Weedle 3 32 10.67 SQL> (SELECT * from PNEXT a) 2 MINUS 3 (SELECT * from PFIRST) 4 ORDER BY a.RATIO 5 ; ORDER BY a.RATIO * ERROR at line 4: ORA-00904: "A"."RATIO": invalid identifier SQL> SQL> (SELECT * from PNEXT) 2 MINUS 3 (SELECT * from PFIRST) 4 ORDER BY RATIO 5 ; ORDER BY RATIO * ERROR at line 4: ORA-00904: "RATIO": invalid identifier SQL> SQL> (SELECT * from PNEXT) 2 MINUS 3 (SELECT * from PFIRST 4 ORDER BY RATIO 5 ) 6 ; ORDER BY RATIO * ERROR at line 4: ORA-00907: missing right parenthesis SQL> SQL> (SELECT * from PNEXT) 2 MINUS 3 (SELECT * from PFIRST) 4 ORDER BY PNEXT.RATIO 5 ; ORDER BY PNEXT.RATIO * ERROR at line 4: ORA-00904: "PNEXT"."RATIO": invalid identifier SQL> (SELECT * from PNEXT 2 order by ratio 3 ) 4 MINUS 5 (SELECT * from PFIRST) 6 ; order by ratio * ERROR at line 2: ORA-00907: missing right parenthesis SQL> select * from pnext; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Charmeleon 11 190 17.27 Charizard 17 905 53.24 Squirtle 5 90 18.00 Wartortle 10 225 22.50 Blastoise 16 855 53.44 Caterpie 3 29 9.67 Metapod 7 99 14.14 Butterfree 11 320 29.09 Weedle 3 32 10.67 Kakuna 6 100 16.67 10 rows selected. SQL> SQL> (SELECT pokemon, height, weight, ratio from PNEXT 2 ) 3 MINUS 4 (SELECT * from PFIRST) 5 order by ratio 6 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Weedle 3 32 10.67 Metapod 7 99 14.14 Kakuna 6 100 16.67 Butterfree 11 320 29.09 SQL> (select * from pokemon) union (select * from species); (select * from pokemon) union (select * from species) * ERROR at line 1: ORA-01789: query block has incorrect number of result columns SQL> SQL> (SELECT * from PFIRST 2 where weight < 100) 3 INTERSECT 4 (SELECT * from PNEXT 5 where height < 20) 6 ; POKEMON HEIGHT WEIGHT RATIO -------------------- ---------- ---------- ------ Caterpie 3 29 9.67 Squirtle 5 90 18.00 SQL> select * from pokemon p, species s 2 where p.pokedexid = s.pokedexid and p.pokedexid < 15; POKEDEXID NAME POKEDEXID TYPEID GENUS ---------- -------------------- ---------- ---------- -------------------- 1 Bulbasaur 1 12 Seed 2 Ivysaur 2 12 Seed 3 Venusaur 3 12 Seed 4 Charmander 4 10 Lizard 5 Charmeleon 5 10 Flame 6 Charizard 6 10 Flame 7 Squirtle 7 11 Tiny Turtle 8 Wartortle 8 11 Turtle 9 Blastoise 9 11 Shellfish 10 Caterpie 10 7 Worm 11 Metapod 11 7 Cocoon 12 Butterfree 12 7 Butterfly 13 Weedle 13 7 Hairy Bug 14 Kakuna 14 7 Cocoon 14 rows selected. SQL> CREATE TABLE POK AS (select * from pokemon p, species s 2 where p.pokedexid = s.pokedexid and p.pokedexid < 1); CREATE TABLE POK AS (select * from pokemon p, species s * ERROR at line 1: ORA-00957: duplicate column name SQL> create table pok as (select p.pokedexid, p.name, s.genus from pokemon p, species s 2 where p.pokedexid = s.pokedexid and p.pokedexid < 15); Table created. SQL> select * from pok; POKEDEXID NAME GENUS ---------- -------------------- -------------------- 1 Bulbasaur Seed 2 Ivysaur Seed 3 Venusaur Seed 4 Charmander Lizard 5 Charmeleon Flame 6 Charizard Flame 7 Squirtle Tiny Turtle 8 Wartortle Turtle 9 Blastoise Shellfish 10 Caterpie Worm 11 Metapod Cocoon 12 Butterfree Butterfly 13 Weedle Hairy Bug 14 Kakuna Cocoon 14 rows selected. SQL> select genus from pok; GENUS -------------------- Seed Seed Seed Lizard Flame Flame Tiny Turtle Turtle Shellfish Worm Cocoon Butterfly Hairy Bug Cocoon 14 rows selected. SQL> select distinct genus from pok; GENUS -------------------- Lizard Tiny Turtle Turtle Seed Flame Cocoon Shellfish Worm Hairy Bug Butterfly 10 rows selected. SQL> select a.baseexperience 2 from attributes a, pokemon p 3 where p.name = 'Pikachu' and 4 p.pokedexID = a.pokedexID 5 ; BASEEXPERIENCE -------------- 82 SQL> select * 2 from attributes 3 where baseexperience < 82 4 ; POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 1 7 69 64 4 6 85 65 7 5 90 66 10 3 29 53 11 7 99 72 13 3 32 52 14 6 100 71 16 3 18 55 19 3 35 57 21 3 20 58 23 20 69 62 29 4 70 59 35 6 75 68 37 6 99 63 39 5 55 76 41 8 75 54 43 5 54 78 POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 46 3 54 70 48 10 300 75 50 2 8 81 52 4 42 69 54 8 196 80 56 5 280 74 60 6 124 77 63 9 195 75 66 8 195 75 74 4 200 73 129 9 100 20 132 3 40 61 147 18 33 67 151 4 40 64 152 9 64 64 155 5 79 65 158 6 95 66 POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 161 8 60 57 163 7 212 58 165 10 108 54 167 5 85 54 172 3 20 42 173 3 30 37 174 3 10 39 175 3 15 74 177 2 20 73 179 6 78 59 183 4 85 58 187 4 5 74 191 3 18 52 194 4 85 52 201 5 50 61 204 6 72 60 209 6 78 63 POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 213 6 205 80 218 7 350 78 220 4 65 78 223 6 120 78 246 6 720 67 251 6 50 64 252 5 50 65 255 4 25 65 258 4 76 65 261 5 136 55 263 4 175 60 265 3 36 54 266 6 100 72 268 7 115 72 270 5 26 74 273 5 40 74 276 3 23 59 POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 278 6 95 64 280 4 66 70 283 5 17 63 285 4 45 65 290 5 55 65 293 6 163 68 298 2 20 33 300 6 110 65 316 4 103 75 328 7 150 73 333 4 12 74 343 5 215 58 349 6 74 61 360 6 140 44 361 7 168 74 363 8 395 75 387 4 102 64 POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 390 5 62 65 393 4 52 66 396 3 20 56 399 5 200 58 401 3 22 54 403 5 95 60 406 2 12 68 412 2 34 61 415 3 55 63 418 7 295 75 420 4 33 68 422 3 63 73 431 5 39 71 433 2 6 74 434 4 192 79 436 5 605 72 438 5 150 68 POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 439 6 130 78 443 7 205 67 447 7 202 72 492 2 21 64 495 6 81 28 498 5 99 28 501 5 59 28 504 5 116 51 506 4 41 55 509 4 101 56 511 6 105 63 513 6 110 63 515 6 135 63 517 6 233 58 519 3 21 53 522 8 298 59 524 4 180 56 POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 527 4 21 63 529 3 85 66 532 6 125 61 535 5 45 59 540 3 25 62 543 4 53 52 546 3 6 56 548 5 66 56 551 7 152 58 554 6 375 63 557 3 145 65 559 6 118 70 562 5 15 61 564 7 165 71 566 5 95 71 568 6 310 66 570 7 125 66 POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 572 4 58 60 574 4 58 58 577 3 10 58 580 5 55 61 582 4 57 61 585 6 195 67 588 5 59 63 590 2 10 59 592 12 330 67 595 1 6 64 597 6 188 61 599 3 210 60 602 2 3 55 605 5 90 67 607 3 31 55 610 6 180 64 613 5 85 61 POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 616 4 77 61 619 9 200 70 622 10 920 61 624 5 102 68 627 5 105 70 629 5 90 74 633 8 173 60 636 11 288 72 161 rows selected. SQL> select * 2 from attributes 3 where baseexperience < 82 4 and pokedexid <= 150 5 ; POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 1 7 69 64 4 6 85 65 7 5 90 66 10 3 29 53 11 7 99 72 13 3 32 52 14 6 100 71 16 3 18 55 19 3 35 57 21 3 20 58 23 20 69 62 29 4 70 59 35 6 75 68 37 6 99 63 39 5 55 76 41 8 75 54 43 5 54 78 POKEDEXID HEIGHT WEIGHT BASEEXPERIENCE ---------- ---------- ---------- -------------- 46 3 54 70 48 10 300 75 50 2 8 81 52 4 42 69 54 8 196 80 56 5 280 74 60 6 124 77 63 9 195 75 66 8 195 75 74 4 200 73 129 9 100 20 132 3 40 61 147 18 33 67 30 rows selected. SQL> select p.name 2 from attributes a, pokemon p 3 where baseexperience < 82 4 and p.pokedexid <= 150 and 5 p.pokedexid = a.pokedexid 6 ; NAME -------------------- Bulbasaur Charmander Squirtle Caterpie Metapod Weedle Kakuna Pidgey Rattata Spearow Ekans Nidoran??? Clefairy Vulpix Jigglypuff Zubat Oddish NAME -------------------- Paras Venonat Diglett Meowth Psyduck Mankey Poliwag Abra Machop Geodude Magikarp Ditto Dratini 30 rows selected. SQL> select p.name 2 from attributes a, pokemon p, attributes a1, pokemon p1 3 where baseexperience < a1.baseexperience 4 and p.pokedexid <= 150 and 5 p.pokedexid = a.pokedexid 6 and p1.name = 'Pikachu' and 7 a1.pokedexid = p1.pokedexId 8 ; where baseexperience < a1.baseexperience * ERROR at line 3: ORA-00918: column ambiguously defined SQL> select p.name 2 from attributes a, pokemon p, attributes a1, pokemon p1 3 where a.baseexperience < a1.baseexperience 4 and p.pokedexid <= 150 and 5 p.pokedexid = a.pokedexid 6 and p1.name = 'Pikachu' and 7 a1.pokedexid = p1.pokedexId 8 ; NAME -------------------- Bulbasaur Charmander Squirtle Caterpie Metapod Weedle Kakuna Pidgey Rattata Spearow Ekans Nidoran??? Clefairy Vulpix Jigglypuff Zubat Oddish NAME -------------------- Paras Venonat Diglett Meowth Psyduck Mankey Poliwag Abra Machop Geodude Magikarp Ditto Dratini 30 rows selected. SQL> exit