0% found this document useful (0 votes)
2 views35 pages

Document 1

The document outlines an IT project on creating a relational database management system (RDBMS) for railways, detailing the importance of RDBMS in managing data such as train schedules and passenger bookings. It includes steps for designing the database, creating tables, establishing relationships, and utilizing Microsoft Access for data management. The project also emphasizes the use of forms and queries for user interaction and data retrieval within the database system.

Uploaded by

drashtirawat8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views35 pages

Document 1

The document outlines an IT project on creating a relational database management system (RDBMS) for railways, detailing the importance of RDBMS in managing data such as train schedules and passenger bookings. It includes steps for designing the database, creating tables, establishing relationships, and utilizing Microsoft Access for data management. The project also emphasizes the use of forms and queries for user interaction and data retrieval within the database system.

Uploaded by

drashtirawat8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

ST.

CLARE’S CONVENT SCHOOL

IT PROJECT
Submitted by: Srashti Rawat
Class: 10 ‘C’
Roll No: 44
Subject Code: 402
Submitted to: Mrs. Pooja Srivastava
Signature:
ACKNOWLEDGEMENT
I would like to express my special thanks of gratitude
to my Information Technology teacher “Mrs. Pooja
Srivastava” for their able guidance and support in
completing my project.
I would also like to extend my gratitude to the
Principal “Sr. Seline Maria Josephine” for providing me
with all the facilities that were required.
Date: Srashti Rawat
29/01/2025 10 ‘C’
TABLE OF CONTENTS
01 Introduction to
Railways RDBMS
02 Tables in design
view- steps
03 Tables in design
view- OUTPUT
04 Relationships
05 Tables in datasheet
view- steps
06 Tables in datasheet
view- OUTPUT
07 Form
08 Query
09 Report
10 Bibliography
Introduction to Relational Databases
in Railways
Relational databases are a powerful tool for managing vast amounts of
data in a structured and efficient manner. In the context of railways,
they play a crucial role in ensuring seamless operations, customer
service, and decision-making. A relational database organizes data into
tables, which are interconnected through relationships, enabling easy
retrieval and analysis. For railways, these databases can store and
manage critical information such as train schedules, passenger
bookings, cargo logistics, maintenance records, and employee details.

By leveraging relational databases, railway systems can achieve:

1. Real-time Data Management: Ensuring up-to-date information on


train movements, ticket availability, and delays.
2. Improved Customer Service: Enabling online booking,
cancellations, and seat reservations.
3. Operational Efficiency: Supporting decision-making in areas like
route optimization, capacity planning, and asset tracking.
4. Data Integrity and Security: Maintaining accurate and secure
records to prevent errors and ensure compliance.

With their structured nature and ability to handle complex queries,


relational databases are indispensable for modern railway operations,
driving reliability and efficiency across the system.

Creating a relational database for a railway system involves several


steps, from understanding the requirements to implementing and
maintaining the database. Here's a simplified guide to get you
started:
1. Understand the Requirements
 Identify what data needs to be stored: train schedules, passenger bookings,
ticket pricing, cargo details, etc.
 Determine user needs: real-time updates, reports, seat availability, etc.
 Define system goals: scalability, efficiency, and reliability.

2. Design the Database

 Identify Entities: Break down the railway system into entities (e.g., Trains,
Stations, Passengers, Tickets, Routes).
 Define Relationships: Establish how entities are related (e.g., a Train visits
multiple Stations, a Passenger books a Ticket for a Train).
 Create Tables:
o Example tables:
 Train: Train_ID, Train_Name, Type, Capacity
 Station: Station_ID, Name, Location
 Route: Route_ID, Train_ID, Source_Station,
Destination_Station, Schedule
 Passenger: Passenger_ID, Name, Contact, Age
 Ticket: Ticket_ID, Passenger_ID, Train_ID, Date, Class, Price

3. Choose a Database Management System (DBMS)

 Popular relational DBMS options include:


o MySQL: Open-source and widely used.
o Microsoft Access: For enterprise-level systems.
o PostgreSQL: Powerful and feature-rich.
o SQLite: Lightweight and serverless.

4. Implement the Database

 Install your chosen DBMS.

5. Populate the Database

 Add sample or real data into your tables using SQL INSERT queries.
Example:

6. Develop a User Interface (Optional)

 Create an application for users to interact with the database.


 Use languages like Python (with Flask/Django), Java, or PHP to connect the
database with a user-friendly interface.

7. Test the System

 Test queries to ensure the database works as expected.


 Examples:
o Retrieve train schedules for a station.
o Find available seats on a train.
o Generate revenue reports.

8. Maintain and Optimize

 Regularly back up the database.


 Optimize queries for performance.
 Monitor for security vulnerabilities and apply updates.
Steps to Create Tables in Design View in Access
1. Open Microsoft Access

 Launch Microsoft Access.


 Create a new database or open an existing one.

2. Navigate to Design View

 Click the "Create" tab in the ribbon at the top.


 Select "Table Design" under the "Tables" section. This opens the Design View.
3. Define Table Structure

 In Design View, you’ll see three columns:


o Field Name: The name of the field (e.g., Train_ID, Train_Name).
o Data Type: The type of data the field will store (e.g., Text, Number, Date/Time).
o Description (optional): A brief description of the field's purpose.
 Enter the fields one by one.

4. Set a Primary Key

 Identify the field that uniquely identifies each record (e.g., Train_ID).
 Select the row of the primary key field.
 Click the Primary Key button in the toolbar (a key icon).
5. Define Field Properties

 Below the table grid, you'll see the Field Properties section.
 For each field, you can customize properties like:
o Field Size: Limit the number of characters for text fields.
o Default Value: Automatically populate a default value.
o Validation Rule: Set rules to validate data entry.
o Required: Specify whether the field must be filled in.

6. Save the Table

 Click Ctrl + S or the save icon in the toolbar.


 Enter a table name (e.g., Train) and click OK.

7. Add Relationships (Optional)

 If your database has multiple tables, link them via relationships.


 Go to the Database Tools tab and click Relationships.
 Add tables and define relationships by dragging fields (e.g., linking Train_ID from the
Train table to the Train_ID in another table like Route).
Stations Table (in design view)

Trains Table (in design view)


Schedules Table (in design view)

Passengers Table (in design view)


Tickets Table (in design view)

Employees Table (in design view)


Train Routes Table (in design view)
Steps to Create Relationships in Access
1. Prepare Your Tables

 Ensure your tables are designed with primary keys and fields that can serve as foreign
keys.
o A primary key uniquely identifies each record in a table (e.g., Train_ID in the
Train table).
o A foreign key references the primary key in another table (e.g., Train_ID in the
Route table referencing the Train table).

2. Open the Relationships Tool

 Go to the "Database Tools" tab on the ribbon.


 Click "Relationships" in the "Relationships" group.
This opens the Relationships window.

3. Add Tables to the Relationships Window

 In the Relationships window, click the "Show Table" button (or right-click and choose
"Show Table").
 Select the tables you want to relate and click "Add".
 Once added, close the "Show Table" dialog.

4. Create Relationships

 Drag the primary key field from one table and drop it on the corresponding foreign key
field in another table.
For example:
o Drag Train_ID from the Train table to Train_ID in the Route table.
 The Edit Relationships dialog box will appear.

5. Configure the Relationship

 In the Edit Relationships dialog box:


