Document 1
Document 1
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.
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
Add sample or real data into your tables using SQL INSERT queries.
Example:
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.
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).
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.
Example Relationship
If you're managing a railway system with tables like Train, Station, and Route:
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.
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.
3. Delete Fields
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)
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.
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
sql
CopyEdit
SELECT Train_Name, Type, Capacity
FROM Train
WHERE Capacity > 300;
Examples of Queries
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
Exporting a Report