IP Library › Granted Patent US 9,805,136
Granted Patent B2
US 9,805,136 · App. 14/501,234 · Granted Oct 31, 2017

Virtualizing schema relations over a single database relation

Inventors: Harish Deshmukh (Mountain View, CA); Roger C. Raphael (San Jose, CA); Paul S. Taylor (Redwood City, CA); Gabriel Valencia (San Jose, CA)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F17/30917G06F17/30448
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,805,136
App. No.
14/501,234
Granted
Oct 31, 2017
Kind
B2
Abstract

According to one embodiment of the present invention, a system maps one or more virtual relations to a table of a relational database management system. The system generates a structured query language (SQL) statement for the table from a SQL statement for a virtual relation by applying the mapping to one or more elements of the SQL statement for the virtual relation. Embodiments of the present invention further include a method and computer program product for mapping virtual relations to a table in substantially the same manners described above.

Claims (33)

1. A system comprising:

at least one processor; and

at least one memory connected to the at least one processor, the at least one memory having instructions recorded therein which when executed by the at least one processor causes the at least one processor to perform:

receiving a first structured query language (SQL) statement including a virtual relation;

mapping the virtual relation to a base table of a relational database management system by:

referencing a row of a first table of metadata corresponding to the virtual relation and having first information regarding the virtual relation,

referencing at least one row of a second table of metadata, each of the at least one row of the second table of metadata including second information regarding a respective field of at least one field associated with the virtual relation, and

referencing at least one row of the base table, each of the at least one row of the base table including an instance of a field value corresponding to the respective field of the at least one field associated with the virtual relation;

generating a second SQL statement for the base table from the first SQL statement including the virtual relation by applying the mapping to one or more elements of the first SQL statement for the virtual relation; and

applying the second SQL statement against real relations of the base table.

2. The system of claim 1 , wherein the at least one memory has instructions recorded therein which when executed by the at least one processor further causes the at least one processor to perform:

mapping to the base table each of a plurality of virtual relations specified via one or more data definition language (DDL) statements.

3. The system of claim 1 , wherein the first SQL statement for the virtual relation is used to generate the second SQL statement for the base table and includes data manipulation language (DML) statements.

4. The system of claim 1 , wherein the generating of the second SQL statement for the base table includes transforming one or more predicates of the first SQL statement for the virtual relation into a SQL string to select identifiers of rows of the base table containing values belonging to one or more instances of the virtual relation that satisfy the one or more predicates of the first SQL statement for the virtual relation.

5. The system of claim 1 , wherein the at least one processor is further caused to perform:

identifying whether the first SQL statement includes a data definition language verb; and

modifying, when the first SQL statement is identified as including the data definition language verb, at least one of the first table and the second table without modifying the base table.

6. A computer program product comprising:

a computer readable storage medium having computer readable program code embodied therewith for execution on a processing system, the computer readable program code comprising computer readable program code configured to perform:

receiving a first structured query language (SQL) statement including a virtual relation;

mapping the virtual relation to a base table of a relational database management system by:

referencing a row of a first table of metadata corresponding to the virtual relation and having first information regarding the virtual relation,

referencing at least one row of a second table of metadata, each of the at least one row of the second table of metadata including second information regarding to a respective field of at least one field associated with the virtual relation, and

referencing at least one row of the base table, each of the at least one row of the base table including an instance of a field value corresponding to the respective field of the at least one field associated with the virtual relation;

generating a second SQL statement for the base table from the first SQL statement including the virtual relation by applying the mapping to one or more elements of the first SQL statement for the virtual relation; and

applying the second SQL statement against real relations of the base table.

7. The computer program product of claim 6 , wherein the computer readable program code is further configured to perform:

mapping to the base table each of a plurality of virtual relations specified via one or more data definition language (DDL) statements.

8. The computer program product of claim 6 , wherein the first SQL statement for the virtual relation is used to generate the second SQL statement for the base table and includes data manipulation language (DML) statements.

9. The computer program product of claim 6 , wherein the generating of the second SQL statement for the base table includes transforming one or more predicates of the first SQL statement for the virtual relation into a SQL string to select identifiers of rows of the base table containing values belonging to one or more instances of the virtual relation that satisfy the one or more predicates of the first SQL statement for the virtual relation.

10. The computer program product of claim 6 , wherein the computer readable program code is further configured to perform:

identifying whether the first SQL statement includes a data definition language verb; and

modifying, when the first SQL statement is identified as including the data definition language verb, at least one of the first table and the second table without modifying the base table.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 30, 2014
From: DESHMUKH, HARISH; RAPHAEL, ROGER C.; TAYLOR, PAUL S.; VALENCIA, GABRIEL
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 033852/0598 →
Continuity (1)
Related Publication 20160092594A1 · Mar 31, 2016