Use Case Diagram: SQL Query Builder
Actors:
- End User (Query Builder User)
- Database Administrator (DBA)
- Database System (External System)
- Authentication System (External Service)
- File System / Export Service (Optional)
Use Cases:
Log In
- User must authenticate via the Authentication System.
Select Tables and Columns
- The user selects tables and columns for the query.
Apply Filters and Conditions
- Users can specify WHERE conditions, GROUP BY clauses, etc.
Create Joins
- Users can select the type of join (INNER, LEFT, etc.) and specify join conditions.
Preview SQL Query
- Show the generated query before execution.
Execute SQL Query
- The query is executed on the connected Database System.
View Query Results
- Display the results returned by the Database System.
Save Query
- Users can save the query for future use.
Export Results
- Optionally, users can export query results to CSV, Excel, or JSON.
Manage User Access
- DBA assigns user roles (admin, read-only) and manages permissions.
Monitor Queries
- DBA monitors executed queries and performance.
Start with the Actors:
- End User interacts with the Query Builder interface to generate and execute queries.
- Database Administrator (DBA) manages users and monitors query execution.
- The Database System handles the execution of the queries and returns results.
- Authentication System ensures users are logged in and have the correct permissions.
- Export Service helps in exporting query results.
Go through the Use Cases:
- Select Tables and Columns and Apply Filters: The user picks data they want from the database.
- Preview Query: Before executing, users see the generated SQL.
- Execute Query: After previewing, the query runs on the connected database.
- View Results: The system displays the output from the database.
- Save Query: Users can save frequently used queries.
- Export Results: For reporting, users can export results in different formats.
Explain Relationships and Flow:
- Each actor interacts with various use cases. The End User is central, but the DBA manages user roles and monitors system performance.
- Authentication is crucial for controlling access before any query execution happens.