0% found this document useful (0 votes)
103 views

MySQL Installation and Practice

This document provides instructions for downloading and installing MySQL and MySQL Workbench, connecting to a MySQL server using Workbench, managing databases through Workbench, importing SQL and sample data files, viewing imported data, designing databases, performing SQL queries, and viewing sample data. Key steps include downloading the MySQL installer, selecting only the MySQL Server and Workbench components during installation, providing a password during setup, connecting to the server using Workbench after installation, importing SQL and sample data files located in an online GitHub repository, viewing the imported data and database design, and executing SQL queries on the sample university database within Workbench.

Uploaded by

Sardor Juraev
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views

MySQL Installation and Practice

This document provides instructions for downloading and installing MySQL and MySQL Workbench, connecting to a MySQL server using Workbench, managing databases through Workbench, importing SQL and sample data files, viewing imported data, designing databases, performing SQL queries, and viewing sample data. Key steps include downloading the MySQL installer, selecting only the MySQL Server and Workbench components during installation, providing a password during setup, connecting to the server using Workbench after installation, importing SQL and sample data files located in an online GitHub repository, viewing the imported data and database design, and executing SQL queries on the sample university database within Workbench.

Uploaded by

Sardor Juraev
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

MySQL installation and pr

actice

1
Contents
• Download and install MySQL
• MySQL installer
• MySQL Server
• MySQL Workbench

• Connect DB server through Workbench


• Manage DB through Workbench

2
Download MySQL installer
• MySQL installer Address: https://dev.mysql.com/downloads/installer/

Others: https://dev.mysql.com/downloads/ 3
Only MySQL Server and
MySQL Workbench

4
error
• Error message : one more product requirements have not been sa
tisified …
• Reason: your computer does not have some plug-in.
• Solution: select No button of the prompt, then click Execute button, r
ather than Next button.

After solving the error, click Next button keeping the default setting.

5
Keep the default setting

6
Give a password
For the class practice, a simple password is okay.

7
Keep the default setting

8
MySQL Workbench starts after clickin
g Finish

9
Connect MySQL server

MySQL Workbench is a unified visual tool for database


architects, developers, and DBAs. MySQL Workbench
provides data modeling, SQL development, and
comprehensive administration tools for server
configuration, user administration, backup, and much
more. MySQL Workbench is available on Windows,
Linux and Mac OS X.

10
Import SQL DDL
DDL file is available here: https://github.com/liangyihuai/sql-sample-data. The file name is ddl.sql

11
Import sample data
Sample data file is available here: https://github.com/liangyihuai/sql-sample-data. The file name is smallRelationsInsertFile.sq

12
Error while import sample data

Solution:
step1:uncheck “Safe Updates(rejects UPDATEs and DELETEs with no restrictions)”
Step2: restart workbench

13
Show imported data

14
Database Design

15
Sample Data ( A part of )

16
Perform SQL query
• tag1: execute all SQLs.
• tag2: execute only one SQL in where the mouse cursor put.
show databases;

use universityenterprise;show tables;

select name from instructor;

-- show databases;use universityenterprise;show tables;


select name from instructor;

-- Find the department names of all instructors, and remove duplicates


select distinct dept_name from instructor;

-- The keyword all specifies that duplicates should not be removed


select all dept_name from instructor;

-- To find all instructors in Comp. Sci. dept select name


from instructor where dept_name = 'Comp. Sci.';

-- To find all instructors in Comp. Sci. dept with salary > 80000 select name
from instructor where dept_name = 'Comp. Sci.' and salary > 80000;

-- Find the Cartesian product instructor X teaches


select * from instructor, teaches;
17

You might also like