Skip to main content

Displaying Table Creation Information


The  SHOW CREATE TABLE  can be used to view the exact statement that was used to create an existing table. This can be helpful in understanding the structure of a table.  It can also be used as a basis for the syntax to create a new table.  For example to show  CREATE TABLE command to create the city table use the following statement;
mysql> SHOW CREATE TABLE CountryLanguage\G
*************************** 1. row ***************************
       Table: CountryLanguage
                Create Table: CREATE TABLE `countrylanguage` (
              ` Country` char(3) NOT NULL,
               `Language` char(30) NOT NULL,
               `IsOfficial` enum('True','False') NOT NULL DEFAULT 'False',
               `Percentage` float(3,1) NOT NULL,
                PRIMARY KEY (`Country`,`Language`)
                ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Lists Language
               Spoken'
     1 row in set (#.## sec)

Comments

Popular posts from this blog

PHP INTRODUCTION

                     PHP  (recursive acronym for  PHP: Hypertext Preprocessor ) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. PHP stands for  P HP:  H ypertext  P reprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.) PHP is an open source software PHP is free to download and use Why PHP? PHP runs on different platforms (Windows, Linux, Unix, etc.) PHP is compatible with almost all servers used today (Apache, IIS, etc.) PHP is FREE to download from the official PHP resource:  www.php.net PHP is easy to learn and runs efficiently on the server side What can PHP do? Anything. PHP is mainly focused on server-side scripting, so you can...

SQL Joins

1. Login in to the mysql client using the login name and password provided by your instructor (if not already logged in). 2. View the existing databases that the MySQL Server is maintaining. SHOW DATABASES; 3. Utilize the photo_album database. USE photo_album; ---- If Need be, recreate the database and load the SQL data in that will be used for this lab CREATE DATABASE photo_album; SOURCE /tmp/photo_album.sql; 4. Query the database to display the active primary customer (email, first and last name) and all the associated active login names associated with that customer. SELECT customers.email_customer, customers.fname, customers.lname, logins.login_name  FROM customers, logins WHERE customers.email_customer = logins.email_customer  AND customers.active_customer = 'True'  AND logins.active_login = 'True';