Software Outsourcing, Offshore Software Development, Offshore Outsourcing Services, IT Outsourcing, Offshore Development
MySQL manual Offshore Software Outsourcing and Programming, IT Outsourcing Offshore Software Development  
Call Us Today: 1-800-678-9001
Offshore Software Outsourcing and Programming, IT Outsourcing Offshore Software Development

Home / Technical Support / MySQL

Key Offerings:

B2B and B2C E-Business Solutions

Offshore Software Development Outsourcing

Strategic Consulting

Offshore Software Outsourcing

About ALTOROS: ALTOROS Systems is headquartered in Tampa, Florida and maintains an office near Boston, Massachusetts and technology development center in Belarus and Russia. ALTOROS specializes on providing value-added e-commerce and web-based software development and offshore software outsourcing services to emerging enterprises helping them successfully plan and implement business initiatives.

Contact Us for more information.

Node: Database use, Next: Getting information, Prev: Entering queries, Up: Tutorial
Creating and Using a Database
 
 
 
Creating database      Creating a database
Creating tables      Creating a table
Loading tables      Loading data into a table
Retrieving data      Retrieving information from a table
 
Now that you know how to enter commands, it's time to access a database.
 
Suppose you have several pets in your home (your menagerie) and you'd like to keep track of various types of information about them.  You can do so by creating tables to hold your data and loading them with the desired information.  Then you can answer different sorts of questions about your animals by retrieving data from the tables.  This section shows you how to:
 
      ·      Create a database
 
      ·      Create a table
 
      ·      Load data into the table
 
      ·      Retrieve data from the table in various ways
 
      ·      Use multiple tables
 
The menagerie database will be simple (deliberately), but it is not difficult to think of real-world situations in which a similar type of database might be used.  For example, a database like this could be used by a farmer to keep track of livestock, or by a veterinarian to keep track of patient records.  A menagerie distribution containing some of the queries and sample data used in the following sections can be obtained from the MySQL web site.  It's available in either compressed tar format (`http://www.mysql.com/Downloads/Contrib/Examples/menagerie.tar.gz') or Zip format (`http://www.mysql.com/Downloads/Contrib/Examples/menagerie.zip').
 
Use the SHOW statement to find out what databases currently exist on the server:
 
mysql> SHOW DATABASES;
+----------+
| Database |
+----------+
| mysql    |
| test     |
| tmp      |
+----------+
 
The list of databases is probably different on your machine, but the mysql and test databases are likely to be among them.  The mysql database is required because it describes user access privileges.  The test database is often provided as a workspace for users to try things out.
 
Note that you may not see all databases if you don't have the SHOW DATABASES privilege. See GRANT.
 
If the test database exists, try to access it:
 
mysql> USE test
Database changed
 
Note that USE, like QUIT, does not require a semicolon.  (You can terminate such statements with a semicolon if you like; it does no harm.)  The USE statement is special in another way, too:  it must be given on a single line.
 
You can use the test database (if you have access to it) for the examples that follow, but anything you create in that database can be removed by anyone else with access to it.  For this reason, you should probably ask your MySQL administrator for permission to use a database of your own.  Suppose you want to call yours menagerie.  The administrator needs to execute a command like this:
 
mysql> GRANT ALL ON menagerie.* TO your_mysql_name;
 
where your_mysql_name is the MySQL user name assigned to you.
 
Offshore Software Outsourcing company Russia Florida Massachusetts Boston Belarus, Offshore Software Development Services, Offshore Programming and IT OutsourcingOffshore Development, Programming  Services, Tampa FL Russia, E-commerce, Database, CRM, Financial Insurance Health Care Real EstateOffshore Software Development Services, Software Outsourcing Russia
HOME PAGE, Offshore Software Outsourcing Company, offshore IT outsourcing services, offshore 
software development Russia Massachusetts Florida New York CT VT RI software development