Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Database mysql ( USE PYTHON ) After the database has been created and the data inserted, the program should show an interactive prompt. Users should

Database mysql (USE PYTHON)

After the database has been created and the data inserted, the program should show an interactive prompt. Users should see a main menu as the one displayed in the picture. Each number should perform a certain action and run appropriate queries as described below.

Write a query which :

a. List all planets. After pressing number 1 followed by enter the program should list the names of all the planets. Users will need to click any key to return to the main menu. (20 points)

b. Search for planet details. After pressing number 2 followed by enter the program should ask the user to enter the name of the planet. After the user enters the data and presses enter all the details of the planet should be displayed. Users will need to click any key to return to the main menu. Users will need to click any key to return to the main menu. (20 points)

planets.csv file contains:

name,rotation_period,orbital_period,diameter,climate,gravity,terrain,surface_water,population Alderaan,24,364,12500,temperate,1 standard,"grasslands, mountains",40,2000000000 Yavin IV,24,4818,10200,"temperate, tropical",1 standard,"jungle, rainforests",8,1000 Hoth,23,549,7200,frozen,1.1 standard,"tundra, ice caves, mountain ranges",100,NA Dagobah,23,341,8900,murky,N/A,"swamp, jungles",8,NA Bespin,12,5110,118000,temperate,"1.5 (surface), 1 standard (Cloud City)",gas giant,0,6000000 Endor,18,402,4900,temperate,0.85 standard,"forests, mountains, lakes",8,30000000 Naboo,26,312,12120,temperate,1 standard,"grassy hills, swamps, forests, mountains",12,4500000000 Coruscant,24,368,12240,temperate,1 standard,"cityscape, mountains",NA,1000000000000 Kamino,27,463,19720,temperate,1 standard,ocean,100,1000000000 Geonosis,30,256,11370,"temperate, arid",0.9 standard,"rock, desert, mountain, barren",5,100000000000 Utapau,27,351,12900,"temperate, arid, windy",1 standard,"scrublands, savanna, canyons, sinkholes",0.9,95000000 Mustafar,36,412,4200,hot,1 standard,"volcanoes, lava rivers, mountains, caves",0,20000 Kashyyyk,26,381,12765,tropical,1 standard,"jungle, forests, lakes, rivers",60,45000000 Polis Massa,24,590,0,artificial temperate ,0.56 standard,airless asteroid,0,1000000 Mygeeto,12,167,10088,frigid,1 standard,"glaciers, mountains, ice canyons",NA,19000000 Felucia,34,231,9100,"hot, humid",0.75 standard,fungus forests,NA,8500000 Cato Neimoidia,25,278,0,"temperate, moist",1 standard,"mountains, fields, forests, rock arches",NA,10000000 Saleucami,26,392,14920,hot,NA,"caves, desert, mountains, volcanoes",NA,1400000000 Stewjon,NA,NA,0,temperate,1 standard,grass,NA,NA Eriadu,24,360,13490,polluted,1 standard,cityscape,NA,22000000000 Corellia,25,329,11000,temperate,1 standard,"plains, urban, hills, forests",70,3000000000 Rodia,29,305,7549,hot,1 standard,"jungles, oceans, urban, swamps",60,1300000000 Nal Hutta,87,413,12150,temperate,1 standard,"urban, oceans, swamps, bogs",NA,7000000000 Dantooine,25,378,9830,temperate,1 standard,"oceans, savannas, mountains, grasslands",NA,1000 Bestine IV,26,680,6400,temperate,NA,"rocky islands, oceans",98,62000000 Ord Mantell,26,334,14050,temperate,1 standard,"plains, seas, mesas",10,4000000000 NA,0,0,0,NA,NA,NA,NA,NA Trandosha,25,371,0,arid,0.62 standard,"mountains, seas, grasslands, deserts",NA,42000000 Socorro,20,326,0,arid,1 standard,"deserts, mountains",NA,300000000 Mon Cala,21,398,11030,temperate,1,"oceans, reefs, islands",100,27000000000 Chandrila,20,368,13500,temperate,1,"plains, forests",40,1200000000 Sullust,20,263,12780,superheated,1,"mountains, volcanoes, rocky deserts",5,18500000000 Toydaria,21,184,7900,temperate,1,"swamps, lakes",NA,11000000 Malastare,26,201,18880,"arid, temperate, tropical",1.56,"swamps, deserts, jungles, mountains",NA,2000000000 Dathomir,24,491,10480,temperate,0.9,"forests, deserts, savannas",NA,5200 Ryloth,30,305,10600,"temperate, arid, subartic",1,"mountains, valleys, deserts, tundra",5,1500000000 Aleen Minor,NA,NA,NA,NA,NA,NA,NA,NA Vulpter,22,391,14900,"temperate, artic",1,"urban, barren",NA,421000000 Troiken,NA,NA,NA,NA,NA,"desert, tundra, rainforests, mountains",NA,NA Tund,48,1770,12190,NA,NA,"barren, ash",NA,0 Haruun Kal,25,383,10120,temperate,0.98,"toxic cloudsea, plateaus, volcanoes",NA,705300 Cerea,27,386,NA,temperate,1,verdant,20,450000000 Glee Anselm,33,206,15600,"tropical, temperate",1,"lakes, islands, swamps, seas",80,500000000 Iridonia,29,413,NA,NA,NA,"rocky canyons, acid pools",NA,NA Tholoth,NA,NA,NA,NA,NA,NA,NA,NA Iktotch,22,481,NA,"arid, rocky, windy",1,rocky,NA,NA Quermia,NA,NA,NA,NA,NA,NA,NA,NA Dorin,22,409,13400,temperate,1,NA,NA,NA Champala,27,318,NA,temperate,1,"oceans, rainforests, plateaus",NA,3500000000 Mirial,NA,NA,NA,NA,NA,deserts,NA,NA Serenno,NA,NA,NA,NA,NA,"rainforests, rivers, mountains",NA,NA Concord Dawn,NA,NA,NA,NA,NA,"jungles, forests, deserts",NA,NA Zolan,NA,NA,NA,NA,NA,NA,NA,NA Ojom,NA,NA,NA,frigid,NA,"oceans, glaciers",100,500000000 Skako,27,384,NA,temperate,1,"urban, vines",NA,500000000000 Muunilinst,28,412,13800,temperate,1,"plains, forests, hills, mountains",25,5000000000 Shili,NA,NA,NA,temperate,1,"cities, savannahs, seas, plains",NA,NA Kalee,23,378,13850,"arid, temperate, tropical",1,"rainforests, cliffs, canyons, seas",NA,4000000000 Umbara,NA,NA,NA,NA,NA,NA,NA,NA Tatooine,23,304,10465,arid,1 standard,desert,1,200000 Jakku,NA,NA,NA,NA,NA,deserts,NA,NA

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions