A multimodel database project that represents a taxi-ride scenario in both relational and document-oriented forms. The repository includes the Oracle schema, sample inserts, relational queries, MongoDB documents, and MongoDB query examples used to explore the same data in two different database styles.
- What This Project Does
- Why This Project Is Useful
- Architecture Overview
- Data Model
- Getting Started
- Usage Examples
- Project Structure
- Where To Get Help
- Maintainers and Contributions
ride-registry documents the same transportation dataset in two database paradigms:
- Relational model in ORACLE_TABLES.sql, ORACLE_INSERT.sql, and ORACLE_CONSULTAS.sql.
- Document model in MongoDB_COLLECTION_NoSQL.json and MongoDB_CONSULTAS_NoSQL.json.
- Conceptual and logical modeling artifacts in Conceitual.brM3, Lógico.brM3, and NAO_RELACIONAL.asta.
The domain centers on ride records that link passengers, cars, travel details, and trip usage.
This repository is useful if you want to:
- Compare how the same business problem is modeled in Oracle and MongoDB.
- Study normalization versus embedded document design.
- Reuse the provided DDL, sample data, and queries for coursework or demos.
- Trace how logical and conceptual models map to executable SQL and MongoDB examples.
The project is organized around one shared dataset and two persistence styles:
- Relational side:
Carrostores vehicle data.Passageirostores passenger data.Viagemstores trip data and referencesCarro.Usalinks passengers to trips.
- MongoDB side:
- A
NoSQLcollection stores each trip as a document. CarroandPassageiroare embedded inside each trip document.
- A
Execution pattern:
- Create the Oracle tables.
- Load the sample inserts.
- Run the sample relational queries.
- Inspect the MongoDB documents.
- Run the MongoDB query examples against the collection.
The Oracle schema defines four tables:
| Table | Purpose |
|---|---|
Carro |
Vehicle metadata such as plate, brand, model, year, color, and driver name. |
Passageiro |
Passenger data such as CPF, name, email, phone, neighborhood, and payment method. |
Viagem |
Trip facts such as distance, fare, departure neighborhood, destination city, extra fee, and trip type. |
Usa |
Association table connecting passengers to trips. |
The MongoDB collection stores each trip as a single document with nested Carro and Passageiro objects. This makes the trip record self-contained and easier to query for embedded data such as passenger or vehicle fields.
- Oracle Database or an Oracle-compatible SQL tool.
- MongoDB or a MongoDB shell / UI that can read JSON documents.
- A text editor capable of opening the modeling files in this repository.
From the repository root, execute the SQL files in this order:
Import the documents from MongoDB_COLLECTION_NoSQL.json into a collection named NoSQL, then run the queries from MongoDB_CONSULTAS_NoSQL.json.
The relational version returns the car code for trips whose departure neighborhood is Floresta.
The MongoDB version filters documents by Bairro_Partida and projects Carro.Codigo.
The second query demonstrates a comparison between passenger and trip data:
- Oracle joins
Passageiro,Usa, andViagem. - MongoDB uses
$exprto compareBairro_PartidawithPassageiro.Bairro.
The third query aggregates total distance traveled per passenger in both models.
.
├── Conceitual.brM3
├── Lógico.brM3
├── MongoDB_COLLECTION_NoSQL.json
├── MongoDB_CONSULTAS_NoSQL.json
├── NAO_RELACIONAL.asta
├── ORACLE_CONSULTAS.sql
├── ORACLE_INSERT.sql
├── ORACLE_TABLES.sql
└── README.md
- Start with ORACLE_TABLES.sql to understand the relational schema.
- Use ORACLE_INSERT.sql and MongoDB_COLLECTION_NoSQL.json to inspect the sample data.
- Review ORACLE_CONSULTAS.sql and MongoDB_CONSULTAS_NoSQL.json for example queries.
Maintainer: