-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinstall.sql
1885 lines (1714 loc) · 110 KB
/
install.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Encoding: UTF-8
* Since: November, 2022
* Author: gvenzl
* Name: install.sql
* Description: DDL setup and data load script for Solar System data.
*
* Copyright 2022 Gerald Venzl
*
* Data Sources:
* - NSSDCA/NASA Planetary Fact Sheets (https://nssdc.gsfc.nasa.gov/planetary/planetfact.html)
*
* This work is licensed under the
* Creative Commons Attribution 4.0 International Public License, CC BY 4.0
*
* The Data is provided "as is" without warranty or any representation of
* accuracy, timeliness or completeness.
*
* https://creativecommons.org/licenses/by/4.0/
*/
/****************************************************************************************************************************/
/****************************************************************************************************************************/
/****************************************************************************************************************************/
/******************************* D a t a m o d e l s e t u p *************************************************/
/****************************************************************************************************************************/
/****************************************************************************************************************************/
/****************************************************************************************************************************/
/****************************************************************************************************************************/
/************************************************ M E T A D A T A ***********************************************************/
/****************************************************************************************************************************/
CREATE TABLE metadata
(
metadata_id NUMERIC NOT NULL,
table_name VARCHAR(13) NOT NULL,
column_name VARCHAR(52) NOT NULL,
meaning VARCHAR(4000),
CONSTRAINT metadata_pk
PRIMARY KEY (metadata_id)
);
/****************************************************************************************************************************/
/************************************************ S T A R S *****************************************************************/
/****************************************************************************************************************************/
CREATE TABLE stars
(
star_id NUMERIC NOT NULL, -- Internally generated ID, not meaningful
name VARCHAR(50) NOT NULL, -- Name of the star
discoverer VARCHAR(100), -- Name of the discoverer
dicovery_date DATE, -- Date of discovery
mass_10_exp_24_kg REAL, -- Mass of the body in 10^24 kilograms
gm_10_exp_6_km_exp_3_per_s_exp_2 REAL, -- Gravitational constant times the mass of the body in 10^6 kilometers^3/seconds^2
volume_10_exp_12_km_exp_3 REAL, -- Volume of the body in 10^12 km^3
mean_volumetric_radius_km REAL, -- Radius of a sphere with the same volume as the body
mean_density_kg_per_m_exp_3 REAL, -- Average density of the body (mass/volume) in kilograms/(meter^3)
gravity_m_per_s_exp_2 REAL, -- Equatorial gravitational acceleration at the surface of the body or the 1 bar level, not including the effects of rotation, in meters/(second^2)
escape_velocity_km_per_s REAL, -- Initial velocity required to escape the body's gravitational pull in kilometers/second (at equator)
ellipticity REAL, -- Flattening - The ratio (equatorial - polar radius)/(equatorial radius), dimensionless
moment_of_inertia_I_per_MR_exp_2 REAL, -- The moment of inertia of the body expressed as the rotational inertia divided by the body's mass x radius^2, where radius^2 = {2(Requator^2) + Rpolar^2}/3. A hollow spherical shell has a moment of inertia of 2/3, a homogeneous sphere 0.4, dimensionless
vband_magnitude REAL, -- V-band magnitude V(1,0) - The magnitude of the body in the V-band (0.549 micrometers) if it were one AU (1.496 x 10^8 kilometers) from the Earth at a phase angle of zero, dimensionless.
absolute_magnitude REAL, -- The absolute magnitude of the body
luminosity_10_exp_24_J_per_s REAL, -- Body's luminosity in 10^24 Joule per second
mass_conversion_rate_10_exp_6_kg_per_s REAL, -- The mass that's converted into energy in 10^6kg per second.
mean_energy_production_10_exp_minus_3_J_per_kg_s REAL, -- The mean energy production of the body in 10^-3 Joule/kilograms per second.
surface_emission_10_exp_6_J_per_m_exp_2_s REAL, -- Body's surface energy emission in 10^6 Joule/m2 per seconds.
spectral_type VARCHAR(10), -- The spectral type of the star, see https://lweb.cfa.harvard.edu/~pberlind/atlas/htmls/note.html for reference
central_pressure_10_exp_11_bar REAL, -- Pressue at the center of the body in 10^11 bar
central_temperature_10_exp_7_K REAL, -- Temperature at the center of the body in 10^7 Kelvin
central_density_10_exp_5_kg_per_m_exp_3 REAL, -- Density at the center fo the body in 10^5 kilograms per meters^3
sidereal_rotation_period_hrs REAL, -- Time for one rotation of the body on its axis relative to the fixed stars, in earth hours. A minus sign indicates retrograde (backwards relative to the Earth) rotation.
obliquity_to_ecliptic_degrees REAL, -- Inclination of the body's equator with respect to the ecliptic.
speed_relative_to_nearby_stars_km_per_s REAL, -- Body's speed relative to nearby stars in km/s
north_pole_of_rotation_right_ascension REAL, -- The angular distance of a particular point measured eastward along the celestial equator from the Sun at the March equinox to the point in question above the Earth.
north_pole_of_rotation_declination REAL, -- Declination of body on the celestial sphereints. Points north of the celestial equator have positive declinations, while those south have negative declinations.
north_pole_of_rotation_reference_date VARCHAR(35), -- Reference date of rotation measured in UTC. This string contains the ISO 8601 date format followed by the Julian Day number in parenthesis.
apparent_diameter_from_earth_at_1_AU_s_of_arc REAL, -- The apparent diameter of the body across its equator as seen from Earth at one Astronomical Unit, measured in arc seconds.
max_apparent_diameter_from_earth_s_of_arc REAL, -- The apparent diameter of the body across its equator as seen from Earth at the maximum distance from Earth, measured in arc seconds.
min_apparent_diameter_from_earth_s_of_arc REAL, -- The apparent diameter of the body across its equator as seen from Earth at the minimum distance from Earth, measured in arc seconds.
mean_distance_from_earth_10_exp_6_km REAL, -- Mean distance from earth in 10^6 kilometers
min_distance_from_earth_10_exp_6_km REAL, -- Minimum distance from earth in 10^6 kilometers
max_distance_from_earth_10_exp_6_km REAL, -- Maximum distance from earth in 10^6 kilometers
min_magentic_field_strength_polar_field_gauss REAL, -- Minimum magnetic field strength at the polar field in Gauss
max_magentic_field_strength_polar_field_gauss REAL, -- Maximum magnetic field strength at the polar field in Gauss
magentic_strength_sunspots_gauss REAL, -- Magnetic field strength of sunspots in Gauss
min_magentic_strength_prominences_gauss REAL, -- Minimum magnetic field strength of prominences in Gauss
max_magentic_strength_prominences_gauss REAL, -- Maximum magnetic field strength of prominences in Gauss
magentic_strength_chromospheric_plages_gauss REAL, -- Magnetic field strength of chromospheric plages in Gauss
magentic_strength_bright_chromospheric_network_gauss REAL, -- Magnetic field strength of bright chromospheric network in Gauss
magentic_strength_ephemeral_active_regions_gauss REAL, -- Magnetic field strength of ephemeral (unipolar) active regions in Gauss
surface_gas_pressure_top_of_photosphere_mb REAL, -- Atmospheric pressure at the top of the photosphere surface in millibars
surface_gas_pressure_bottom_of_photosphere_mb REAL, -- Atmospheric pressure at the bottom of photosphere surface in millibars
effective_temperature_K REAL, -- The effective temperature of a body is the temperature a black body of the same size must have to yield the same total emissive power, measured in Kelvin.
temperature_at_top_of_photosphere_K REAL, -- Temperature at the top of the photosphere in Kelvin
temperature_at_bottom_of_photosphere_K REAL, -- Temperature at the bottom of the photosphere in Kelvin
temperature_at_top_of_chromosphere_K REAL, -- Temperature at the top of the chromosphere in Kelvin
photosphere_thickness_km REAL, -- Photosphere thickness in kilometers
chromosphere_thickness_km REAL, -- Chromosphere thickness in kilometers
sun_spot_cycle_yrs REAL, -- Cycle of sun spots in earth years.
photosphere_composition VARCHAR(1000), -- Composition of photosphere elements
CONSTRAINT stars_pk
PRIMARY KEY (star_id)
);
/****************************************************************************************************************************/
/************************************************ P L A N E T S *************************************************************/
/****************************************************************************************************************************/
CREATE TABLE planets
(
planet_id NUMERIC NOT NULL, -- Internally generated ID, not meaningful
name VARCHAR(50) NOT NULL, -- Name of the planet
star_id NUMERIC, -- ID of the star the planet is orbiting
discoverer VARCHAR(100), -- Name of the discoverer
discovery_date DATE, -- Date of discovery
mass_10_exp_24_kg REAL, -- Mass of the body in 10^24 kilograms
volume_10_exp_10_km_exp_3 REAL, -- Volume of the body in 10^12 km^3
equatorial_radius_km REAL, -- Radius of the body at the equator in kilometers
core_radius_km REAL, -- Radius of the planet core in kilometers
polar_radius_km REAL, -- Radius of the body at the poles in kilometers
mean_volumetric_radius_km REAL, -- Radius of a sphere with the same volume as the body
diameter_km REAL, -- The planetary diameter used is two times the volumetric mean radius. For Venus, Jupiter, Saturn, Uranus, and Neptune, diameter is approximately to the visible cloud tops.
number_of_moons NUMERIC(3), -- The number of moons orbiting the planet, as certified by the IAU
has_ring_system CHAR(1), -- This tells whether a planet has a set of rings around it, Saturn being the most obvious example.
has_global_magnetic_field CHAR(1), -- This tells whether the planet has a measurable large-scale magnetic field. Mars and the Moon have localized regional magnetic fields but no global field.
rotation_period_hrs REAL, -- This is the time it takes for the planet to complete one rotation relative to the fixed background stars (not relative to the Sun) in hours. Negative numbers indicate retrograde (backwards relative to the Earth) rotation.
length_of_day_hrs REAL, -- The average time in hours for the Sun to move from the noon position in the sky at a point on the equator back to the same position.
ellipticity REAL, -- Flattening - The ratio (equatorial - polar radius)/(equatorial radius), dimensionless
distance_from_sun_10_exp_6_km REAL, -- This is the average distance from the planet to the Sun in millions of kilometers or millions of miles, also known as the semi-major axis. All planets have orbits which are elliptical, not perfectly circular, so there is a point in the orbit at which the planet is closest to the Sun, the perihelion, and a point furthest from the Sun, the aphelion. The average distance from the Sun is midway between these two values. The average distance from the Earth to the Sun is defined as 1 Astronomical Unit (AU), so the ratio table gives this distance in AU.
mean_distance_from_earth_10_exp_6_km REAL, -- Approximate values for the minimum and maximum distances of the planets from Earth. Orbits fluctuate over time, these values are calculated from the mean orbital elements for J2000 250 year fits and the current orbits referenced to Julian Date 2459000.5 (11 June 2020).
min_distance_from_earth_10_exp_6_km REAL, -- Approximate values for the minimum and maximum distances of the planets from Earth. Orbits fluctuate over time, these values are calculated from the mean orbital elements for J2000 250 year fits and the current orbits referenced to Julian Date 2459000.5 (11 June 2020).
max_distance_from_earth_10_exp_6_km REAL, -- Approximate values for the minimum and maximum distances of the planets from Earth. Orbits fluctuate over time, these values are calculated from the mean orbital elements for J2000 250 year fits and the current orbits referenced to Julian Date 2459000.5 (11 June 2020).
mean_density_kg_per_m_exp_3 REAL, -- Average density of the body (mass/volume) in kilograms/(meter^3)
gravity_m_per_s_exp_2 REAL, -- Equatorial gravitational acceleration at the surface of the body or the 1 bar level, not including the effects of rotation, in meters/(second^2)
acceleration_m_per_s_exp_2 REAL, -- Effective equatorial gravitational acceleration at the surface of the body or the 1 bar level, including the effects of rotation, in meters/(second^2)
escape_velocity_km_per_s REAL, -- Initial velocity required to escape the body's gravitational pull in kilometers/second (at equator)
mean_temperature_K REAL, -- Mean temperature of the body over the entire surface in Kelvin.
mean_temperature_C REAL, -- Mean temperature of the body over the entire surface in Celsius.
surface_pressure_bars REAL, -- Atmospheric pressure at the surface, in bars.
gm_10_exp_6_km_exp_3_per_s_exp_2 REAL, -- Gravitational constant times the mass of the body in 10^6 kilometers^3/seconds^2
bond_albedo REAL, -- The fraction of incident solar radiation reflected back into space without absorption, dimensionless. Also called planetary albedo.
geometric_albedo REAL, -- The ratio of the body's brightness at a phase angle of zero to the brightness of a perfectly diffusing disk with the same position and apparent size, dimensionless. V-band (0.549 micrometers). Earth is highly variable.
vband_magnitude REAL, -- The magnitude of the body in the V-band (0.549 micrometers) if it were one AU (1.496 x 10^8 kilometers) from the Earth at a phase angle of zero, dimensionless.
solar_irradiance_W_per_m_exp_2 REAL, -- Solar energy on the body in Watts/(meter^2)
black_body_temperature_K REAL, -- Equivalent black body temperature is the surface temperature the body would have if it were in radiative equilibrium and had no atmosphere, but the same albedo, in Kelvin.
topographic_range_km REAL, -- Difference in elevation between the highest and lowest points on the planet's surface, in kilometers.
moment_of_inertia_I_per_MR_exp_2 REAL, -- The moment of inertia of the body expressed as the rotational inertia divided by the body's mass x radius^2, where radius^2 = {2(Requator^2) + Rpolar^2}/3. A hollow spherical shell has a moment of inertia of 2/3, a homogeneous sphere 0.4, dimensionless.
J_2_10_exp_minus_6 REAL, -- The ratio of the difference in the moments of inertia (rotational vs polar) to the mass of the body times the radius^2,(C-A)/(M R^2), x 10^-6, dimensionless.
semimajor_axis_au REAL, -- Approximate mean distance from the Sun (or other central body in the case of satellites) from center to center in Astronomical Units.
semimajor_axis_10_exp_6_km REAL, -- Approximate mean distance from the Sun (or other central body in the case of satellites) from center to center in 10^6 kilometers.
sidereal_orbit_period_days REAL, -- The time it takes the body to make one revolution about the Sun relative to the fixed stars in days. For Pluto, it is the time from the last zero longitude crossing to the next (24 July 1820 - 2 July 2068).
tropical_orbit_period_days REAL, -- The average time for the body to make one revolution about the Sun from one point in its seasonal orbit to the equivalent point (e.g. equinox to equinox) in days. For Earth, this equals exactly 1 year. Not known for Pluto.
perihelion_10_exp_6_km REAL, -- The point in a body's orbit closest to the Sun, in 10^6 kilometers.
aphelion_10_exp_6_km REAL, -- The point in a body's orbit furthest from the Sun, in 10^6 kilometers.
synodic_period_days REAL, -- The time interval between similar configurations in the orbit (e.g. opposition) of the body and Earth, in days.
orbital_period_days REAL, -- This is the time in Earth days for a planet to orbit the Sun from one vernal equinox to the next. Also known as the tropical orbit period, this is equal to a year on Earth. For the Moon, the sidereal orbit period, the time to orbit once relative to the fixed background stars, is given. The time from full Moon to full Moon, or synodic period, is 29.53 days. For Pluto, the tropical orbit period is not well known, the sidereal orbit period is used.
mean_orbital_velocity_km_per_s REAL, -- The average speed of the body in elliptical orbit, in kilometers/second.
max_orbital_velocity_km_per_s REAL, -- Maximum orbital velocity, at perihelion, in kilometers/second.
min_orbital_velocity_km_per_s REAL, -- Minimum orbital velocity, at aphelion, in kilometers/second.
orbital_inclination_degrees REAL, -- The inclination of the orbit to the ecliptic, in degrees.
orbital_eccentricity REAL, -- A measure of the circularity of the orbit, equal to (aphelion - perihelion distance)/(2 x semi-major axis). For the Galilean satellites, the forced eccentricity is given. For a circular orbit eccentricity = 0. Dimensionless.
sidereal_rotation_period_hrs REAL, -- The time for one rotation of the body on its axis relative to the fixed stars, in hours. A minus sign indicates retrograde (backwards relative to the Earth) rotation.
obliquity_to_orbit_degrees REAL, -- The angle between the body's equator and the body's orbital plane, with north defined by the right-hand rule. (J2000)
inclination_of_equator_degrees REAL, -- The angle between the equator and orbital plane with north defined as pole axis above (north of) the plane of the solar system, also denoted as axial tilt. (J2000)
apparent_diameter_from_earth_at_1_AU_s_of_arc REAL, -- The apparent diameter of the body across its equator as seen from Earth at one Astronomical Unit, measured in arc seconds.
max_apparent_diameter_from_earth_s_of_arc REAL, -- The apparent diameter of the body across its equator as seen from Earth at the maximum distance from Earth, measured in arc seconds.
min_apparent_diameter_from_earth_s_of_arc REAL, -- The apparent diameter of the body across its equator as seen from Earth at the minimum distance from Earth, measured in arc seconds.
mean_apparent_diameter_from_earth_s_of_arc REAL, -- The apparent diameter of the body across its equator as seen from Earth at the mean distance from Earth, measured in arc seconds.
mean_apparent_visual_magnitude_from_earth REAL, -- The apparent visual magnitude of the body as seen from Earth.
max_visual_magnitude REAL, -- The maximum visual magnitude of the body.
longitude_of_ascending_node_degrees REAL, -- The longitude in a body's orbit at which it crosses the ecliptic plane with increasing latitude (i.e. crosses the ecliptic from south to north).
longitude_of_perihelion_degrees REAL, -- The longitude in a body's orbit at which it reaches the point closest to the Sun.
mean_longitude_degrees REAL, -- The longitude a body was at in its orbit at 12:00 Universal (Greenwich) Time on January 1, 2000, also known as J2000 or Julian Day 2451545.0
north_pole_of_rotation_right_ascension VARCHAR(25), -- The angular distance of a particular point measured eastward along the celestial equator from the Sun at the March equinox to the point in question above the Earth.
north_pole_of_rotation_declination VARCHAR(25), -- Declination of body on the celestial sphereints. Points north of the celestial equator have positive declinations, while those south have negative declinations.
north_pole_of_rotation_reference_date VARCHAR(35), -- Reference date of rotation measured in UTC. This string contains the ISO 8601 date format followed by the Julian Day number in parenthesis.
magnetosphere_model VARCHAR(50), -- The model used for charting the magnetosphere
dipole_field_strength_gauss_R_exp_3 REAL, -- The strength of the dipole portion of the planetary magnetic field outside the planet in Gauss-R^3, where R is in units of planet radius. (Dividing by the distance R^3 gives the field in Gauss)
dipole_tilt_to_rotational_axis_degrees REAL, -- Tilt of the dipole axis to the axis of rotation in degrees.
longitude_of_tilt_degrees REAL, -- The longitude of the tilt of the dipole axis to the axis of rotation in degrees.
dipole_offset_R REAL, -- The offset distance of the dipole center to the planet center in units of planet radius.
surface_field_strength_1_R_gauss VARCHAR(25), -- Range of total field strength at planet radius in Gauss.
geomagnetic_poles_model VARCHAR(50), -- The model used for charting the geomagnetic poles
latitude_geocentric_dipole_degrees REAL, -- The latitude of the geocentric dipole
longitude_geocentric_dipole_degrees REAL, -- The longitude of the geocentric dipole
latitude_magnetic_north_pole_degrees REAL, -- The latitude of the magnetic north pole
longitude_magnetic_north_pole_degrees REAL, -- The longitude of the magnetic north pole
atmosphere_composition VARCHAR(1000), -- Atmosphere details
CONSTRAINT planets_pk
PRIMARY KEY (planet_id),
CONSTRAINT planets_stars_fk001
FOREIGN KEY (star_id) REFERENCES stars (star_id),
CONSTRAINT planets_has_ring_system_Y_N_check001
CHECK (has_ring_system IN ('Y','N')),
CONSTRAINT planets_has_global_magnetic_field_Y_N_check002
CHECK (has_global_magnetic_field IN ('Y','N'))
);
/****************************************************************************************************************************/
/****************************************************************************************************************************/
/****************************************************************************************************************************/
/************************************************ D a t a l o a d *************************************************/
/****************************************************************************************************************************/
/****************************************************************************************************************************/
/****************************************************************************************************************************/
/****************************************************************************************************************************/
/************************************************ M E T A D A T A ***********************************************************/
/****************************************************************************************************************************/
/************************************************ M E T A D A T A ***********************************************************/
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(1, 'metadata', 'metadata_id',
'Internally generated id for the primary key value.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(2, 'metadata', 'table_name',
'The name of the table.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(3, 'metadata', 'column_name',
'The name of the column.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(4, 'metadata', 'meaning',
'The meaning of the data in that particular column in the table.'
);
/************************************************ S T A R S *****************************************************************/
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(5, 'stars', 'star_id',
'Internally generated id for the primary key value.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(6, 'stars', 'name',
'The name of the star.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(7, 'stars', 'discoverer',
'The person who discovered the star.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(8, 'stars', 'dicovery_date',
'The date when the star has been discovered.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(9, 'stars', 'mass_10_exp_24_kg',
'Mass of the body in 10^24 kilograms.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(10, 'stars', 'gm_10_exp_6_km_exp_3_per_s_exp_2',
'Gravitational constant times the mass of the body in 10^6 kilometers^3 / seconds^2 (x 10^6 km^3/s^2).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(11, 'stars', 'volume_10_exp_12_km_exp_3',
'Volume of the body in 10^12 km^3.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(12, 'stars', 'mean_volumetric_radius_km',
'Radius of a sphere with the same volume as the body.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(13, 'stars', 'mean_density_kg_per_m_exp_3',
'Average density of the body (mass/volume) in kilograms/(meter^3).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(14, 'stars', 'gravity_m_per_s_exp_2',
'Equatorial gravitational acceleration at the surface of the body or the 1 bar level, not including the effects of rotation, in meters/(second^2).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(15, 'stars', 'escape_velocity_km_per_s',
'Initial velocity required to escape the body''s gravitational pull in kilometers/second (at equator).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(16, 'stars', 'ellipticity',
'Flattening - The ratio (equatorial - polar radius)/(equatorial radius), dimensionless.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(17, 'stars', 'moment_of_inertia_I_per_MR_exp_2',
'The moment of inertia of the body expressed as the rotational inertia divided by the body''s mass x radius^2, where radius^2 = {2(Requator^2) + Rpolar^2}/3. A hollow spherical shell has a moment of inertia of 2/3, a homogeneous sphere 0.4, dimensionless.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(18, 'stars', 'vband_magnitude',
'V-band magnitude V(1,0) - The magnitude of the body in the V-band (0.549 micrometers) if it were one AU (1.496 x 10^8 kilometers) from the Earth at a phase angle of zero, dimensionless.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(19, 'stars', 'absolute_magnitude',
'The absolute magnitude of the body.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(20, 'stars', 'luminosity_10_exp_24_j_per_s',
'Body''s luminosity in 10^24 Joule per second.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(21, 'stars', 'mass_conversion_rate_10_exp_6_kg_per_s',
'The mass that''s converted into energy in 10^6kg per second.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(22, 'stars', 'mean_energy_production_10_exp_minus_3_J_per_kg_s',
'The mean energy production of the body in 10^-3 J/kg per second.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(23, 'stars', 'surface_emission_10_exp_6_J_per_m_exp_2_s',
'Body''s surface energy emission in 10^6 Joule/m2 per seconds.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(24, 'stars', 'spectral_type',
'The spectral type of the star, see https://lweb.cfa.harvard.edu/~pberlind/atlas/htmls/note.html for reference.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(25, 'stars', 'central_pressure_10_exp_11_bar',
'Pressue at the center of the body in 10^11 bar.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(26, 'stars', 'central_temperature_10_exp_7_K',
'Temperature at the center of the body in 10^7 Kelvin.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(27, 'stars', 'central_density_10_exp_5_kg_per_m_exp_3',
'Density at the center fo the body in 10^5 kilograms per meters^3.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(28, 'stars', 'sidereal_rotation_period_hrs',
'Time for one rotation of the body on its axis relative to the fixed stars, in earth hours. A minus sign indicates retrograde (backwards relative to the Earth) rotation.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(29, 'stars', 'obliquity_to_ecliptic_degrees',
'Inclination of the body''s equator with respect to the ecliptic.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(30, 'stars', 'speed_relative_to_nearby_stars_km_per_s',
'Body''s speed relative to nearby stars in km/s.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(31, 'stars', 'north_pole_of_rotation_right_ascension',
'The angular distance of a particular point measured eastward along the celestial equator from the Sun at the March equinox to the point in question above the Earth.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(32, 'stars', 'north_pole_of_rotation_declination',
'Declination of body on the celestial sphereints. Points north of the celestial equator have positive declinations, while those south have negative declinations.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(33, 'stars', 'north_pole_of_rotation_reference_date',
'Reference date of rotation measured in UTC. This string contains the ISO 8601 date format followed by the Julian Day number in parenthesis.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(34, 'stars', 'apparent_diameter_from_earth_at_1_AU_s_of_arc',
'The apparent diameter of the body across its equator as seen from Earth at one Astronomical Unit, measured in arc seconds.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(35, 'stars', 'max_apparent_diameter_from_earth_s_of_arc',
'The apparent diameter of the body across its equator as seen from Earth at the maximum distance from Earth, measured in arc seconds.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(36, 'stars', 'min_apparent_diameter_from_earth_s_of_arc',
'The apparent diameter of the body across its equator as seen from Earth at the minimum distance from Earth, measured in arc seconds.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(37, 'stars', 'mean_distance_from_earth_10_exp_6_km',
'Mean distance from earth in 10^6 kilometers.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(38, 'stars', 'min_distance_from_earth_10_exp_6_km',
'Minimum distance from earth in 10^6 kilometers.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(39, 'stars', 'max_distance_from_earth_10_exp_6_km',
'Maximum distance from earth in 10^6 kilometers.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(40, 'stars', 'min_magentic_field_strength_polar_field_gauss',
'Minimum magnetic field strength at the polar field in Gauss.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(41, 'stars', 'max_magentic_field_strength_polar_field_gauss',
'Maximum magnetic field strength at the polar field in Gauss.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(42, 'stars', 'magentic_strength_sunspots_gauss',
'Magnetic field strength of sunspots in Gauss.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(43, 'stars', 'min_magentic_strength_prominences_gauss',
'Minimum magnetic field strength of prominences in Gauss.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(44, 'stars', 'max_magentic_strength_prominences_gauss',
'Maximum magnetic field strength of prominences in Gauss.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(45, 'stars', 'magentic_strength_chromospheric_plages_gauss',
'Magnetic field strength of chromospheric plages in Gauss.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(46, 'stars', 'magentic_strength_bright_chromospheric_network_gauss',
'Magnetic field strength of bright chromospheric network in Gauss.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(47, 'stars', 'magentic_strength_ephemeral_active_regions_gauss',
'Magnetic field strength of ephemeral (unipolar) active regions in Gauss.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(48, 'stars', 'surface_gas_pressure_top_of_photosphere_mb',
'Atmospheric pressure at the top of the photosphere surface in millibars.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(49, 'stars', 'surface_gas_pressure_bottom_of_photosphere_mb',
'Atmospheric pressure at the bottom of photosphere surface in millibars.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(50, 'stars', 'effective_temperature_K',
'The effective temperature of a body is the temperature a black body of the same size must have to yield the same total emissive power, measured in Kelvin.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(51, 'stars', 'temperature_at_top_of_photosphere_K',
'Temperature at the top of the photosphere in Kelvin.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(52, 'stars', 'temperature_at_bottom_of_photosphere_K',
'Temperature at the bottom of the photosphere in Kelvin.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(53, 'stars', 'temperature_at_top_of_chromosphere_K',
'Temperature at the top of the chromosphere in Kelvin.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(54, 'stars', 'photosphere_thickness_km',
'Photosphere thickness in kilometers.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(55, 'stars', 'chromosphere_thickness_km',
'Chromosphere thickness in kilometers.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(56, 'stars', 'sun_spot_cycle_yrs',
'Cycle of sun spots in Earth years.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(57, 'stars', 'photosphere_composition',
'Composition of photosphere elements in JSON format.'
);
/************************************************ P L A N E T S *************************************************************/
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(58, 'planets', 'planet_id',
'Internally generated id for the primary key value.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(59, 'planets', 'name',
'The name of the planet.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(60, 'planets', 'star_id',
'The ID of the star to which the planet belongs.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(61, 'planets', 'discoverer',
'The person who discovered the planet.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(62, 'planets', 'discovery_date',
'The date when the planet has been discovered.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(63, 'planets', 'mass_10_exp_24_kg',
'Mass of the body in 10^24 kilograms.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(64, 'planets', 'volume_10_exp_10_km_exp_3',
'Volume of the body in 10^12 km^3.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(65, 'planets', 'equatorial_radius_km',
'Radius of the body at the equator in kilometers.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(66, 'planets', 'core_radius_km',
'Radius of the planet core in kilometers.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(67, 'planets', 'polar_radius_km',
'Radius of the body at the poles in kilometers.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(68, 'planets', 'mean_volumetric_radius_km',
'Radius of a sphere with the same volume as the body.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(69, 'planets', 'diameter_km',
'The planetary diameter used is two times the volumetric mean radius. For Venus, Jupiter, Saturn, Uranus, and Neptune, diameter is approximately to the visible cloud tops.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(70, 'planets', 'number_of_moons',
'The number of moons orbiting the planet, as certified by the IAU (International Astronomical Union).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(71, 'planets', 'has_ring_system',
'This tells whether a planet has a set of rings around it, Saturn being the most obvious example.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(72, 'planets', 'has_global_magnetic_field',
'Indicates whether the planet has a measurable large-scale magnetic field. Mars has localized regional magnetic fields but no global field.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(73, 'planets', 'rotation_period_hrs',
'The time it takes for the planet to complete one rotation relative to the fixed background stars (not relative to the Sun) in hours. Negative numbers indicate retrograde (backwards relative to the Earth) rotation.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(74, 'planets', 'length_of_day_hrs',
'The average time in hours for the Sun to move from the noon position in the sky at a point on the equator back to the same position.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(75, 'planets', 'ellipticity',
'Flattening - The ratio (equatorial - polar radius)/(equatorial radius), dimensionless.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(76, 'planets', 'distance_from_sun_10_exp_6_km',
'The average distance from the planet to the Sun in millions of kilometers, also known as the semi-major axis. All planets have orbits which are elliptical, not perfectly circular, so there is a point in the orbit at which the planet is closest to the Sun, the perihelion, and a point furthest from the Sun, the aphelion. The average distance from the Sun is midway between these two values. The average distance from the Earth to the Sun is defined as 1 Astronomical Unit (AU), so the ratio table gives this distance in AU.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(77, 'planets', 'mean_distance_from_earth_10_exp_6_km',
'Approximate values for the minimum and maximum distances of the planets from Earth. Orbits fluctuate over time, these values are calculated from the mean orbital elements for J2000 250 year fits and the current orbits referenced to Julian Date 2459000.5 (11 June 2020).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(78, 'planets', 'min_distance_from_earth_10_exp_6_km',
'Approximate value for the minimum distance of the planets from Earth. Orbits fluctuate over time, these values are calculated from the mean orbital elements for J2000 250 year fits and the current orbits referenced to Julian Date 2459000.5 (11 June 2020).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(79, 'planets', 'max_distance_from_earth_10_exp_6_km',
'Approximate value for the maximum distances of the planets from Earth. Orbits fluctuate over time, these values are calculated from the mean orbital elements for J2000 250 year fits and the current orbits referenced to Julian Date 2459000.5 (11 June 2020).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(80, 'planets', 'mean_density_kg_per_m_exp_3',
'Average density of the body (mass/volume) in kilograms/(meter^3).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(81, 'planets', 'gravity_m_per_s_exp_2',
'Equatorial gravitational acceleration at the surface of the body or the 1 bar level, not including the effects of rotation, in meters/(second^2).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(82, 'planets', 'acceleration_m_per_s_exp_2',
'Effective equatorial gravitational acceleration at the surface of the body or the 1 bar level, including the effects of rotation, in meters/(second^2).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(83, 'planets', 'escape_velocity_km_per_s',
'Initial velocity required to escape the body''s gravitational pull in kilometers/second (at equator).'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(84, 'planets', 'mean_temperature_K',
'Mean temperature of the body over the entire surface in Kelvin.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(85, 'planets', 'mean_temperature_C',
'Mean temperature of the body over the entire surface in Celsius.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)
VALUES
(86, 'planets', 'surface_pressure_bars',
'Atmospheric pressure at the surface, in bars.'
);
INSERT INTO metadata
(metadata_id, table_name, column_name,
meaning
)