applied data science capstone coursera week 2 quiz answers

Check Points: Exploratory Analysis Using SQL

1. Have you loaded the SQL extension and establish a connection with the SQLIte database ?

  • Yes
  • No

2. Have you loaded SpaceX dataset into SQLIte Table?

  • Yes
  • No

3. Have you used SQL queries with the SQL magic commands in Python to perform EDA?

  • Yes
  • No

Exploratory Data Analysis using SQL

4. Which of the following will retrieve upto 20 records from the spacex table?

  • SELECT TOP 20 rows from SPACEXTBL
  • SELECT * from SPACEXTBL MAX 20
  • SELECT * from SPACEXTBL where count(*)=20
  • SELECT * from SPACEXTBL LIMIT 20

5. Which of the following queries display the minimum payload mass?

  • select payload_mass__kg_ from SPACEXTBL order by payload_mass__kg_ desc LIMIT 1
  • select min(payload_mass__kg_) from SPACEXTBL
  • select payload_mass__kg_ from SPACEXTBL order by payload_mass__kg_ group by booster_version LIMIT 1
  • select payload_mass__kg_ from SPACEXTBL where payload_mass__kg_=(select max(payload_mass__kg_) from SPACEXTBL) LIMIT 1

6. You are writing a query that will give you the total payload_mass_kg carried by the booster versions. The mass should be stored in the mass column. You want the result column to be called “Total_Payload_Mass”. Which of the following SQL queries is correct?

  • SELECT sum(PAYLOAD_MASS__KG_) from SPACEXTBL
  • SELECT sum(PAYLOAD_MASS__KG_) as Total_Payload_Mass from SPACEXTBL
  • SELECT count(PAYLOAD_MASS__KG_) as Total_Payload_Mass from SPACEXTBL

7. Which of the following query is used to display the mission outcome counts for each launch site?

  • select count(“Mission_Outcome”) as MISSION_OUTCOME_COUNT,Launch_Site from SPACEXTBL group by “Launch_Site”;
  • select sum(“Mission_Outcome”) as MISSION_OUTCOME_COUNT,Launch_Site from SPACEXTBL group by “Launch_Site”;

8. What are the unique launch sites mentioned in the Spacex table?

  • None of the Above
  • CCAS LC-40,KSC LC-39A,VAFB SLC-4E , CCAFS SLC-80
  • CCAFS LC-40,KSC LC-39B,VAFB SLC-4k , CCAFS SLC-40
  • CCAFS LC-40,KSC LC-39A, VAFB SLC-4E , CCAFS SLC-40

Check Points: Complete the EDA with Visualization

9. Did you Visualize the relationship between different parameters?

  • Yes
  • No

10. Did you visualize the launch success yearly trend?

  • Yes
  • No

11. Did you create dummy variables to categorical columns?

  • Yes
  • No

Exploratory Data Analysis for Data Visualization

12. What type of data does a Bar Chart best represent?

  • Location Data
  • Numerical
  • Categorical
  • None of the above

13. What are the total number of columns in the features dataframe after applying one hot encoding to columns Orbits, LaunchSite, LandingPad and Serial .

Here the features dataframe consists of the following columns FlightNumber', 'PayloadMass', 'Orbit', 'LaunchSite', 'Flights', 'GridFins', 'Reused', 'Legs', 'LandingPad', 'Block', 'ReusedCount', 'Serial'

  • 120
  • 80
  • 83
  • 96

14. The catplot code to show the scatterplot of FlightNumber vs LaunchSite with x as FlightNumber, and y to Launch Site and hue to 'Class’ is

  • sns.catplot(y=”LaunchSite”,x=”FlightNumber”,hue=”Class”, data=df, aspect = 1,kind=’cat’)

    plt.ylabel(“Launch Site”,fontsize=15)

    plt.xlabel(“Flight Number”,fontsize=15)

    plt.show()

  • sns.catplot(y=”LaunchSite”,x=”FlightNumber”,hue=”Class”, data=df, aspect = 1)

    plt.ylabel(“Launch Site”,fontsize=15)

    plt.xlabel(“Flight Number”,fontsize=15)

    plt.show()

  • sns.catplot(y=”LaunchSite”,x=”FlightNumber”,hue=”Class”, data=df, aspect = 1,kind=’scatter’)

    plt.ylabel(“Launch Site”,fontsize=15)

    plt.xlabel(“Flight Number”,fontsize=15)

    plt.show()

  • sns.catplot(y=”LaunchSite”,x=”FlightNumber”,hue=”Class”, col=”Class”, data=df, aspect = 1)

    plt.ylabel(“Launch Site”,fontsize=15)

    plt.xlabel(“Flight Number”,fontsize=15)

    plt.show()

Leave a Reply