1. Trang chủ
  2. » Luận Văn - Báo Cáo

Eproject title online railway reservation

38 233 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 38
Dung lượng 2,83 MB

Nội dung

CNC-APTECH COMPUTER EDUCATION Eproject document Eproject Title:Online Railway Reservation Instructor: Semester : III Class : 1308 Group Member: Instructor Signature: - 1.Nguyen Hoai Nam - Huynh Le Quoc Bao - Van Tuan Kiet Ho Chi Minh city , 03 - 03 - 2015 INDIAN RAILWAY RESERVATION PROJECT INDIAN RAILWAY ONLINE This is to certify that the following students have completed the project Railway Reservation System under the guidancefor the fulfillment as prescribed by CNCAptech in the SEM3 STUDENTS: NGUYEN HOAI NAM 605121 HUYNH LE QUOC BAO 756918 VAN TUAN KIET 761724 [2015] INDIAN RAILWAY RESERVATION PROJECT CONTENTS: Prefix a : task sheet 1.About project 2.problem definition 3.Customer requirement specification 3.1 hardware:request hardware 3.2.Software: user software .6 3.3 System requirement Use case diagram 4.1 activity diagram for booking ticket 4.2 activity diagram for cancel ticket 10 4.3 system view: use case for guest .11 4.4 system view: use case for clerk 12 4.5 system view: use case for admin 13 entity relationship diagram 14 5.1 list of entity types .14 5.2 List of relationships 14 5.3 entity relationship diagram 14 5.4 Mapping of ERD to relational model 16 5.5 normalizaton .19 5.6 table design and structure 19 INDIAN RAILWAY RESERVATION PROJECT 5.7 queries 30 form design 29 INDIAN RAILWAY RESERVATION PROJECT Project Ref.No: Date of Preparation of Activity Plan: eP/TECHBOOKS/01 Sr.No Task Project Title: Activity Plan Prepared By: Actual Actual Start Date Days Team Member Names Font-end interface design Indian railway reservations Huynh Le Quoc Bao Design Database Indian railway reservations Nguyen Hoai Nam Indian railway reservations Van Tuan Kiet Document Back-end interface design Status INDIAN RAILWAY RESERVATION PROJECT About project This system is basically concerned with the reservation and cancellation of railway tickets to the passenger The need of this this system arouse because as is the know fact that India has the largest railway network in the whole world and it is not nossible to handle such a large system manually By computerizing it, it became possible to overcome the limitations and make the system operations more efficient The complexity in handling data and records of such a vast system got reduced and became easier by computerizing the system Being more specific, this online railway reservation systemcan perform the basic functions like reservation and cancellation The users are requied to register on the server for getting access to the database and query result retrieval Upon registration completion, each user has an account which is essentially referred to as the ‘view level’ of the customer The account contains comprehensive information of the user entered during the registration and allows the user to access their past reservation, cancellations, enquire about trains and train schedule, seat availability and make afresh reservations The user will also be able to update their account details, etc The master user of this system is the Railway Administrator who can login using a master password and once a user is authenticated as the admin, he/she can access and modify information stored in the database of this system This includes adding and updating of train, station, train routes and also managing the user and the passenger details Problem Definition The railway network is a very vast system to be handled manually and its computerization with prove to be of great help to both the employess and the passengers The customer and the admin are the two paries which are allowed to have access to the database of the system and have different view level schemas to the database information The customers are privileged with the following services: - register as a customer by providing certain personel details - Make fresh reservations and book one or more ticks - View past booking and can even cancellation of booked ticket - See trains between a pair of stations, check seat availability in trains and get the fare details Administrator is privileged with the following services: - Login as the master user using a master password - Add train, route, station… - Add reservation informations and confirm these one by clerk users The system’s sercurity has been kept into consideration well The database of the system cannot be accessed by any user either admin or clerk users without being INDIAN RAILWAY RESERVATION PROJECT authenticated by correct username and password The password set can also modified and in case if the user forgets the password, it can be recovered by giving a correct answer to a security question.This project has been designed in such a way so that it overcomes problems like data redundancy Customer requirement Specification 3.1.Hardware: Request hardware Client Processor: Intell pentiumIII 800 Mhz Memory: 128 MB Hard disk drive:10 Gb Server Intel Xeon MP Dual Core 7140N 3.3GHz - 667MHz / 2x 2Gb PC2 ECC DDR2-SDRAM/ GB / 73GB HotSwap 3.5" 15K RPM Ultra320 SAS HDD / 8X DVDROM / Dual Gigabit 10/100/1000 / 1300W HS 2/2 Rack 3U Modem 56K Monitor: 14 inch, colors 3.2.Software: Use software: Client Microsoft Windows 2000/Me or XP IE 6.0 or more Server Windows 2000 Advance Server Application: Microsoft Office 2000 Jrun 4.0 or Tomcat SQL 2000 Advance Server… 3.3 System requirement No Items Operating System Database Description Windows 2000,Xp or higher MS SQL sever 2005 of higher INDIAN RAILWAY RESERVATION PROJECT SoftWare Microsoft Visual Studio 2005 or higher use case diagram This diagram description all task of reservation and buy a ticket generally And so on, we two another diagrams for main tasks in resavation operation(4.1; 4.2) In the real world, we just need to know how to get ticket So these diagram will answer for that thing INDIAN RAILWAY RESERVATION PROJECT 4.1 ACTIVITY DIAGRAM FOR BOOKING TICKET INDIAN RAILWAY RESERVATION PROJECT 4.2 ACTIVITY DIAGRAM FOR CANCEL TICKET 10 INDIAN RAILWAY RESERVATION PROJECT USER 5.7 QUERIES SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo] [DAYS_AVAILABLE]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[DAYS_AVAILABLE]( [TRAIN_ID] [int] NOT NULL, [AVAILABLE_DAYS] [varchar](20) NOT NULL, CONSTRAINT [PK_DAYS_AVAILABLE] PRIMARY KEY CLUSTERED ( [TRAIN_ID] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo] [STATION]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[STATION]( [STATION_ID] [varchar](8) NOT NULL, [STATION_NAME] [varchar](30) NOT NULL, CONSTRAINT [PK_STATION] PRIMARY KEY CLUSTERED ( [STATION_ID] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] 24 INDIAN RAILWAY RESERVATION PROJECT END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo] [USER]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[USER]( [EMAILID] [varchar](30) NOT NULL, [PASSWORD] [varchar](15) NOT NULL, [FULLNAME] [varchar](30) NOT NULL, [GENDER] [varchar](8) NOT NULL, [AGE] [int] NOT NULL, [MOBILE] [varchar](12) NOT NULL, [CITY] [varchar](20) NOT NULL, [STATE] [varchar](25) NOT NULL, [SECURITY_QUESTION] [varchar](40) NOT NULL, [SECURITY_ANSWER] [varchar](20) NOT NULL ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo] [ADMIN]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[ADMIN]( [USERID] [varchar](20) NOT NULL, [PASSWORD] [varchar](15) NOT NULL, CONSTRAINT [PK_ADMIN] PRIMARY KEY CLUSTERED ( [USERID] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo] [TRAIN_CLASS]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[TRAIN_CLASS]( [TRAIN_ID] [int] NOT NULL, [FARE_AC1] [int] NOT NULL, [SEAT_AC1] [int] NOT NULL, [FARE_AC2] [int] NOT NULL, [SEAT_AC2] [int] NOT NULL, [FARE_AC3] [int] NOT NULL, [SEAT_AC3] [int] NOT NULL, [FARE_SLEEPER] [int] NOT NULL, 25 INDIAN RAILWAY RESERVATION PROJECT [SEAT_SLEEPER] [int] NOT NULL, [FARE_GENERAL] [int] NOT NULL, [SEAT_GENERAL] [int] NOT NULL, CONSTRAINT [PK_TRAIN_CLASS] PRIMARY KEY CLUSTERED ( [TRAIN_ID] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE [TRAIN]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[TRAIN]( [TRAIN_ID] [int] NOT NULL, [TRAIN_NAME] [varchar](50) NOT NULL, [TRAIN_TYPE] [varchar](50) NOT NULL, [SOURCE_STN] [varchar](30) NULL, [DESTINATION_STN] [varchar](30) NULL, [SOURCE_ID] [varchar](8) NULL, [DESTINATION_ID] [varchar](8) NULL, CONSTRAINT [PK_TRAIN] PRIMARY KEY CLUSTERED ( [TRAIN_ID] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE [ROUTE_HAS_STATION]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[ROUTE_HAS_STATION]( [TRAIN_ID] [int] NOT NULL, [STATION_ID] [varchar](8) NOT NULL, [STOP_NUMBER] [int] NOT NULL, CONSTRAINT [PK_ROUTE_HAS_STATION] PRIMARY KEY ( [TRAIN_ID] ASC, [STATION_ID] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE ON [PRIMARY] object_id = OBJECT_ID(N'[dbo] ON [PRIMARY] object_id = OBJECT_ID(N'[dbo] CLUSTERED ON [PRIMARY] object_id = OBJECT_ID(N'[dbo] 26 INDIAN RAILWAY RESERVATION PROJECT [PASSENGER_TICKET]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[PASSENGER_TICKET]( [PNR] [varchar](25) NOT NULL, [SOURCE_ID] [varchar](8) NOT NULL, [DESTINATION_ID] [varchar](8) NOT NULL, [CLASS_TYPE] [varchar](50) NOT NULL, [RESERVATION_STATUS] [varchar](25) NOT NULL, [TRAIN_ID] [int] NOT NULL, [BOOKED_BY] [varchar](30) NULL, CONSTRAINT [PK_PASSENGER_TICKET] PRIMARY KEY CLUSTERED ( [PNR] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo] [ROUTE]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[ROUTE]( [TRAIN_ID] [int] NOT NULL, [STOP_NUMBER] [int] NOT NULL, [STATION_ID] [varchar](8) NOT NULL, [ARRIVALL_TIME] [text] NOT NULL, [DEPARTURE_TIME] [text] NOT NULL, [SOURCE_DISTANCE] [int] NOT NULL, CONSTRAINT [PK_ROUTE] PRIMARY KEY CLUSTERED ( [TRAIN_ID] ASC, [STOP_NUMBER] ASC, [STATION_ID] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo] [RESERVATION]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[RESERVATION]( [TRAIN_ID] [int] NOT NULL, [AVAILABLE_DATE] [varchar](20) NOT NULL, [EMAILID] [varchar](30) NOT NULL, [PNR] [varchar](25) NOT NULL, [RESERVATION_DATE] [text] NOT NULL, [RESERVATION_STATUS] [varchar](20) NULL, CONSTRAINT [PK_RESERVATION] PRIMARY KEY CLUSTERED ( 27 INDIAN RAILWAY RESERVATION PROJECT [TRAIN_ID] ASC, [AVAILABLE_DATE] ASC, [EMAILID] ASC, [PNR] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo] [PASSENGER]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[PASSENGER]( [PNR] [varchar](25) NOT NULL, [SEAT_NUMBER] [int] NOT NULL, [PASSENGER_NAME] [varchar](30) NOT NULL, [AGE] [int] NOT NULL, [GENDER] [varchar](8) NOT NULL, [TRAIN_ID] [int] NOT NULL, [BOOKED_BY] [varchar](30) NULL, CONSTRAINT [PK_PASSENGER] PRIMARY KEY CLUSTERED ( [PNR] ASC, [SEAT_NUMBER] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo] [TRAIN_STATUS]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[TRAIN_STATUS]( [TRAIN_ID] [int] NOT NULL, [AVAILABLE_DATE] [varchar](20) NOT NULL, [BOOKED_AC1] [int] NULL, [BOOKED_AC2] [int] NULL, [BOOKED_AC3] [int] NULL, [BOOKED_SLEEPER] [int] NULL, [BOOKED_GENERAL] [int] NULL, [WAITING_AC1] [int] NULL, [WAITING_AC2] [int] NULL, [WAITING_AC3] [int] NULL, [WATTING_SEEPER] [int] NULL, [WATTING_GENERAL] [int] NULL, [AVAILABLE_AC1] [int] NULL, [AVAILABLE_AC2] [int] NULL, [AVAILABLE_AC3] [int] NULL, [AVAILABLE_SLEEPER] [int] NULL, [AVAILABLE_GENERAL] [int] NULL, 28 INDIAN RAILWAY RESERVATION PROJECT CONSTRAINT [PK_TRAIN_STATUS] PRIMARY KEY CLUSTERED ( [TRAIN_ID] ASC, [AVAILABLE_DATE] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_TRAIN_DAYS_AVAILABLE]') AND parent_object_id = OBJECT_ID(N'[dbo].[TRAIN]')) ALTER TABLE [dbo].[TRAIN] WITH CHECK ADD CONSTRAINT [FK_TRAIN_DAYS_AVAILABLE] FOREIGN KEY([TRAIN_ID]) REFERENCES [dbo].[DAYS_AVAILABLE] ([TRAIN_ID]) GO ALTER TABLE [dbo].[TRAIN] CHECK CONSTRAINT [FK_TRAIN_DAYS_AVAILABLE] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_TRAIN_STATION]') AND parent_object_id = OBJECT_ID(N'[dbo].[TRAIN]')) ALTER TABLE [dbo].[TRAIN] WITH CHECK ADD CONSTRAINT [FK_TRAIN_STATION] FOREIGN KEY([SOURCE_ID]) REFERENCES [dbo].[STATION] ([STATION_ID]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[TRAIN] CHECK CONSTRAINT [FK_TRAIN_STATION] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_TRAIN_STATION1]') AND parent_object_id = OBJECT_ID(N'[dbo].[TRAIN]')) ALTER TABLE [dbo].[TRAIN] WITH CHECK ADD CONSTRAINT [FK_TRAIN_STATION1] FOREIGN KEY([DESTINATION_ID]) REFERENCES [dbo].[STATION] ([STATION_ID]) GO ALTER TABLE [dbo].[TRAIN] CHECK CONSTRAINT [FK_TRAIN_STATION1] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_TRAIN_TRAIN_CLASS]') AND parent_object_id = OBJECT_ID(N'[dbo].[TRAIN]')) ALTER TABLE [dbo].[TRAIN] WITH CHECK ADD CONSTRAINT [FK_TRAIN_TRAIN_CLASS] FOREIGN KEY([TRAIN_ID]) REFERENCES [dbo].[TRAIN_CLASS] ([TRAIN_ID]) GO ALTER TABLE [dbo].[TRAIN] CHECK CONSTRAINT [FK_TRAIN_TRAIN_CLASS] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ROUTE_HAS_STATION_STATION]') AND parent_object_id = OBJECT_ID(N'[dbo].[ROUTE_HAS_STATION]')) ALTER TABLE [dbo].[ROUTE_HAS_STATION] WITH CHECK ADD CONSTRAINT [FK_ROUTE_HAS_STATION_STATION] FOREIGN KEY([STATION_ID]) REFERENCES [dbo].[STATION] ([STATION_ID]) GO ALTER TABLE [dbo].[ROUTE_HAS_STATION] CHECK CONSTRAINT [FK_ROUTE_HAS_STATION_STATION] GO 29 INDIAN RAILWAY RESERVATION PROJECT IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ROUTE_HAS_STATION_TRAIN]') AND parent_object_id = OBJECT_ID(N'[dbo].[ROUTE_HAS_STATION]')) ALTER TABLE [dbo].[ROUTE_HAS_STATION] WITH CHECK ADD CONSTRAINT [FK_ROUTE_HAS_STATION_TRAIN] FOREIGN KEY([TRAIN_ID]) REFERENCES [dbo].[TRAIN] ([TRAIN_ID]) GO ALTER TABLE [dbo].[ROUTE_HAS_STATION] CHECK CONSTRAINT [FK_ROUTE_HAS_STATION_TRAIN] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_PASSENGER_TICKET_STATION]') AND parent_object_id = OBJECT_ID(N'[dbo].[PASSENGER_TICKET]')) ALTER TABLE [dbo].[PASSENGER_TICKET] WITH CHECK ADD CONSTRAINT [FK_PASSENGER_TICKET_STATION] FOREIGN KEY([SOURCE_ID]) REFERENCES [dbo].[STATION] ([STATION_ID]) GO ALTER TABLE [dbo].[PASSENGER_TICKET] CHECK CONSTRAINT [FK_PASSENGER_TICKET_STATION] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_PASSENGER_TICKET_STATION1]') AND parent_object_id = OBJECT_ID(N'[dbo].[PASSENGER_TICKET]')) ALTER TABLE [dbo].[PASSENGER_TICKET] WITH CHECK ADD CONSTRAINT [FK_PASSENGER_TICKET_STATION1] FOREIGN KEY([DESTINATION_ID]) REFERENCES [dbo].[STATION] ([STATION_ID]) GO ALTER TABLE [dbo].[PASSENGER_TICKET] CHECK CONSTRAINT [FK_PASSENGER_TICKET_STATION1] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ROUTE_STATION]') AND parent_object_id = OBJECT_ID(N'[dbo].[ROUTE]')) ALTER TABLE [dbo].[ROUTE] WITH CHECK ADD CONSTRAINT [FK_ROUTE_STATION] FOREIGN KEY([STATION_ID]) REFERENCES [dbo].[STATION] ([STATION_ID]) GO ALTER TABLE [dbo].[ROUTE] CHECK CONSTRAINT [FK_ROUTE_STATION] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ROUTE_TRAIN]') AND parent_object_id = OBJECT_ID(N'[dbo] [ROUTE]')) ALTER TABLE [dbo].[ROUTE] WITH CHECK ADD CONSTRAINT [FK_ROUTE_TRAIN] FOREIGN KEY([TRAIN_ID]) REFERENCES [dbo].[TRAIN] ([TRAIN_ID]) GO ALTER TABLE [dbo].[ROUTE] CHECK CONSTRAINT [FK_ROUTE_TRAIN] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_RESERVATION_PASSENGER_TICKET]') AND parent_object_id = OBJECT_ID(N'[dbo].[RESERVATION]')) ALTER TABLE [dbo].[RESERVATION] WITH CHECK ADD CONSTRAINT [FK_RESERVATION_PASSENGER_TICKET] FOREIGN KEY([PNR]) REFERENCES [dbo].[PASSENGER_TICKET] ([PNR]) GO ALTER TABLE [dbo].[RESERVATION] CHECK CONSTRAINT 30 INDIAN RAILWAY RESERVATION PROJECT [FK_RESERVATION_PASSENGER_TICKET] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_RESERVATION_TRAIN_STATUS]') AND parent_object_id = OBJECT_ID(N'[dbo].[RESERVATION]')) ALTER TABLE [dbo].[RESERVATION] WITH CHECK ADD CONSTRAINT [FK_RESERVATION_TRAIN_STATUS] FOREIGN KEY([TRAIN_ID], [AVAILABLE_DATE]) REFERENCES [dbo].[TRAIN_STATUS] ([TRAIN_ID], [AVAILABLE_DATE]) GO ALTER TABLE [dbo].[RESERVATION] CHECK CONSTRAINT [FK_RESERVATION_TRAIN_STATUS] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_PASSENGER_TRAIN]') AND parent_object_id = OBJECT_ID(N'[dbo].[PASSENGER]')) ALTER TABLE [dbo].[PASSENGER] WITH CHECK ADD CONSTRAINT [FK_PASSENGER_TRAIN] FOREIGN KEY([TRAIN_ID]) REFERENCES [dbo].[TRAIN] ([TRAIN_ID]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[PASSENGER] CHECK CONSTRAINT [FK_PASSENGER_TRAIN] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_TRAIN_STATUS_TRAIN]') AND parent_object_id = OBJECT_ID(N'[dbo].[TRAIN_STATUS]')) ALTER TABLE [dbo].[TRAIN_STATUS] WITH CHECK ADD CONSTRAINT [FK_TRAIN_STATUS_TRAIN] FOREIGN KEY([TRAIN_ID]) REFERENCES [dbo].[TRAIN] ([TRAIN_ID]) GO ALTER TABLE [dbo].[TRAIN_STATUS] CHECK CONSTRAINT [FK_TRAIN_STATUS_TRAIN] FORM DESIGN 6.1 FONT-END FORM All form user for font-end area, with all these one, guest can reservation ticket, search informations about trains, routes, fare… 31 INDIAN RAILWAY RESERVATION PROJECT 32 INDIAN RAILWAY RESERVATION PROJECT 33 INDIAN RAILWAY RESERVATION PROJECT 34 INDIAN RAILWAY RESERVATION PROJECT 6.2 BACK-END FORM: These form follow user like clerk or administrators can manager all informations such as insert a new train, route, fare, confirm ticket not only have all forms like font-end area but also this area have some new form like add trains, add route… 35 INDIAN RAILWAY RESERVATION PROJECT 36 INDIAN RAILWAY RESERVATION PROJECT 37 [...]...INDIAN RAILWAY RESERVATION PROJECT 4.3 SYSTEM VIEW: USER CASE FOR GUEST 11 INDIAN RAILWAY RESERVATION PROJECT 4.4 SYSTEM VIEW: USER CASE FOR CLERK 12 INDIAN RAILWAY RESERVATION PROJECT 4.5 SYSTEM VIEW : USE CASE FOR ADMIN 13 INDIAN RAILWAY RESERVATION PROJECT 5 ENTITY RELATIONSHIP DIAGRAM 5.1 List of entity types: 14 INDIAN RAILWAY RESERVATION PROJECT s.no Entity Attributes... INDIAN RAILWAY RESERVATION PROJECT Source Show soure_id) Station, passenger Destinatio n Foreign key Passenger(PNR, seat_number, class, name, age, gender, fare, destination_id 5.5 normalization 18 INDIAN RAILWAY RESERVATION PROJECT 5.6 TABLE DESIGN & STRUCTURE 19 INDIAN RAILWAY RESERVATION PROJECT TRAIN TRAIN_CLASS TRAIN_STATUS 20 INDIAN RAILWAY RESERVATION PROJECT STATION ROUTE 21 INDIAN RAILWAY RESERVATION. .. [FK_TRAIN_STATUS_TRAIN] 6 FORM DESIGN 6.1 FONT-END FORM All form user for font-end area, with all these one, guest can reservation ticket, search informations about trains, routes, fare… 31 INDIAN RAILWAY RESERVATION PROJECT 32 INDIAN RAILWAY RESERVATION PROJECT 33 INDIAN RAILWAY RESERVATION PROJECT 34 INDIAN RAILWAY RESERVATION PROJECT 6.2 BACK-END FORM: These form follow user like clerk or administrators can manager... object_id = OBJECT_ID(N'[dbo].[FK _RESERVATION_ PASSENGER_TICKET]') AND parent_object_id = OBJECT_ID(N'[dbo]. [RESERVATION] ')) ALTER TABLE [dbo]. [RESERVATION] WITH CHECK ADD CONSTRAINT [FK _RESERVATION_ PASSENGER_TICKET] FOREIGN KEY([PNR]) REFERENCES [dbo].[PASSENGER_TICKET] ([PNR]) GO ALTER TABLE [dbo]. [RESERVATION] CHECK CONSTRAINT 30 INDIAN RAILWAY RESERVATION PROJECT [FK _RESERVATION_ PASSENGER_TICKET] GO... object_id = OBJECT_ID(N'[dbo] [RESERVATION] ') AND type in (N'U')) BEGIN CREATE TABLE [dbo]. [RESERVATION] ( [TRAIN_ID] [int] NOT NULL, [AVAILABLE_DATE] [varchar](20) NOT NULL, [EMAILID] [varchar](30) NOT NULL, [PNR] [varchar](25) NOT NULL, [RESERVATION_ DATE] [text] NOT NULL, [RESERVATION_ STATUS] [varchar](20) NULL, CONSTRAINT [PK _RESERVATION] PRIMARY KEY CLUSTERED ( 27 INDIAN RAILWAY RESERVATION PROJECT [TRAIN_ID]... object_id = OBJECT_ID(N'[dbo].[FK _RESERVATION_ TRAIN_STATUS]') AND parent_object_id = OBJECT_ID(N'[dbo]. [RESERVATION] ')) ALTER TABLE [dbo]. [RESERVATION] WITH CHECK ADD CONSTRAINT [FK _RESERVATION_ TRAIN_STATUS] FOREIGN KEY([TRAIN_ID], [AVAILABLE_DATE]) REFERENCES [dbo].[TRAIN_STATUS] ([TRAIN_ID], [AVAILABLE_DATE]) GO ALTER TABLE [dbo]. [RESERVATION] CHECK CONSTRAINT [FK _RESERVATION_ TRAIN_STATUS] GO IF NOT... RAILWAY RESERVATION PROJECT TRAIN TRAIN_CLASS TRAIN_STATUS 20 INDIAN RAILWAY RESERVATION PROJECT STATION ROUTE 21 INDIAN RAILWAY RESERVATION PROJECT RESERVATION PASSENGER_TICKET PASSENGER 22 INDIAN RAILWAY RESERVATION PROJECT DAY_AVAILABLE ADMIN 23 INDIAN RAILWAY RESERVATION PROJECT USER 5.7 QUERIES SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id... Station, route 3 Has Train, train_status 4 Checks User, train_status 5 Has Train, route 6 Starts from/ ends on Train, stations 7 Assigns User, passenger 15 INDIAN RAILWAY RESERVATION PROJECT 5.3 entity relationship drigram 16 INDIAN RAILWAY RESERVATION PROJECT 5.4 Mapping of ERD to relational model Step 1 : mapping of strong entity type S.no Entity type Relation 1 User User( email_ID, username, gender,... OBJECT_ID(N'[dbo] CLUSTERED ON [PRIMARY] object_id = OBJECT_ID(N'[dbo] 26 INDIAN RAILWAY RESERVATION PROJECT [PASSENGER_TICKET]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[PASSENGER_TICKET]( [PNR] [varchar](25) NOT NULL, [SOURCE_ID] [varchar](8) NOT NULL, [DESTINATION_ID] [varchar](8) NOT NULL, [CLASS_TYPE] [varchar](50) NOT NULL, [RESERVATION_ STATUS] [varchar](25) NOT NULL, [TRAIN_ID] [int] NOT NULL, [BOOKED_BY]... [FK_ROUTE_HAS_STATION_STATION] FOREIGN KEY([STATION_ID]) REFERENCES [dbo].[STATION] ([STATION_ID]) GO ALTER TABLE [dbo].[ROUTE_HAS_STATION] CHECK CONSTRAINT [FK_ROUTE_HAS_STATION_STATION] GO 29 INDIAN RAILWAY RESERVATION PROJECT IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_ROUTE_HAS_STATION_TRAIN]') AND parent_object_id = OBJECT_ID(N'[dbo].[ROUTE_HAS_STATION]'))

Ngày đăng: 13/06/2016, 16:46

TỪ KHÓA LIÊN QUAN

w