Track
Description
Table Definition
CREATE TABLE [Track]
(
[TrackId] INTEGER NOT NULL,
[Name] NVARCHAR(200) NOT NULL,
[AlbumId] INTEGER,
[MediaTypeId] INTEGER NOT NULL,
[GenreId] INTEGER,
[Composer] NVARCHAR(220),
[Milliseconds] INTEGER NOT NULL,
[Bytes] INTEGER,
[UnitPrice] NUMERIC(10,2) NOT NULL,
CONSTRAINT [PK_Track] PRIMARY KEY ([TrackId]),
FOREIGN KEY ([AlbumId]) REFERENCES [Album] ([AlbumId])
ON DELETE NO ACTION ON UPDATE NO ACTION,
FOREIGN KEY ([GenreId]) REFERENCES [Genre] ([GenreId])
ON DELETE NO ACTION ON UPDATE NO ACTION,
FOREIGN KEY ([MediaTypeId]) REFERENCES [MediaType] ([MediaTypeId])
ON DELETE NO ACTION ON UPDATE NO ACTION
)
Columns
Name | Type | Default | Nullable | Children | Parents | Comment |
---|---|---|---|---|---|---|
TrackId | INTEGER | false | InvoiceLine PlaylistTrack | |||
Name | NVARCHAR(200) | false | ||||
AlbumId | INTEGER | true | Album | |||
MediaTypeId | INTEGER | false | MediaType | |||
GenreId | INTEGER | true | Genre | |||
Composer | NVARCHAR(220) | true | ||||
Milliseconds | INTEGER | false | ||||
Bytes | INTEGER | true | ||||
UnitPrice | NUMERIC(10,2) | false |
Constraints
Name | Type | Definition |
---|---|---|
TrackId | PRIMARY KEY | PRIMARY KEY (TrackId) |
- (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (MediaTypeId) REFERENCES MediaType (MediaTypeId) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE |
- (Foreign key ID: 1) | FOREIGN KEY | FOREIGN KEY (GenreId) REFERENCES Genre (GenreId) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE |
- (Foreign key ID: 2) | FOREIGN KEY | FOREIGN KEY (AlbumId) REFERENCES Album (AlbumId) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE |
Indexes
Name | Definition |
---|---|
IFK_TrackMediaTypeId | CREATE INDEX [IFK_TrackMediaTypeId] ON [Track] ([MediaTypeId]) |
IFK_TrackGenreId | CREATE INDEX [IFK_TrackGenreId] ON [Track] ([GenreId]) |
IFK_TrackAlbumId | CREATE INDEX [IFK_TrackAlbumId] ON [Track] ([AlbumId]) |