Top Banner
MySQL
23

Getting started into mySQL

Jul 16, 2015

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Getting started into mySQL

MySQL

Page 2: Getting started into mySQL

Installation

• LAMP or XAMPP• MySQL Essential

Page 3: Getting started into mySQL

WEBSITE

• (http://www.mysql.com/) –Provides latest information

Page 4: Getting started into mySQL

Theme

• Create a simple relational database in MySQL.

• Insert, update and delete data the tables.

• Create queries using basic and advanced SELECT statements

• Perform join operations on relational tables

• Use aggregate functions in SQL

• Write subqueries

• Create views of the database

Page 5: Getting started into mySQL

Starting MySQL

• Before starting into MySQL, you must obtain a user ID and a password created by your database administrator in order to log on to the MySQL RDBMS.

• How you connect to the MySQL database depends on how the MySQL software was installed on your server

Page 6: Getting started into mySQL

To start MySQL you would:

• 1. Select the Start button • 2. Select All Programs and then MySQL • 3. Select MySQL Server 5.0 • 4. Click on the MySQL Command line client

• 1. Goto search-> Type cmd -> choose the appropriate location(where the user originally save the mySQL package in the local hard disk)

Page 7: Getting started into mySQL
Page 8: Getting started into mySQL
Page 9: Getting started into mySQL

Important Notice

• Before login into the mySQL start the Apache and mySQL service in the server(XAMPP)

Page 10: Getting started into mySQL
Page 11: Getting started into mySQL

Getting Started into mySQL

Page 12: Getting started into mySQL

Where:

• -u – user

• -p – identified by password

• Mysql –h host –u user -p

• Mysql> \h -help

Page 13: Getting started into mySQL

• sql> help contents - A full list of help topics available through the command line can be found

• Example

• mysql> help Data Definition;

• You asked for help about help category: "Data Definition"

• For more information, type 'help <item>', where <item> is one of the following

• topics:

• ALTER DATABASE

• ALTER EVENT

• ALTER FUNCTION

• ALTER PROCEDURE

• ALTER SERVER

• ALTER TABLE

• ALTER VIEW DROP PROCEDURE

• DROP SERVER

• DROP TABLE

• DROP TRIGGER

• DROP VIEW

• RENAME TABLE

• TRUNCATE TABLE

• mysql>

Page 14: Getting started into mySQL
Page 15: Getting started into mySQL

Quit

• Mysql> Quit• (OR)• Ctrl+D

Page 16: Getting started into mySQL

• mysql> SELECT VERSION(), CURRENT_DATE;• +-----------------+--------------+• | VERSION() | CURRENT_DATE |• +-----------------+--------------+• | 5.1.2-alpha-log | 2005-10-11 |• +-----------------+--------------+

Page 17: Getting started into mySQL

• mysql> SELECT VERSION(); SELECT NOW();• 6• +-----------------+• | VERSION() |• +-----------------+• | 5.1.2-alpha-log |• +-----------------+• 1 row in set (0.00 sec)• +---------------------+• | NOW() |• +---------------------+• | 2005-10-11 15:15:00 |• +---------------------+• 1 row in set (0.00 sec)

Page 18: Getting started into mySQL

• mysql> SELECT USER()• -> ;• +---------------+• | USER() |• +---------------+• | james@localhost |• +---------------+

Page 19: Getting started into mySQL
Page 20: Getting started into mySQL
Page 21: Getting started into mySQL
Page 22: Getting started into mySQL
Page 23: Getting started into mySQL