3. Meet the Team
Abhishek Nanoti : S1G - Hexagon Theory
Abhishek Nanoti Aishwarya Ramaraj Likitha Tripuraneni
Nidhi Shantha Kumar Shivam Shishangia Tanvi Tanaji Mane
4. AGENDA
• Requirements and Usage
• Entity-Relationship Diagram
• ER To Relational and Normalization
• Sample SQL Queries
• Packages and Indexing
• Sequences and Triggers
• Stored Procedures
• Front-End Review
Abhishek Nanoti : S1G - Hexagon Theory
5. REQUIREMENTS AND USAGE
TripActions is looking for expanding their revenue stream by
introducing TripActions Liquid – an expense management and
corporate card solution for their platform.
Abhishek Nanoti S1G - Hexagon Theory
8. ENTITY-RELATIONSHIP IMPLEMENTATION
POLICIES
policyID
policyName
policy
Description
policyTier
pricingPlan
Assumption: A
company can
opt for only one
type of policy in
their contract.
[0:M]
duration endDate
GROWTH
PLANS
PROFESSIONAL
PLANS
P
additionalPayment
PerNewUser
additional
CorporateDeals
CONTRACTS
startDate
contractID
P
ACTIVE CANCELLED
dateOf
Cancellation
reasonFor
Cancellation
Binded by
[1:1]
Assumption: A
contract is
signed for a set
duration.
creditScore
Nidhi Shantha Kumar : S1G - Hexagon Theory
9. ENTITY-RELATIONSHIP IMPLEMENTATION
Nidhi Shantha Kumar : S1G - Hexagon Theory
TA EMPLOYEES
empID
fName
D
TA ADMINISTRATORS
TA CUSTOMER SUPPORT
AGENTS
gender
dateOfJoining
emailID
phoneNum
D
TA MANAGERS
Manages
[0:M]
[0:M]
Forms
[2:M]
[1:M]
SUPPORT TEAMS
[0:1]
address
supportTeamID
name
lName
10. ER TO RELATIONAL
TA_EMPLOYEES (empID, fName, lName, dateOfJoining, gender, address, loginID)
Foreign Key (loginID) REFERENCES TA_LOGINS (loginID)
Subclass of TA_EMPLOYEES translated from ER Diagram (Option A)
TA_CUSTOMER_SUPPORT_AGENTS (empID)
Foreign Key (empID) REFERENCES TA_EMPLOYEES (empID)
TA_ADMINISTRATORS (empID)
Foreign Key (empID) REFERENCES TA_EMPLOYEES (empID)
Subclass of TA_ADMINISTRATORS translated from ER Diagram (Option A)
TA_MANAGERS (empID)
Foreign Key (empID) REFERENCES TA_ADMINISTRATORS (empID)
FORMS_SUPPORT_AGENTS (supportTeamID, empID)
Foreign Key (supportTeamID) REFERENCES SUPPORT_TEAMS (supportTeamID)
Foreign Key (empID) REFERENCES TA_CUSTOMER_SUPPORT_AGENTS (empID)
SUPPORT_TEAMS (supportTeamID, name)
Aishwarya Ramaraj : S1G - Hexagon Theory
12. NORMALIZATION
Functional Dependencies
FD1: loginID -> userName, password
FD2: userName -> password
This table is in 2 NF (highest normal form) and we see a transitive dependency based on our FDs.
Original Table:
CC_EMP_LOGINS (loginID, password, userName)
Normalized Table:
CC_EMP_LOGINS_USERNAME (loginID, userName)
CC_EMP_LOGINS_PASSWORD (userName, password)
Foreign Key (userName) REFERENCES CC_EMP_LOGINS_USERNAME (userName)
Aishwarya Ramaraj : S1G - Hexagon Theory
13. SQL QUERIES – 1/3
Display assigned support teams with their manager and support agent contact
Tanvi Mane : S1G - Hexagon Theory
20. STORED PROCEDURES – TRIGGER 1/2
Shivam Shishangia : S1G - Hexagon Theory
Trigger before inserting a new reimbursement record
21. STORED PROCEDURE –TRIGGER 2/2
Shivam Shishangia : S1G - Hexagon Theory
Trigger before submitting record in the CARD_SUBSCIRPTIONS table validating the constraining
relationship with CONTRACTS
22. STORED PROCEDURES - PROCEDURE
Shivam Shishangia : S1G - Hexagon Theory
Procedure for a manager to change the status of the oldest 3 reimbursements to ‘Review’