Blogs

Paul Kimmel's Blog

PricedPassengerManifest View

     

For the section in Chapter 1 of Professional DevExpress ASP.NET Controls, I added a PricePaid column to the TotalFlight.Leg table. The PricePaid column is defined as a decimal and some random values were added for the Leg.PricePaid column. A new view PricedPassengerManifest was created and is shown in the  listing below. It was an omission on my part not to list the view code in the book.

Listing 1: The PricedPassengerManifest View.

SELECT
  dbo.Flight.FlightNumber,
  dbo.LegManifest.LegManifestID,
  dbo.Person.FirstName,
  dbo.Person.LastName,
  dbo.LegManifest.Seat,
  dbo.Leg.PricePaid
FROM           
  dbo.LegManifest INNER JOIN
  dbo.Person ON dbo.LegManifest.PersonID = dbo.Person.PersonID INNER JOIN
  dbo.Leg ON dbo.LegManifest.LegID = dbo.Leg.LegID INNER JOIN
  dbo.Flight ON dbo.Leg.FlightID = dbo.Flight.FlightID

Listing 2: The revised schema for the TotalFlight.Leg table.

USE [TotalFlight]
GO

/****** Object:  Table [dbo].[Leg]    Script Date: 11/29/2009 13:49:49 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Leg](
    [LegID] [int] IDENTITY(1,1) NOT NULL,
    [FlightID] [int] NOT NULL,
    [OriginID] [int] NOT NULL,
    [DestinationID] [int] NOT NULL,
    [Start] [datetime] NOT NULL,
    [EstimatedEnd] [datetime] NOT NULL,
    [ActualEnd] [datetime] NOT NULL,
    [PassengersBooked] [int] NOT NULL,
    [PassengersPresent] [int] NOT NULL,
    [Notes] [varchar](100) NULL,
    [PricePaid] [decimal](18, 0) NULL,
CONSTRAINT [PK_Leg] PRIMARY KEY CLUSTERED
(
    [LegID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

Published Nov 29 2009, 06:55 PM by Paul Kimmel (DevExpress)
Bookmark and Share

Comments

 

Carsten Berger said:

Thanks a lot Paul!!

November 30, 2009 2:53 AM
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.