getting started into mysql
TRANSCRIPT
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
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
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)
Important Notice
• Before login into the mySQL start the Apache and mySQL service in the server(XAMPP)
• 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>
• mysql> SELECT VERSION(), CURRENT_DATE;• +-----------------+--------------+• | VERSION() | CURRENT_DATE |• +-----------------+--------------+• | 5.1.2-alpha-log | 2005-10-11 |• +-----------------+--------------+
• 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)
• mysql> SELECT USER()• -> ;• +---------------+• | USER() |• +---------------+• | james@localhost |• +---------------+