SQL inherently

SQL, or Structured Query Language, is not really a language. It does not follow all the rules of the typical
 computer programming language. There are no constructs in SQL to allow decision branches.
You can't go to a specific piece of code or execute that code if a decision has been made.

On the other hand, SQL is ideal for getting data out of a database using complicated rules.
If you team SQL with other languages such as PHP or C/C++, the combination is very powerful.
 With this kind of combination, you can accomplish any programming task.

SQL is inherently simple. The most commonly used commands in SQL are CREATE, DROP, GRANT, INSERT, SELECT, and UPDATE. The modifiers for most of these commands are WHERE, AND, OR, LIKE, GROUP BY, or ORDER BY.
A few helper functions such as, but not limited to, COUNT(), AVG(), MIN(), MAX(), and SUM() also exist.

After you have mastered this list of commands, you are ready to use SQL for most tasks. In almost all cases,
 by using some thought, complex statements can be boiled down to simpler statements. Very rarely do you require some of the more complex constructs.

MySQL Implements a Subset of SQL
Not all ANSI SQL features are implemented in MySQL. As of the 3.22 version of MySQL, the following
features are left out:



In VARCHAR columns, trailing spaces are removed when stored in the database.

In some cases CHAR columns are changed to VARCHAR columns without notification.

Privileges stay after a table is deleted. They must be explicitly revoked using the REVOKE command.
 This is because privileges are stored in the mysql database tables.

NULL and FALSE both evaluate to NULL.

MySQL 3.22 doesn't support transactions. However, it does do its work using "atomic operations."
 The authors of MySQL believe this provides "equal or better integrity," with better performance.
 MySQL version 3.23 is having transactions added to it.


You can simulate COMMIT and ROLLBACK. A COMMIT on an operation is a way of saying all the conditions are
 good, store the data. To do this in a multiuser environment, you LOCK the tables to prevent any other user
 from changing them. You then make your changes and test all the conditions.


The MySQL server version 3.22 and below is under the MySQL Free Public license, which is applicable
 to non-Microsoft platforms, and is included at the end of this book. It is a very liberal license,
 requiring payment under limited circumstances.

Some parts of the MySQL tools are under the GNU public license. Some parts of the MySQL tools are
 in the public domain. The MySQL server itself is not under the GNU license or in the public domain.
 On Microsoft platforms, the license for version 3.22 and below is a different license and requires
payment after a trial period. Check their Web site for details concerning the Microsoft licensing details.

MySQL server version 3.23 is now released under the GPL license. Version 3.23 is still in alpha as of
this writing, but should be released soon. It is in your best interest to upgrade to version 3.23 as
soon as it is stable because the GPL license is less restrictive than the MySQL license.




Related Posts:
  • Database Backups using mysqldump The MySQL server, and mysql, the MySQL client, a MySQL installation comes with many useful utility programs. We have seen mysqladmin, which is responsible for the control and retrieval of information about an operati… Read More
  • Advantages of Using PHP with MySQL Advantages of Using PHP with MySQL   There are several factors that make using PHP and MySQL together a natural choice: PHP and MySQL work well together PHP and MySQL have been developed with each other in … Read More
  • Table Types-MySQL MyISAM is the default table type in MySQL Version 3.23. It's based on the ISAM code andhas a lot of useful extensions. The index is stored in a le with the .MYI (MYIndex) extension, and the data is storedin a le with the .… Read More
  • PHP-Database-Basics-DB-Arrays Adding MySQL to PHP and combining the applications for your dynamic web site is a great start. But, it helps tremendously to structure your database right. We'll give you a solid understanding of both database de… Read More
  • Why MySQL Database? MySQL has its own client interface, allowing you to move data around and change database configuration. Note that you must use a password to log in. Assigning database users allows you to limit access to server tables … Read More
  • Linking Affects the Speed of MySQL Most of the following tests are done on Linux with the MySQL benchmarks, but they should give some indication for other operating systems and workloads. You get the fastest executable when you link with -static. On Linux, yo… Read More
  • Basic MySQL Basic MySQL Create or Drop a Database Starting with something simple, you can use the CREATE command to create a new database. The syntax is CREATE DATABASE IF NOT EXISTS [yourDBName]; When you create a database wit… Read More
  • Backing Up and Restoring Data MySQL Even the best maintained databases occasionally develop problems. Hardware failures, in particular, can really throw a monkey wrench into your web pages. Now that you're using a database, just backing up the files (HTM… Read More
  • Running MySQL on Windows MySQL supports TCP/IP on all Windows platforms and named pipes on NT. The defaultis to use named pipes for local connections on NT and TCP/IP for all other cases if theclient has TCP/IP installed. The host name speci es whic… Read More
  • Managing the Database Creating Users To create users above and beyond the default privileged root user, issue the grant command. The grant command uses this syntax: GRANT PRIVILEGES ON DATABASE.OBJECTS TO'USER'@'HOST' IDENTIFIED BY 'PASSWORD… Read More
  • Relational Databases-MySQL MySQL is a relational database. An important feature of relational systems is that a single database can be spread across several tables as opposed to our flat-file phone book example. Related data is stored in separat… Read More
  • Create the months table With MySQL Create the months table as follows: CREATE TABLE months ( month_id INT NOT NULL AUTO_INCREMENT, month VARCHAR (20), days INT, PRIMARY KEY (month_id));      To add the months to the new table, s… Read More
  • LOAD DATA INFILE statement MySQL LOAD DATA INFILE provides an alternative to INSERT for adding new records to a table. With INSERT, you specify data values directly in the INSERT statement. LOAD DATA INFILE reads the values from a separate datafile.The… Read More
  • Advanced SQL Many of the features shown in this chapter are specific to MySQL's version of SQL. For example, MySQL's functions are useful tools for working with strings, dates and times, and math. Also, we'll show some w… Read More
  • mysql_query-executes query mysql_query function  executes query on the default database, set using mysql_select_db() or by a previous query using mysql_db_query(), on the MySQL server connection referenced by connection . If no connection … Read More