Sha256: 1440b7b10f9907ecccc612417c8e9b27b1fa5d8a69ae151a9f8665433cfd4e5f

Contents?: true

Size: 1.59 KB

Versions: 5

Compression:

Stored size: 1.59 KB

Contents

CREATE TABLE AstronomicalObject (
	-- AstronomicalObject has AstronomicalObject Code,
	AstronomicalObjectCode                  varchar(12) NOT NULL,
	-- AstronomicalObject is involved in Orbit,
	IsInOrbit                               bit NULL,
	-- maybe AstronomicalObject has Mass,
	Mass                                    Real(32) NULL,
	-- maybe AstronomicalObject is a Moon and Moon has Moon Name,
	MoonName                                varchar(256) NULL,
	-- AstronomicalObject is involved in Orbit and Orbit is around AstronomicalObject and AstronomicalObject has AstronomicalObject Code,
	OrbitCenterAstronomicalObjectCode       varchar(12) NULL,
	-- AstronomicalObject is involved in Orbit and maybe Orbit has a synodic period of Nr Days,
	OrbitNrDays                             Real(32) NULL,
	-- maybe AstronomicalObject is a Planet and Planet has Planet Name,
	PlanetName                              varchar(256) NULL,
	PRIMARY KEY(AstronomicalObjectCode),
	FOREIGN KEY (OrbitCenterAstronomicalObjectCode) REFERENCES AstronomicalObject (AstronomicalObjectCode)
)
GO

CREATE VIEW dbo.MoonInAstronomicalObject_Name (MoonName) WITH SCHEMABINDING AS
	SELECT MoonName FROM dbo.AstronomicalObject
	WHERE	MoonName IS NOT NULL
GO

CREATE UNIQUE CLUSTERED INDEX PK_MoonInAstronomicalObject ON dbo.MoonInAstronomicalObject_Name(MoonName)
GO

CREATE VIEW dbo.PlanetInAstronomicalObject_Name (PlanetName) WITH SCHEMABINDING AS
	SELECT PlanetName FROM dbo.AstronomicalObject
	WHERE	PlanetName IS NOT NULL
GO

CREATE UNIQUE CLUSTERED INDEX PK_PlanetInAstronomicalObject ON dbo.PlanetInAstronomicalObject_Name(PlanetName)
GO

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
activefacts-examples-1.9.9 sql/server/Astronomy.sql
activefacts-examples-1.9.8 sql/server/Astronomy.sql
activefacts-examples-1.8.0 sql/server/Astronomy.sql
activefacts-examples-1.7.2 sql/server/Astronomy.sql
activefacts-examples-1.7.1 sql/server/Astronomy.sql