DMS MP Report
DMS MP Report
The primary aim of this micro project is to design and implement a functional database system that manages
railway ticket bookings efficiently. The project aims to develop students' understanding of:
Benefits:
1. Entities of database and their attributes along with data types were identified
2. Development of schema diagram based on entities and attributes.
3. Creation of a relational database by creating tables with minimum 5 records.
4. DDL commands like alter, rename, truncate and drop on a single table was executed
5. Enforcement of Parent-Child Relationship (Foreign Key) on two tables from the database.
6. DML commands like select, insert, update, delete was performed on a single table.
7. Aggregate functions and JOIN Clause were implemented on the table
8. Advanced SQL (VIEW) & PL/SQL (Cursor) were implemented respectively.
9. DCL commands like grant and revoke was successfully executed.
5.0 Actual resources used:
Sr. no Name of resources / Specifications Quantity
material
1. Computer System Windows 10, 4GB RAM 1
2. MySQL Software Database 1
Management Software
3. Oracle 10g Express Version 8.0 1
Edition
1. Entity of database and their attributes along with their identified datatypes:
An entity can be a real-world object, either animate or inanimate, that can be easily identifiable.
Entities are represented by means of their properties, called attributes.
2. Schema Structure:
Entities Attributes
Passenger info PID
P_name
P_gender
P_age
P_addr
P_contact
Bill BID
B_date
Total
PID
Ticket_number
Ticket info Ticket_number
Ticket_type
Ticket_price
Train_number
Train info Train_number
T_name
D_location
D_time
D_date
A_location
Route info RID
R_name
No_of_stops
3. Schema Diagram:
4. DDL:
1) Create-
This command is used to create the database or its objects (like table, index, function, views, store
procedure and triggers.
2) Alter-
This is used to alter the structure of the database.
3) Rename-
This is used to rename an object existing in the database.
5. DML:
1) Select-
3) Update-
It is used to modify existing data in a table.
6. DCL:
1) Commit-
2)Rollback-
3)Savepoint-
An SQL operator is a reserved word or a character used primarily in an SQL statement’s WHERE clause
to perform operation(s) such as comparisons and arithmetic operations.
1) Arithmetic Operators-
a. Additon (+) :-
Adds value on either side of the operator.
b. Subtraction (-) :-
c. Multiplication (*) :-
e. Modulo (%) :-
Calculates the remainder of the division of one number by another.
a. IN :-
b. NOT IN :-
True if the operator is not equal to one of the list of expression.
c. ALL :-
d. BETWEEN :-
e. NOT BETWEEN :-
f. LIKE :-
True if the operand matches a pattern using % and _
g. NOT LIKE :-
h. IS NULL ;-
3) Logical Operators-
a. AND :-
b. OR :-
True if any of the conditions separated by OR is true.
c. NOT :-
4) Relational Operators-
a. Equal to (=) :-
Checks if the value of two operands are equal or not, if yes then condition becomes true.
Checks if the value of two operands are equal or not, if values are not equal then condition becomes
true.
Checks if the value of left operand is less than or equal to the value of right operand, if yes then
condition becomes true.
5) Set Operators-
a. UNION :-
b. UNION ALL :-
All rows selected by either query including all duplications.
c. INTERSECT :-
d. MINUS :-
All rows returned by first query that are not present in the second query.
9. Functions:
1) String Functions-
a. LOWER() :-
b. UPPER() :-
c. Length(char) :-
d. ASCII(char) :-
e. SUBSTR(char, m, n) :-
It returns a portion of character beginning at character m and n character long.
g. CONCAT(char1, char2) :-
Char1 is concatenated to char2.
It merges over two or more string values.
2) Arithmetic Functions-
a. ABS() :-
b. CEIL() :-
c. FLOOR() :-
d. POWER() :-
It returns power of any number.
e. MOD() :-
It returns remainder of first number divided by second number passed as parameter.
f. SQRT() :-
g. ROUND() :-
h. TRUNC() :-
It truncates the value of a number by n places.
3) Aggregate Functions-
a. AVG() :-
b. COUNT() :-
c. MAX() :-
d. MIN() :-
It finds the minimum or higher value of a particular column.
e. SUM() :-
It returns sum of all numeric values in a specific column.
10. Clauses:
1) where –
2) group by-
It is used to divide the rows into smaller groups which is based on certain condition.
3) having-
It is used with group by clause and imposes condition on group by clause which further filters the group
created by group by clause.
4) Order by-
This clause sorts or orders according to values present in column.
11. JOIN:
Join works on two or more tables if they have at least one common field and have a relationship between
them.
1) Equijoin-
It is a type of join that combines tables based on matching values in specified columns.
2) Non Equijoin-
It performs a join using comparison operator other than equal to like >,<,>=,<= with condition.
3) Natural join-
4) Left join-
It joins all rows of a table on left side of join and matching rows for table on right side of the join.
5) Right join-
It joins all rows of a table on right side of join and matching rows for table on left side of the join.
6) Inner join-
It selects records that have matching values in both the tables as long as the condition is satisfied.
7) Cross join-
When each row of first table is combined with each row from the second table it is known as Cartesian
product of two tables and also we call it as cross join.
8) Self join-
In self join a table is join to itself i.e. each row of table is joined with itself and all other rows depending
on some conditions.
In other words it is a join between two copies of same table.
12. VIEW:
13. INDEX:
Indexes are optional structures associated with tables and clusters that allow SQL statements to execute
more quickly against a table.
They are logically and physically independent of the data in the associated table.
Being independent structures, they require storage space.
We can create or drop an index without affecting the base tables, database applications, or other indexes.
Types of Indexes are:-
1. Simple Index-
A simple index is one that is created based on only one table column.
2. Composite Index-
3. Unique Index-
A unique index does not allow any duplicate values to be inserted into the table.
14. CURSORS:
PL/SQL cursor is a pointer that points to the results set of the SQL query against database table.
Cursor is a work area in PL/SQL which is used by SQL server used to store the result of a query.
There are two kinds of cursors:
1) Implicit Cursor –
These are created by default when DML statements like INSERT, UPDATE and DELETE
statements are executed.
They are also created when a SELECT statement that returns just one row is executed.
2) Explicit Cursor-
If select statements in PL/SQL returns multiple rows then we have to create an explicit cursor.
The set of rows returned by a multi-row query is called the result set.
1)Predefined Exception-
System exceptions are automatically raised by Oracle, when a program violates a RDBMS
rule.
There are some system exceptions which are raised frequently, so they are pre-defined and
given a name in Oracle which are known as Named System Exceptions.
16. PL/SQL:
PL/SQL is one of the core technologies at Oracle and is essential to leveraging the full potential of
Oracle Database.
It combines the relational data access capabilities of the Structured Query Language with a flexible
embedded procedural language.
7.0 Skills developed
Proficiency in SQL and PL/SQL operations.
Ability to design relational databases with integrity constraints.
Problem-solving skills while implementing complex queries.
Familiarity with database security practices and permission management.
8.0 Application of Micro project
The Railway Ticket Booking System can be applied in real-world railway networks where efficient data management
is necessary for ticketing services. The system can be further scaled and customized to meet the demands of larger
railway networks or integrated with other transportation services.