Type will always be rocky or gas. Length of year is always between 0.24 and 247.7. No plant has more than 20 moons. Name is never null. The default number of moons for a planet should be zero. Index the field name.
Choose types that BEST FIT this data, and that MINIMIZE table space.
Name | NumMoons | Type | LengthOfYear |
Mercury | 0 | Rocky | 0.24 |
Venus | 0 | Rocky | 0.62 |
Earth | 1 | Rocky | 1 |
Mars |
2 |
Rockey |
1.88 |
Jupiter | 16 | Gas | 11.86 |
Saturn | 18 | Gas | 29.46 |
Pluto | 1 | Rocky | 247.7 |
+------------+------+---------+ | planet | year | dest | +------------+------+---------+ | Pioneer 5 | 1960 | sun | | Mariner 10 | 1974 | Mercury | | Messenger | 2008 | Mercury | | Zond | 1964 | Venus | | Viking | 1976 | Mars | | Cassini | 2000 | Jupiter | | Galileo | 1995 | Jupiter | +------------+------+---------+
Scoring: 1 point for making a table, one point for getting the right types, one point for the index, and one point for inserting the data. Make the table, and show me the results of "select * from tablename" and "describe tablename".
7) Write an SQL querry showing how many planets there are in the database. Your query should return '7'.