Ex. 2.1 Exploring MySQL workbench

docx

School

Pennsylvania State University *

*We aren’t endorsed by this school

Course

210

Subject

Information Systems

Date

Feb 20, 2024

Type

docx

Pages

11

Uploaded by BailiffWrenMaster830

Report
Exercise 2.1 Introduction to MySQL Workbench Purpose: To get started using MySQL Workbench and introduce you to the relational model, tables, columns and rows IT Requirements: MySQL Workbench installed on laptops with built-in databases (e.g. Sakila, World) zyBooks: 2.1-2.2 Introduction In this course we will be using the MySQL Workbench to interact with our MySQL Instance. The Workbench is a powerful SQL editor and database tool that provides a graphical method of interacting with databases, tables, and other MySQL features that we would otherwise have to do using the command line (not very friendly). STEPS 1. Connecting to your MYSQL Instance MySQL Workbench requires a connection to your MySQL Instance to operate. The connection was most likely set up when you installed MySQL Workbench. If you are using MySQL on a remote server or if you installed the server and Workbench separately, you might need to set the connection up manually. To do so, click the plus icon next to MySQL connections. 1
Enter the connection name (e.g. Local DB), the IP address of their MySQL Instance, and the user name you want to use to connect. Unless you specifically set things up differently, it is likely the MySQL Instance is on their local machine and the user name is root. In that case, all you need to do is give you connection a name (e.g. Local DB) and click OK. 2
Then click on the connection to open it. 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
2. Explanation of workbench screens Let’s run through what we are seeing on the screen. Query window -- In the center of the screen is the query window where you can write SQL statements. The buttons along the top of the screen allow you to execute all or part of a statement, save or load a statement, or modify the look of the query. When a query is run the output will appear in a grid view called the Result Grid, in the bottom half of the pane, like so. Your ‘show databases’ query will produce different results than what is shown in figure; the result grid shows databases loaded into your MySQL database at this point. The query window has a tabbed view so you can quickly switch between different statements or functions. The Action Output window shows the time and contents of each SQL statement executed, along with the results of that statement. If a query runs successfully, it will show how many rows it returned – 17 for this simple show databases query. 4
If there's an error message, then it will show that instead. For example, if I made a spelling mistake to my query, I get a red X instead of a green checkmark. On the right is the secondary pane, which mostly contains help information. I usually remove this pane by going to View, Panels, and Hide secondary sidebar. On the left side of the screen is the navigator pane, which shows all the databases in this MySQL Instance. Again, your list of databases will be different than what is displayed in the figure. Note that the terms schema and database are synonymous in MySQL. It also has an administration tab which can be used to manage your Instance by starting or stopping the MySQL service, changing configuration variables, or showing performance. 5
After clicking Performance and then Dashboard: Below the navigator is the information pane, which shows contextual information about the items selected in the navigator. For example, if you select a table, it will show that table's columns. 6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
For most of this course, you will use MySQL Workbench. Now, you know enough to get started using it. 3. Explore world and Sakila databases (comes with default installation) If you installed the default installation of the MySQL Community Edition, you should see the World and Sakila databases in the Workbench navigator pane. NOTE: If you do not see the World or Sakila databases, then they were not included when you installed MySQL workbench. In this case, just review the content in this section. In other exercises, we will create databases that we will work with during the semester. We will NOT use the World and Sakila databases in other exercises, so if those databases were not loaded, it will not be an issue. 7
Let’s explore the contents of those databases and get a feel for navigating in the Workbench and see how the example data fits together. Viewing table contents 1. To view the contents of any database, also called schemas in MySQL, click the arrow to the left of the database name. You see a list of contents, separated by type: tables, views, stored procedures, and functions. Views and functions will be covered later, although you can view them the same way that you view tables. 2. To view the contents of a table, click the arrow next to the tables list to expand the full list of tables. 8
3. And then right-click on a table and choose Select Rows, Limit 1,000. 4. You can also click the little grid icon that appears when you mouse over the table. This gives you exactly the same data. Viewing the data with a limit is a great way to learn about the contents of a table. 9
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
There is no need to load the entire contents, which could be enormous and take a long time to load. Selecting just the first thousand rows gives you a very good idea of a table's structure and contents and is much faster to execute. Table Structure To view the structure of a table, you can right-click on the table and go to Table Inspector. This gives you a quick summary of the table, its number of rows, its size on the disk, location on the disk, and so forth. 5. View the structure of one other table. Be careful not to accidentally DROP any tables or databases. You can also see the table columns, indexes, triggers, and other table information. You can click on the little wrench icon that appears when you mouse over a table. 10
And that brings up the graphical table editor. 6. Take and submit a screenshot similar to the one below. ---------- 11