🏆
SAP HANA 100 Days Challenge
Day 4 — SAP HANA Database Objects
7Views
0Downloads
0Likes
0Comments
0Shares
Interview Question
What are the important database objects available in SAP HANA? Explain each with examples.
Answer
SAP HANA provides several database objects that help store, organize, retrieve, and process business data.
1. Schema
A Schema is a logical container used to organize related database objects.
Key Points
a. Groups related database objects together.
b. Improves database organization.
c. Prevents object name conflicts.
d. Helps manage user authorizations.
e. Multiple schemas can exist in one database.
f. Examples include HR, SALES, MM, and FINANCE schemas.
Real-Time Example
A company has different departments.
• HR stores employee tables in the HR Schema.
• Sales stores customer tables in the SALES Schema.
• Finance stores accounting tables in the FINANCE Schema.
This keeps the database organized and secure.
2. Table
A Table stores actual business data permanently.
Key Points
a. Stores data in rows and columns.
b. Can be either Row Store or Column Store.
c. Holds master and transactional data.
d. Supports Insert, Update, Delete, and Select operations.
e. Every business application depends on tables.
f. Examples include CUSTOMER, EMPLOYEE, MATERIAL, and SALES_ORDER tables.
Real-Time Example
When a customer places an order:
• Customer information is stored in the CUSTOMER table.
• Order details are stored in the SALES_ORDER table.
3. View
A View is a virtual table created from one or more database tables.
Key Points
a. Does not store data physically.
b. Retrieves data from existing tables.
c. Simplifies complex SQL queries.
d. Provides better security by exposing only required data.
e. Frequently used for reports and dashboards.
f. Reduces duplicate SQL coding.
Real-Time Example:
Instead of joining Customer, Order, and Material tables every time, a View combines them into a single object that reporting tools can access directly.
4. Procedure:
A Procedure is a reusable SQLScript program that executes business logic inside the SAP HANA database.
Key Points:
a. Executes multiple SQL statements together.
b. Improves overall application performance.
c. Reduces communication between application and database.
d. Supports variables, loops, and conditional statements.
e. Can return output parameters.
f. Commonly used for validations, calculations, and data processing.
Real-Time Example:
During invoice creation:
• The Procedure checks stock availability.
• Calculates GST.
• Applies discounts.
• Updates inventory.
• Saves the final invoice.
All these steps execute inside the database in a single call.
5. Function
A Function performs calculations and returns a single value or a table.
Key Points
a. Used inside SQL statements.
b. Returns calculated results.
c. Improves code reusability.
d. Supports complex business calculations.
e. Can be built-in or user-defined.
f. Examples include SUM(), AVG(), COUNT(), MAX(), and MIN().
Real-Time Example:
A sales dashboard calculates:
• Total Sales
• Average Order Value
• Highest Revenue
• Number of Customers
These calculations are performed using SQL functions.
6. Sequence
A Sequence automatically generates unique numbers.
Key Points:
a. Generates unique IDs automatically.
b. Eliminates duplicate numbers.
c. Increments values automatically.
d. Frequently used for primary keys.
e. Ensures uniqueness even with multiple users.
f. Commonly used for Order IDs, Invoice Numbers, and Employee IDs.
Real-Time Example
When 500 customers place orders simultaneously:
• The Sequence automatically generates Order IDs like:
o ORD10001
o ORD10002
o ORD10003
No duplicate Order IDs are created.
Practice Questions
1. What is a Schema in SAP HANA?
2. Why do we use Schemas?
3. What is the difference between a Table and a View?
4. Does a View store data physically?
5. What is a Procedure in SAP HANA?
Related Jobs — ABAP
M
SAP ABAP Developer
Mak Technologies LLC
Remote RemoteSAP ABAP
C
SAP ABAP Developer – Immediate Opportunity
Covenant Global Technologies
RemoteRemoteSAP ABAP
K
SAP ABAP Developer
Krish IT Solutions
Navi Mumbai / MumbaiHybridSAP ABAP
C
SAP ABAP Developer
CelebalTech
Noida, IndiaHybridSAP ABAP
T
SAP ABAP Consultant / Developer
TGS Global Skills
NCR, IndiaHybridSAP ABAP
Discussion
to join the discussion.
Be the first to comment.