o Ensure the fields in both tables are correctly listed.
o Check "Enforce Referential Integrity" to maintain data consistency (this
ensures you can't add a foreign key value unless it exists in the primary table).
o Choose the Join Type (optional):
 Inner Join: Includes only matching records.
 Left/Right Outer Join: Includes all records from one table and matching
records from the other.
 Click Create.

6. Verify the Relationship


 The relationship will now appear as a line connecting the two tables:
o A 1 symbol on one side indicates the primary key table.
o An infinity (∞) symbol on the other side indicates the foreign key table (one-to-
many relationship).

7. Save the Relationships

 Click Save in the toolbar or press Ctrl + S to save your relationships.

Example Relationship

If you're managing a railway system with tables like Train, Station, and Route:

 Train Table: Primary Key: Train_ID


 Route Table: Foreign Key: Train_ID
Relationship: Train.Train_ID → Route.Train_ID
In Microsoft Access, Datasheet View allows you to view and edit the
data stored in a table in a spreadsheet-like format. You can also
create and modify tables directly in Datasheet View. Here's how you
can work with tables in Datasheet View:
Steps to Create a Table in Datasheet View

1. Open Microsoft Access

 Launch Access and create a new database or open an existing one.

2. Create a New Table

 Go to the "Create" tab in the ribbon.


 Click on "Table" in the Tables group.
A new table will open in Datasheet View.

3. Add Fields

 The first column is automatically created as an AutoNumber field named ID (it serves as
the primary key by default).
 To add fields:
o Double-click the "Add Field" header at the top of the next column.
o Enter the field name (e.g., Train_Name, Type, Capacity).
o Access will automatically set the data type based on the values you enter (you can
change this later if needed).

4. Enter Data

 Click on any cell and start entering data. The fields expand as you type.
 Each row represents a record, and each column corresponds to a field.

5. Modify Field Properties

 To change field properties (e.g., data type, default value, required fields):
o Select the column header.
o Click on the "Fields" tab in the ribbon.
o In the "Formatting" group, adjust the field's data type and other properties.

Steps to Edit an Existing Table in Datasheet View

1. Open an Existing Table

 In the Navigation Pane, double-click the table you want to edit.


The table will open in Datasheet View.
2. Add or Rename Fields

 To add a new field:


o Scroll to the right and click "Click to Add".
o Select the desired data type (e.g., Text, Number, Date).
 To rename a field:
o Right-click the column header and select "Rename Field".
o Enter the new field name.

3. Delete Fields

 Right-click the column header of the field you want to delete.


 Select "Delete Field" (note: deleting a field removes all its data).

Differences Between Datasheet View and Design View

Feature Datasheet View Design View


Purpose View and directly edit table data. Define table structure and properties.
Add fields by typing or selecting Add fields with detailed property
Field Creation
data type. settings.
Advanced Full control over field properties and
Limited field property customization.
Options data types.
Spreadsheet-like (rows and
View Format Structured form for table design.
columns).

Tips for Using Datasheet View

1. Use the Ribbon Options in the "Fields" tab to adjust properties like default values,
validation rules, or required fields.
2. Switch between Datasheet View and Design View anytime:
o Right-click the table tab and select "Design View" or "Datasheet View".
3. Save your changes often by pressing Ctrl + S.
Stations Table (in datasheet view)

Trains Table (in datasheet view)


Schedules Table (in datasheet view)

Passengers Table (in datasheet view)


Tickets Table (in datasheet view)

Employees Table (in datasheet view)


Train Routes Table (in datasheet view)
FORM
A form in Microsoft Access is a user-friendly interface used to interact with data
in a database. It allows users to view, enter, edit, and delete records in a structured
way without directly working in tables. Forms are especially useful for users who
are not familiar with databases, as they provide a more intuitive way to manage
data.

Key Features of a Form

1. Data Input: Simplifies data entry with labeled fields, dropdowns,


checkboxes, and other controls.
2. Data Viewing: Displays records in a customized layout, making it easier to
read and navigate.
3. Customization: Forms can be tailored to show only relevant fields or
records.
4. Control Integration: Supports buttons, search boxes, and other controls for
easier navigation or automation.
5. Data Validation: Can include rules to ensure data integrity (e.g., limiting
input to specific formats).

Why Use a Form?

 Ease of Use: Forms provide a clean and simple interface compared to


working directly in tables or datasheets.
 Data Protection: Forms can limit access to certain fields or records, helping
protect sensitive information.
 Improved User Experience: You can customize the design to make it more
visually appealing and user-friendly.
 Automation: Add buttons or macros to automate tasks like saving records,
running queries, or generating reports.

Example Use Case


For a railway database, a form could be designed to allow ticket clerks to:

 Enter new bookings (e.g., passenger name, train details, date).


 Search for available trains.
 Update or cancel existing bookings.

How to Create a Form in Access

1. Open the Database: Launch Access and open your database.


2. Go to the Create Tab:
o Select Form Wizard for a step-by-step guide or Form for an auto-
generated form.
3. Choose the Table or Query:
o Select the source of the data for the form (e.g., Passenger or Train
table).
4. Customize the Form:
o Add, remove, or rearrange fields.
o Insert controls like buttons, combo boxes, or checkboxes.
5. Save the Form:
o Click Ctrl + S to save the form with a name.
QUERY
A query in Microsoft Access is a tool used to retrieve, filter, and manipulate data
from one or more tables in your database. Queries allow you to ask specific
questions about your data, perform calculations, and even update or delete records.

Types of Queries in Access

1. Select Query:
o Retrieves and displays data based on specific criteria.
o Example: Show all trains departing from "New York" today.
2. Action Queries:
o Update Query: Modifies data in a table.
o Delete Query: Removes records that meet certain criteria.
o Append Query: Adds records from one table to another.
o Make-Table Query: Creates a new table based on the query results.
3. Parameter Query:
o Prompts the user to input criteria when the query is run.
o Example: Ask for a station name to show its schedule.
4. Crosstab Query:
o Summarizes data in a grid format with rows and columns.
o Example: Show ticket sales by train type and month.
5. SQL Query:
o Advanced users can write SQL code directly to create custom queries.

Why Use a Query?

 Filter Data: Display only the records you need (e.g., tickets booked on a
specific date).
 Sort and Organize: Sort data by fields like date, name, or price.
 Combine Data: Pull data from multiple related tables.
 Perform Calculations: Create calculated fields (e.g., total ticket revenue =
price × quantity).
 Automate Tasks: Use action queries to update or clean your data
efficiently.
How to Create a Query in Access

1. Using Query Wizard (Simple Queries)

1. Go to the "Create" tab.


2. Click on "Query Wizard".
3. Select the type of query (e.g., Simple Query Wizard).
4. Choose the table(s) or query(s) you want to work with.

5. Add fields to include in the query.


6. Set criteria (optional) and finish.

2. Using Query Design (Custom Queries)

1. Go to the "Create" tab.


2. Click on "Query Design".
3. Add the table(s) you want to query.
4. Drag fields into the query grid.
5. Add criteria:
o Example: Show all trains of type "Express":
 In the "Type" field, enter "Express" under Criteria.
6. Run the query by clicking the "Run" button (red exclamation mark).

3. Writing SQL Queries (Advanced)

1. Open Query Design.


2. Switch to SQL View.
3. Write your SQL code:
o Example:

sql
CopyEdit
SELECT Train_Name, Type, Capacity
FROM Train
WHERE Capacity > 300;

Examples of Queries

Select Query (View trains departing from "Station A"):

 Criteria in the "Source_Station" field: "Station A"

Action Query (Update ticket prices for express trains):

 Use Update Query:


sql
CopyEdit
UPDATE Train
SET Ticket_Price = Ticket_Price * 1.1
WHERE Type = "Express";

Crosstab Query (Show ticket sales by month):

 Row Headings: Train Type


 Column Headings: Month
 Values: Sum of Ticket Price
Report
A report in Microsoft Access is a formatted and printable summary of data from
your database. It’s used to present information in an organized, professional layout,
making it ideal for sharing or printing. Reports can display data from tables or
queries and include calculations, summaries, and visual elements like charts.

Key Features of a Report

1. Data Presentation: Displays data in a structured, readable format.


2. Summarization: Groups data and provides totals, averages, counts, or other
aggregates.
3. Customization: Supports headers, footers, logos, images, and formatting for
professional-looking output.
4. Print-Ready: Designed for printing or exporting as PDFs or other formats.
5. Interactive Options: You can use filters and parameters to generate
dynamic reports.

Why Use a Report?

 To summarize and present data clearly (e.g., a list of tickets sold).


 To create printable documents, such as invoices, receipts, or schedules.
 To group and analyze data (e.g., total ticket revenue by train or date).
 To visualize trends using charts or graphs.

Steps to Create a Report in Access

1. Using the Report Wizard (Quick & Easy)

1. Open Access and go to the "Create" tab.


2. Click on "Report Wizard".
3. Select the table or query you want to use as the data source.
4. Choose the fields to include in the report.
5. Set grouping levels (e.g., group by Train Type or Station).
6. Define sorting options (e.g., sort by Date or Ticket Price).
7. Select the layout (e.g., tabular or columnar).
8. Finish the wizard and view your report.

2. Using the Report Design Tool (Custom Layouts)

1. Go to the "Create" tab and click "Report Design".


2. Add a data source:
o Open the "Property Sheet".
o Set the Record Source to a table or query.
3. Add fields to the report:
o Drag fields from the Field List pane onto the design grid.
4. Customize the design:
o Add text boxes for fields, labels for titles, and images for logos.
o Use Group & Sort options to organize data by categories.
5. Preview the report by clicking "View" and selecting "Report View" or
"Print Preview".

3. Creating a Blank Report

1. Go to the "Create" tab and click "Blank Report".


2. Use the Field List pane to drag fields into the report.
3. Customize the layout with headers, footers, and formatting options.

Common Elements in a Report

 Report Header: Appears at the top of the first page (e.g., report title, logo).
 Page Header: Appears at the top of every page (e.g., column headings).
 Group Header: Appears at the start of each group (e.g., "Train Type:
Express").
 Detail Section: Displays the main data (e.g., passenger names, train details).
 Group Footer: Summarizes data for each group (e.g., total tickets sold).
 Page Footer: Appears at the bottom of every page (e.g., page number, date).
 Report Footer: Appears at the end of the report (e.g., grand totals).
Examples of Reports

1. Train Schedule Report


o Fields: Train Name, Departure Time, Arrival Time, Route.
o Grouping: By Train Type.
o Sorting: By Departure Time.
2. Sales Summary Report
o Fields: Date, Train Name, Ticket Sales, Revenue.
o Grouping: By Date.
o Calculations: Total Revenue for each date and grand total.
3. Passenger List Report
o Fields: Passenger Name, Train Name, Seat Number.
o Sorting: By Train Name and then by Seat Number.

Exporting a Report

 Once the report is ready, you can export it:


o Go to the "File" menu or "External Data" tab.
o Export to formats like PDF, Excel, or Word.
BIBLIOGRAPHY
The listed applications and tools helped
me a lot in finishing this project.
 Microsoft Office Access
 Microsoft Office Word
 File Explorer
 Snipping Tool

You might also like