Previous Next vertical dots separating previous/next from contents/index/pdf

5. Examine the database components using DbXaminer™

The ORM Workbench provides DbXaminer to render database diagrams.

The DbXaminer™

5.1. Examine the relationship between database tables

  1. In DbXplorer, right-click the database connection SalesDBConnection and select Show in DbXaminer

  2. The DbXaminer renders the database diagram for the selected schema or the selected database connection. It displays list of tables along with columns under the table. The DbXaminer also renders the relationship between database tables. The relevant properties of each selected artifact is displayed in Properties view. To switch to a different Connection, Database, or Schema, use the appropriate pull down menu.

  3. With Mouse-over on specific database component, the DbXaminer renders properties of that database component as tool-tip.

  4. In Database Diagram view, you can perform various operations like Zoom In, Zoom Out, Auto Arrange the database components etc.

5.2. View data for a table or column

  1. To view the data for a table or column, select specific component in Database Diagram view and click the Show Data button in toolbar of DbXaminer.

  2. Workshop generates the appropriate SQL query and displays the results in the SQL Editor tab of the DbXaminer

  3. You can sort the data by clicking the column name.

  4. Similarly, to view data of specific column of a table, select column of table in Database Diagram view and click the Show Data button.

5.3. Define SQL query and Add / Edit / Delete data using SQL Editor

In this step, you will use the SQL Editor to define and run SQL statements, display and sort query results, and add new data.

5.3.1. Define and run SQL statements

  1. When defining an SQL statement in SQL Editor, Workshop Studio provides code completion for SQL keywords and the database artifacts by pressing CTRL+SPACE. First, we will define an SQL SELECT query using the code completion facility. In SQL Editor, enter S and press CTRL+SPACE. It displays a list of SQL keywords starting with letter S.

  2. Select the keyword SELECT keyword.
  3. Enter space and press CTRL+SPACE. It displays list of table columns from database and SQL keywords. Select the column PRODUCT.PRODUCTID from the list.

  4. Similarly, select columns PRODUCT.CODE and PRODUCT.NAME. Note: Separate each column by comma.
  5. Enter FROM (You can use code completion for FROM keyword) and space.
  6. Press CTRL+SPACE to get a list of tables and select the PRODUCT table.

  7. Now, we have defined the SQL SELECT query. You can execute them by either clicking the Execute selected SQL command button or by using the hotkey, CTRL+ENTER.

5.3.2. Add new data to the database table

  1. To add a new row to an existing table, click the New Table Row button in SQL Editor.

  2. From within the Insert Row dialog, select a PRODUCT Table from the drop down menu and fill in the appropriate column information as shown below.

  3. Click OK to insert the row into the PRODUCT table. Workshop validates the data prior submission to ensure that it conforms to the column definitions (type, size, etc.).
  4. Run the SQL SELECT query to retrieve all data from the PRODUCT table and verify the new record being added.

5.3.3. Edit data for a table column

  1. In SQL Editor, select a record of PRODUCT table having PRODUCTID 70 and click the Edit Table Row button.

  2. In Edit Row dialog, change the value of UNITPRICE column to 150.

  3. Click OK. It updates the UNITPRICE column value from 210 to 150 for the PRODUCT table record with PRODUCTID 70.

5.3.4. Delete record of a table

  1. In SQL Editor, select a record of PRODUCT table having PRODUCTID 70 and click the Delete Table Row button.

  2. Click Yes in Delete Table Row dialog.

  3. The Workshop deletes the record of PRODUCT table having PRODUCTID 70.

Click one of the following arrows to navigate through the tutorial:

 

Skip navigation bar   Back to Top