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

5. Examine the database components using DbXaminer™

Workshop Studio's DbXaminer renders database diagrams.

DbXaminer

5.1. Examine the relationship between database tables

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

  2. DbXaminer renders the database diagram for the selected schema. It displays a list of tables along with columns of the table. DbXaminer also renders the relationship between database tables. The relevant properties of each selected artifact are displayed in Properties view. To move the focus of the database diagram to a different table or row simply click on it. You can also click on a schema, table or row in DbXplorer to change the diagram focus. If you right click on a schema, table or row in DbXplorer and choose Show in DbXaminer, then the diagram is redrawn to center on the selected element.

  3. When you run the mouse over database components, DbXaminer displays the properties of that database component as a tool-tip.

  4. In Diagram view (indicated by the tab at the bottom of DbXaminer view), you can perform various operations like Zoom In, Zoom Out, and Auto Arrange.

5.2. View data for a table or column

  1. To view the data for a table or column, select a specific component in Diagram view and click the Show Data button in the 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 a specific column of a table, click on the Diagram tab, select a column of the table 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. Click the SQL Editor tab, type S and press CTRL+SPACE. Workshop Studio displays a list of SQL keywords starting with letter S.

  2. Select the SELECT keyword.
  3. Press the space bar and press CTRL+SPACE. Workshop Studio displays a list of table columns from the database as well as the SQL keywords that would be appropriate. Select the column PRODUCT.PRODUCTID from the list.

  4. Type a comma, then select the column PRODUCT.CODE. Type a comma, then select the column PRODUCT.NAME. Type a space.
  5. Enter FROM (You can use code completion for the FROM keyword) and press the space bar.
  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 the query by either clicking the Execute selected SQL command button or by using the hotkey, CTRL+ENTER.

5.3.2. Add new data to a 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 the 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 has been added.

5.3.3. Edit the data in a table column

  1. In the SQL Editor, select the record in the PRODUCT table that has the PRODUCTID value set to 70 and click the Edit Table Row button.

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

  3. Click OK. Studio updates the UNITPRICE column value from 210 to 150 for that record.

5.3.4. Delete a record

  1. In the 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. Workshop Studio deletes the record.

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

 

Skip navigation bar   Back to Top