Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

Lesson 8

SQL Introduction
Janice Pola D. Congzon

https://www.mysqltutorial.org/what-is-mysql/
Objectives

▪ Understand the SQL and its parts


▪ Download the SQL installer
▪ Apply the installation process
▪ Apply simple query in the MySQL console
Getting Started

▪ SQL stands for the structured query language.


▪ SQL is the standardized language used to access
the database.
▪ ANSI/SQL defines the SQL standard. The current
version of SQL is SQL:2016. Whenever we refer to
the SQL standard, we mean the current SQL
version.
3
SQL contains three parts

1. Data definition language includes statements that help


you define the database and its objects, e.g.,
tables, views, triggers, stored procedures, etc.
2. Data manipulation language contains statements that
allow you to update and query data.
3. Data control language allows you to grant the
permissions to a user to access specific data in the
database. 4
Trivia

▪ My is the daughter’s name of the MySQL’s co-


founder, Monty Widenius.
▪ The name of MySQL is the combination of My and
SQL, MySQL.
▪ The official way to pronounce MySQL is My Ess
Que Ell, not My Sequel.

5
▪ MySQL is a database management system that allows you to manage relational
databases. It is open source software backed by Oracle. It means you can use
MySQL without paying a dime. Also, if you want, you can change its source
code to suit your needs.
▪ Even though MySQL is open source software, you can buy a commercial license
version from Oracle to get premium support services.
▪ MySQL is pretty easy to master in comparison with other database software
like Oracle Database, or Microsoft SQL Server.
▪ MySQL can run on various platforms UNIX, Linux, Windows, etc. You can install
it on a server or even in a desktop. Besides, MySQL is reliable, scalable, and
6
fast.
Download SQL

To download MySQL installer, go to the following


link http://dev.mysql.com/downloads/installer/.

There are two installer files:


•If you are connecting to the internet while installing
MySQL, you can choose the online installation
version mysql-installer-web-community-
<version>.exe .

•In case you want to install MySQL offline, you can


download the mysql-installer-community-
<version>.exe file.

7
Install MySQL

▪ Install MySQL Step 1: Windows configures MySQL


Installer

8
Install MySQL Step 2 – Welcome Screen: A welcome screen provides several options.
Click Next

9
Install MySQL Step 3 – Download the latest MySQL products: MySQL installer checks and downloads
the latest MySQL products including MySQL server, MySQL Workbench, etc.
Click Execute

10
Install MySQL Step 4: Click the Next button to continue

11
Install MySQL Step 5 – Choosing a Setup Type: there are several setup types available. Choose
the Full option to install all MySQL products and features.

12
Install MySQL Step 6 – Checking Requirements

13
Install MySQL Step 7 – Installation Progress: MySQL Installer downloads all selected products. It will
take a while, depending on which products you selected and the speed of your internet connection.

14
Install MySQL Step 7 – Installation Progress: Complete Downloading. Click the Next button to
continue…

15
Install MySQL Step 8 – Configuration Overview. Click the Next button to configure
MySQL Database Server

16
Install MySQL Step 8.1 – MySQL Server Configuration: choose Config Type and MySQL port
(3006 by default) and click Next button to continue.

17
Install MySQL Step 8.1 – MySQL Server Configuration: choose a password for the root account. Please note the
password download and keep it securely if you are installing MySQL database server on a production server. If
you want to add a more MySQL user, you can do it in this step.

18
Install MySQL Step 8.1 – MySQL Server Configuration: choose Windows service details
including Windows Service Name and account type, then click Next button to continue.

19
Install MySQL Step 8.1 – MySQL Server Configuration – In Progress: MySQL Installer is
configuring MySQL database server. Wait until it is done and click the Next button to
continue.

20
Install MySQL Step 8.1 – MySQL Server Configuration – Done. Click the Next button
to continue.

21
Install MySQL Step 8.2 – Configuration Overview: MySQL Installer installs sample
databases and sample models.

22
Install MySQL Step 9 – Installation Completes: the installation completes. Click
the Finish button to close the installation wizard

23
If SQL is existing before,
▪ it will ask you to select products to upgrade. Choose the all in the choices

24
▪ Select Execute

25
26
27
▪ Applying configuration. Click Execute

28
▪ Applying configuration done. Click Finish

29
▪ If you want to upgrade products, click Yes and follow the succeeding steps

30
To start in MySQL Command Line Client

▪ From the Start Menu,


select on the MySQL folder
▪ Select MySQL 8.0
Command Line Client

31
MySQL
▪ EnterCommand Line
your password you Client
were asked from the installation process

32
Connect to MySQL Using mysql command-line client
mysql is a command-line client program that allows you to interact with MySQL in the interactive and
non-interactive mode.

The mysql command-line client is typically located in the bin directory of the MySQL’s installation
folder.

33
34
Entering Queries
A query normally consists of an SQL statement followed by a semicolon.
When you issue a query, mysql sends it to the server for execution and displays
the results, then prints another mysql>prompt to indicate that it is ready for
another query.

Mysql displays query output in tabular form (rows and columns).


The first row contains labels for the columns. The rows following are the query
results. Normally, column labels are the names of the columns you fetch from
database tables.
Mysql shows how many rows were returned and how long the query took to
execute, which gives you a rough idea of server performance.
A query need not be given all on a single line, so lengthy queries that
require several lines are not a problem.
Mysql determines where your statement ends by
looking for the terminating semicolon, not by
looking for the end of the input line.

Notice how the prompt changes from mysql>to - > after you
enter the first line of a multiple-line query. This is how mysql
indicates that it has not yet seen a complete statement and is
waiting for the rest.
If you decide you do not want to execute a query that
you are in the process of entering, cancel it by typing \c:

Here, too, notice the prompt. It switches back to


mysql>after you type \c, providing feedback to indicate
that mysql is ready for a new query
End of
Lesson 8
40

You might also like