MYSQL 5.5

Preview:

Citation preview

MYSQL 5.5BY

SUNNY OKORO

1

Contents

Applications............................................................................................................................................................................................................. 2

Database Diagram.................................................................................................................................................................................................... 4

Built-In-Function...................................................................................................................................................................................................... 6

DBA Work.............................................................................................................................................................................................................. 29

Triggers-After....................................................................................................................................................................................................... 188

Triggers-Before.................................................................................................................................................................................................... 195

Stored Procedures............................................................................................................................................................................................... 200

Applications

2

MySQL Command Line Client

MySQL Workbeanch

3

Microsoft Power Pivot

4

Microsoft Visio

Database Diagram

5

6

Built-In-Function

Date Functionsmysql> mysql> select date_format(current_timestamp,'%M-%e-%Y');+-------------------------------------------+| date_format(current_timestamp,'%M-%e-%Y') |+-------------------------------------------+| February-22-2013 |+-------------------------------------------+1 row in set (0.00 sec)

mysql> select date_format(current_timestamp,'%M-%e-%Y')AS CurrentDate \G*************************** 1. row ***************************CurrentDate: February-22-20131 row in set (0.00 sec)

mysql> select date_format(current_timestamp,'%M-%e-%Y')AS CurrentDate \g+------------------+| CurrentDate |+------------------+| February-22-2013 |+------------------+1 row in set (0.00 sec)

mysql> SELECT date_format(current_timestamp,'%h:%i')as CurrentTime;+-------------+| CurrentTime |

7

+-------------+| 11:49 |+-------------+1 row in set (0.00 sec)

mysql> SELECT date_format(current_timestamp,'%h:%i:%s:%p')as CurrentTime;+-------------+| CurrentTime |+-------------+| 11:49:43:PM |+-------------+1 row in set (0.00 sec)

mysql> select date_format(current_timestamp,'%M-%e-%Y-%h:%i:%s:%p')as 'CurrDateTime';+------------------------------+| CurrDateTime |+------------------------------+| February-22-2013-11:58:08:PM |+------------------------------+1 row in set (0.00 sec)mysql> select week(current_timestamp);+-------------------------+| week(current_timestamp) |+-------------------------+| 7 |+-------------------------+1 row in set (0.00 sec)

mysql> SELECT TO_DAYS(CURRENT_TIMESTAMP);+----------------------------+| TO_DAYS(CURRENT_TIMESTAMP) |+----------------------------+| 735287 |

8

+----------------------------+1 row in set (0.06 sec)

mysql> SET @D=(SELECT CURRENT_TIMESTAMP) -> ;Query OK, 0 rows affected (0.00 sec)

mysql> SELECT LAST_DAY(@D);+--------------+| LAST_DAY(@D) |+--------------+| 2013-02-28 |+--------------+1 row in set (0.01 sec)

mysql> SELECT DATEDIFF(@D, LAST_UPDATE)AS DATE_DIFFERENCE,COUNTRY, LAST_UPDATE, @D FROM COUNTRY \G*************************** 1. row ***************************DATE_DIFFERENCE: 2565 COUNTRY: Afghanistan LAST_UPDATE: 2006-02-15 04:44:00 @D: 2013-02-23 00:05:46*************************** 2. row ***************************DATE_DIFFERENCE: 2565 COUNTRY: Algeria LAST_UPDATE: 2006-02-15 04:44:00 @D: 2013-02-23 00:05:46*************************** 3. row ***************************DATE_DIFFERENCE: 2565 COUNTRY: American Samoa LAST_UPDATE: 2006-02-15 04:44:00 @D: 2013-02-23 00:05:46*************************** 4. row ***************************

9

mysql> SELECT LAST_DAY( LAST_UPDATE)AS DATE_DIFFERENCE,COUNTRY, LAST_UPDATE FROM COUNTRY \G;*************************** 1. row ***************************DATE_DIFFERENCE: 2006-02-28 COUNTRY: Afghanistan LAST_UPDATE: 2006-02-15 04:44:00*************************** 2. row ***************************DATE_DIFFERENCE: 2006-02-28 COUNTRY: Algeria LAST_UPDATE: 2006-02-15 04:44:00*************************** 3. row ***************************DATE_DIFFERENCE: 2006-02-28 COUNTRY: American Samoa LAST_UPDATE: 2006-02-15 04:44:00*************************** 4. row ***************************DATE_DIFFERENCE: 2006-02-28 COUNTRY: Angola LAST_UPDATE: 2006-02-15 04:44:00*************************** 5. row ***************************DATE_DIFFERENCE: 2006-02-28 COUNTRY: Anguilla LAST_UPDATE: 2006-02-15 04:44:00*************************** 6. row ***************************DATE_DIFFERENCE: 2006-02-28 COUNTRY: Argentina LAST_UPDATE: 2006-02-15 04:44:00*************************** 7. row ***************************DATE_DIFFERENCE: 2006-02-28 COUNTRY: Armenia LAST_UPDATE: 2006-02-15 04:44:00*************************** 8. row ***************************DATE_DIFFERENCE: 2006-02-28 COUNTRY: Australia LAST_UPDATE: 2006-02-15 04:44:00

10

*************************** 9. row ***************************

mysql> SELECT DATE(@D)AS CURR_DATE;+------------+| CURR_DATE |+------------+| 2013-02-23 |+------------+1 row in set (0.00 sec)

mysql> SELECT FROM_DAYS(@D);+---------------+| FROM_DAYS(@D) |+---------------+| 0005-07-06 |+---------------+1 row in set (0.02 sec)

String Functions

select character_length(country) as CharLength, Country from country order by country desc

CharLength Country11 Afghanistan7 Algeria14 American Samoa6 Angola8 Anguilla9 Argentina7 Armenia9 Australia7 Austria10 Azerbaijan

11

7 Bahrain10 Bangladesh7 Belarus7 Bolivia6 Brazil6 Brunei8 Bulgaria8 Cambodia8 Cameroon6 Canada4 Chad5 Chile5 China8 Colombia

37 Congo, The Democratic Republic of the

14 Czech Republic18 Dominican Republic7 Ecuador5 Egypt7 Estonia8 Ethiopia13 Faroe Islands7 Finland6 France13 French Guiana16 French Polynesia6 Gambia

RESULTS (ABRIDGED)

12

select c.customer_id, c.store_id, CONCAT_WS (',',c.last_name, c.first_name) as Cust_Name , a.address, a.address2,a.phone, t.city,a.postal_code, con.country from customer c inner join address a on c.address_id = a.address_id inner join city t on a.city_id = t.city_id inner join country con on t.country_id = con.country_id order by c.last_name,c.first_name

customer_id store_id Cust_Name address address2 phone city postal_code country

96 1 ALEXANDER,DIANA 1308 Arecibo Way 6171054059 Augusta-Richmond County

30695 United States

345 1 ARTIS,CARL 1628 Nagareyama Lane

20064292617 San Lorenzo 60079 Paraguay

79 1 BARNES,RACHEL 586 Tete Way 18581624103 Kamakura 1079 Japan

134 1 BOYD,EMMA 765 Southampton Drive

23712411567 Qalyub 4285 Egypt

5 1 BROWN,ELIZABETH 53 Idfu Parkway 10655648674 Nantou 42399 Taiwan

95 2 BRYANT,PAULA 1697 Tanauan Lane 4764773857 Pathankot 22870 India

13

290 1 CHAMBERS,KRISTINA 544 Tarsus Boulevard 892523334 Valle de la Pascua

53145 Venezuela

535 1 ELROD,JAVIER 195 Ilorin Street 8912935608 NDjamna 49250 Chad

29 2 HERNANDEZ,ANGELA 786 Aurora Avenue 18461860151 Shimonoseki 65750 Japan

490 1 MCDUFFIE,SAM 656 Matamoros Drive

17305839123 Sogamoso 19489 Colombia

229 1 NGUYEN,TAMARA 356 Olomouc Manor 22326410776 Anpolis 93323 Brazil

575 2 OGLESBY,ISAAC 186 Skikda Lane 14465669789 Cuernavaca 89422 Mexico

416 2 PINSON,JEFFERY 966 Arecibo Loop 15273765306 Dadu 94018 Pakistan

140 1 RAMOS,EVA 1666 Beni-Mellal Place

9099941466 Clarksville 13377 United States

61 2 RIVERA,KATHERINE 915 Ponce Place 1395251317 Basel 83980 Switzerland

404 2 SCROGGINS,STANLEY 1266 Laredo Parkway 1483365694 Omiya 7664 Japan

RESULTS (ABRIDGED)

select c.customer_id, c.store_id, CONCAT(c.last_name,',', c.first_name) as Cust_Name , a.address, a.address2,a.phone, t.city,a.postal_code, con.country from customer c inner join address a

14

on c.address_id = a.address_id inner join city t on a.city_id = t.city_id inner join country con on t.country_id = con.country_id order by c.last_name,c.first_name

customer_id store_id Cust_Name address address2 phone city postal_code country96 1 ALEXANDER,DIANA 1308 Arecibo Way 6171054059 Augusta-

Richmond County

30695 United States

345 1 ARTIS,CARL 1628 Nagareyama Lane

20064292617

San Lorenzo 60079 Paraguay

79 1 BARNES,RACHEL 586 Tete Way 18581624103

Kamakura 1079 Japan

134 1 BOYD,EMMA 765 Southampton Drive

23712411567

Qalyub 4285 Egypt

5 1 BROWN,ELIZABETH 53 Idfu Parkway 10655648674

Nantou 42399 Taiwan

95 2 BRYANT,PAULA 1697 Tanauan Lane 4764773857 Pathankot 22870 India290 1 CHAMBERS,KRISTINA 544 Tarsus

Boulevard892523334 Valle de la

Pascua53145 Venezuela

535 1 ELROD,JAVIER 195 Ilorin Street 8912935608 NDjamna 49250 Chad29 2 HERNANDEZ,ANGELA 786 Aurora Avenue 1846186015

1Shimonoseki 65750 Japan

490 1 MCDUFFIE,SAM 656 Matamoros Drive 17305839123

Sogamoso 19489 Colombia

229 1 NGUYEN,TAMARA 356 Olomouc Manor 22326410776

Anpolis 93323 Brazil

575 2 OGLESBY,ISAAC 186 Skikda Lane 14465669789

Cuernavaca 89422 Mexico

416 2 PINSON,JEFFERY 966 Arecibo Loop 15273765306

Dadu 94018 Pakistan

15

140 1 RAMOS,EVA 1666 Beni-Mellal Place

9099941466 Clarksville 13377 United States

61 2 RIVERA,KATHERINE 915 Ponce Place 1395251317 Basel 83980 Switzerland404 2 SCROGGINS,STANLEY 1266 Laredo

Parkway1483365694 Omiya 7664 Japan

RESULTS (ABRIDGED)

mysql> SELECT GROUP_CONCAT(COUNTRY) FROM COUNTRY LIMIT 1;

| GROUP_CONCAT(COUNTRY) || Afghanistan,Algeria,American Samoa,Angola,Anguilla,Argentina,Armenia,Australia,Austria,Azerbaijan,Bahrain,Bangladesh,Belarus,Bolivia,Brazil,Brunei,Bulgaria,Cambodia,Cameroon,Canada,Chad,Chile,China,Colombia,Congo, The Democratic Republic of the,Czech Republic,Dominican Republic,Ecuador,Egypt,Estonia,Ethiopia,Faroe Islands,Finland,France,French Guiana,French Polynesia,Gambia,Germany,Greece,Greenland,Holy See (Vatican City State),Hong Kong,Hungary,India,Indonesia,Iran,Iraq,Israel,Italy,Japan,Kazakstan,Kenya,Kuwait,Latvia,Liechtenstein,Lithuania,Madagascar,Malawi,Malaysia,Mexico,Moldova,Morocco,Mozambique,Myanmar,Nauru,Nepal,Netherlands,New Zealand,Nigeria,North Korea,Oman,Pakistan,Paraguay,Peru,Philippines,Poland,Puerto Rico,Romania,Runion,Russian Federation,Saint Vincent and the Grenadines,Saudi Arabia,Senegal,Slovakia,South Africa,South Korea,Spain,Sri Lanka,Sudan,Sweden,Switzerland,Taiwan,Tanzania,Thailand,Tonga,Tunisia,Turkey,Turkmenistan,Tuvalu,Ukraine,United Arab Emirates,United Kingdom,United States,Vene |

+1 row in set, 1 warning (0.00 sec)

select upper(country) as uppercase,lower(country)as lowercase from country

uppercase lowercaseAFGHANISTAN afghanistan

16

ALGERIA algeriaAMERICAN SAMOA american samoaANGOLA angolaANGUILLA anguillaARGENTINA argentinaARMENIA armeniaAUSTRALIA australiaAUSTRIA austriaAZERBAIJAN azerbaijanBAHRAIN bahrainBANGLADESH bangladeshBELARUS belarusBOLIVIA boliviaBRAZIL brazilBRUNEI bruneiBULGARIA bulgariaCAMBODIA cambodiaCAMEROON cameroonCANADA canada

RESULTS (ABRIDGED)

SELECT COUNTRY AS COUNTRY_NAME, CASE WHEN CHARACTER_LENGTH(COUNTRY <= 6) THEN LPAD(COUNTRY,4,4) WHEN CHARACTER_LENGTH(COUNTRY <=10) THEN LPAD(COUNTRY,6,6) WHEN CHARACTER_LENGTH(COUNTRY <=15) THEN LPAD(COUNTRY,5,5) WHEN CHARACTER_LENGTH(COUNTRY <=20) THEN LPAD(COUNTRY,7,7) END AS COUNTRYFROM COUNTRY

17

COUNTRY_NAME COUNTRYAfghanistan AfghAlgeria AlgeAmerican Samoa AmerAngola AngoAnguilla AnguArgentina ArgeArmenia ArmeAustralia AustAustria AustAzerbaijan AzerBahrain BahrBangladesh BangBelarus BelaBolivia BoliBrazil BrazBrunei BrunBulgaria BulgCambodia CambCameroon CameCanada CanaChad ChadChile ChilChina ChinColombia ColoCzech Republic CzecDominican Republic DomiEcuador EcuaEgypt EgypEstonia Esto

18

Ethiopia EthiFaroe Islands FaroFinland FinlFrance FranFrench Guiana FrenFrench Polynesia FrenGambia GambGermany GermGreece GreeHoly See (Vatican City State)

Holy

Hong Kong HongHungary HungIndia IndiIndonesia IndoIran IranIraq IraqIsrael IsraItaly ItalJapan JapaKazakstan KazaKenya KenyKuwait KuwaLatvia LatvLiechtenstein LiecLithuania LithMadagascar MadaMalawi MalaMalaysia MalaMexico MexiMoldova MoldMorocco Moro

19

Mozambique MozaMyanmar MyanNauru NaurNepal NepaNetherlands NethNew Zealand NewNigeria NigeNorth Korea NortOman OmanPakistan PakiParaguay ParaPeru PeruPhilippines PhilPoland PolaPuerto Rico PuerRomania RomaRunion RuniRussian Federation RussSaint Vincent and the Grenadines

Sain

Saudi Arabia SaudSenegal SeneSlovakia SlovSouth Africa SoutSouth Korea SoutSpain SpaiSri Lanka SriSudan SudaSweden SwedSwitzerland SwitTaiwan TaiwTanzania Tanz

20

Thailand ThaiTonga TongTunisia TuniTurkey TurkTurkmenistan TurkTuvalu TuvaUkraine UkraUnited Arab Emirates UnitUnited Kingdom UnitUnited States UnitVenezuela VeneVietnam VietVirgin Islands, U.S. VirgYemen YemeYugoslavia YugoZambia Zamb

RESULTS (ABRIDGED)

mysql> SELECT MIN(CHARACTER_LENGTH(COUNTRY)) AS SmallestChar,Max(character_length(country))as HighestChar FROM COUNTRY;+--------------+-------------+| SmallestChar | HighestChar |+--------------+-------------+| 4 | 37 |+--------------+-------------+1 row in set (0.00 sec)

SELECT COUNTRY AS COUNTRY_NAME, CASE WHEN CHARACTER_LENGTH(COUNTRY <= 6) THEN RPAD(COUNTRY,4,4)

21

WHEN CHARACTER_LENGTH(COUNTRY <=10) THEN RPAD(COUNTRY,6,9) WHEN CHARACTER_LENGTH(COUNTRY <=15) THEN RPAD(COUNTRY,5,10) WHEN CHARACTER_LENGTH(COUNTRY <=20) THEN RPAD(COUNTRY,7,10) END AS COUNTRY FROM COUNTRY

COUNTRY_NAME COUNTRYAfghanistan AfghAlgeria AlgeAmerican Samoa AmerAngola AngoAnguilla AnguArgentina ArgeArmenia ArmeAustralia AustAustria AustAzerbaijan AzerBahrain BahrBangladesh BangBelarus BelaBolivia BoliBrazil BrazBrunei BrunBulgaria BulgCambodia CambCameroon CameCanada CanaChad ChadChile ChilChina ChinColombia ColoCongo, The Democratic Republic of Cong

22

theCzech Republic CzecDominican Republic DomiEcuador EcuaEgypt EgypEstonia EstoEthiopia EthiFaroe Islands FaroFinland FinlFrance FranFrench Guiana FrenFrench Polynesia FrenGambia GambGermany GermGreece GreeGreenland GreeHoly See (Vatican City State) HolyHong Kong HongHungary HungIndia IndiIndonesia IndoIran IranIraq IraqIsrael IsraItaly ItalJapan JapaKazakstan KazaKenya KenyKuwait KuwaLatvia LatvLiechtenstein LiecLithuania Lith

23

Madagascar MadaMalawi MalaMalaysia MalaMexico MexiMoldova MoldMorocco MoroMozambique MozaMyanmar MyanNauru NaurNepal NepaNetherlands NethNew Zealand NewNigeria NigeNorth Korea NortOman OmanPakistan PakiParaguay ParaPeru PeruPhilippines PhilPoland PolaPuerto Rico PuerRomania RomaRunion RuniRussian Federation RussSaint Vincent and the Grenadines SainSaudi Arabia SaudSenegal SeneSlovakia SlovSouth Africa SoutSouth Korea SoutSpain SpaiSri Lanka Sri

24

Sudan SudaSweden SwedSwitzerland Swit

RESULTS (ABRIDGED)

SELECT LPAD(CUSTOMER_ID,9,'*****') AS CUSTID, LAST_NAME, FIRST_NAME FROM CUSTOMER;

CUSTID LAST_NAME FIRST_NAME********1 SMITH Sam********2 JOHNSON PATRICIA********3 WILLIAMS LINDA********4 JONES BARBARA********5 BROWN ELIZABETH********6 DAVIS JENNIFER********7 MILLER MARIA********8 WILSON SUSAN********9 MOORE MARGARET*******10 TAYLOR DOROTHY*******11 ANDERSON LISA*******12 THOMAS NANCY*******13 JACKSON KAREN*******14 WHITE BETTY*******15 HARRIS HELEN*******16 MARTIN SANDRA*******17 THOMPSON DONNA*******18 GARCIA CAROL*******19 MARTINEZ RUTH*******20 ROBINSON SHARON*******21 CLARK MICHELLE

25

RESULTS (ABRIDGED)

SELECT SUBSTRING(LPAD(CUSTOMER_ID,12,'***'),9,9)AS CUST_ID, FIRST_NAME,LAST_NAME FROM CUSTOMER

CUST_ID FIRST_NAME LAST_NAME***1 Sam SMITH***2 PATRICIA JOHNSON***3 LINDA WILLIAMS***4 BARBARA JONES***5 ELIZABETH BROWN***6 JENNIFER DAVIS***7 MARIA MILLER***8 SUSAN WILSON**16 SANDRA MARTIN**23 SARAH LEWIS**24 KIMBERLY LEE**63 ASHLEY RICHARDSON**64 JUDITH COX*108 TRACY COLE*109 EDNA WEST*110 TIFFANY JORDAN*111 CARMEN OWENS*112 ROSA REYNOLDS

RESULTS (ABRIDGED)

Numeric Functions

select c.customer_id, first_name,last_name, p.amount,round(p.amount)as roundedamount from customer c inner join payment p on c.customer_id =p.customer_id ;

26

RESULTS (ABRIDGED)

select c.customer_id, first_name,last_name, round(avg(p.amount)) as Avg_Amount, Max(p.amount) Highest_Amount, Min(p.amount) as

Snallest_Amount,round(sum(p.amount))as rounded_amount from customer c inner join payment p on c.customer_id =p.customer_id group by c.customer_id

*************************** 1. row *************************** customer_id: 1 first_name: MARY

customer_id first_name last_name amount roundedamount1 Sam SMITH 4.99 51 Sam SMITH 4.99 51 Sam SMITH 4.99 51 Sam SMITH 4.99 51 Sam SMITH 4.99 51 Sam SMITH 4.99 51 Sam SMITH 4.99 51 Sam SMITH 4.99 52 PATRICIA JOHNSON 4.99 52 PATRICIA JOHNSON 4.99 52 PATRICIA JOHNSON 4.99 52 PATRICIA JOHNSON 4.99 52 PATRICIA JOHNSON 4.99 52 PATRICIA JOHNSON 4.99 53 LINDA WILLIAMS 4.99 53 LINDA WILLIAMS 4.99 53 LINDA WILLIAMS 4.99 53 LINDA WILLIAMS 4.99 53 LINDA WILLIAMS 4.99 53 LINDA WILLIAMS 4.99 54 BARBARA JONES 4.99 54 BARBARA JONES 4.99 54 BARBARA JONES 4.99 55 ELIZABETH BROWN 4.99 5

27

last_name: SMITH Avg_Amount: 4 Highest_Amount: 9.99Snallest_Amount: 0.99 rounded_amount: 119*************************** 2. row *************************** customer_id: 2 first_name: PATRICIA last_name: JOHNSON Avg_Amount: 5 Highest_Amount: 10.99Snallest_Amount: 0.99 rounded_amount: 129*************************** 3. row *************************** customer_id: 3 first_name: LINDA last_name: WILLIAMS Avg_Amount: 5 Highest_Amount: 10.99Snallest_Amount: 0.99 rounded_amount: 136*************************** 4. row *************************** customer_id: 4 first_name: BARBARA last_name: JONES Avg_Amount: 4 Highest_Amount: 8.99Snallest_Amount: 0.99 rounded_amount: 82*************************** 5. row *************************** customer_id: 5 first_name: ELIZABETH last_name: BROWN Avg_Amount: 4

28

Highest_Amount: 9.99Snallest_Amount: 0.99 rounded_amount: 145

mysql> select c.customer_id, first_name,last_name, amount, cos(amount), tan(amount),sin(amount) from customer c inner join payment p on c.customer_id =p.customer_id group by c.customer_id \G*************************** 1. row ***************************customer_id: 1 first_name: MARY last_name: SMITH amount: 2.99cos(amount): -0.988531820827396tan(amount): -0.1527646443995571sin(amount): 0.15101271208634384*************************** 2. row ***************************customer_id: 2 first_name: PATRICIA last_name: JOHNSON amount: 4.99cos(amount): 0.27405891954542744tan(amount): -3.5091465186462645sin(amount): -0.9617129034267934*************************** 3. row ***************************customer_id: 3 first_name: LINDA last_name: WILLIAMS amount: 1.99cos(amount): -0.4070332066592655tan(amount): -2.244075781526737sin(amount): 0.9134133613412252*************************** 4. row ***************************customer_id: 4 first_name: BARBARA last_name: JONES

29

amount: 4.99cos(amount): 0.27405891954542744tan(amount): -3.5091465186462645sin(amount): -0.9617129034267934*************************** 5. row ***************************customer_id: 5 first_name: ELIZABETH last_name: BROWN amount: 0.99cos(amount): 0.5486898605815875tan(amount): 1.5236767410179022sin(amount): 0.8360259786005205*************************** 6. row ***************************customer_id: 6 first_name: JENNIFER last_name: DAVIS amount: 4.99cos(amount): 0.27405891954542744tan(amount): -3.5091465186462645sin(amount): -0.9617129034267934*************************** 7. row ***************************customer_id: 7 first_name: MARIA last_name: MILLER amount: 5.99cos(amount): 0.9573281701231308tan(amount): -0.30188505822636535sin(amount): -0.2890030703793611*************************** 8. row ***************************customer_id: 8 first_name: SUSAN last_name: WILSON amount: 6.99cos(amount): 0.7604343160346811

30

tan(amount): 0.8540051902908776sin(amount): 0.6494148527689112

DBA Work

mysql> show columns from customer \G*************************** 1. row *************************** Field: customer_id Type: smallint(5) unsigned Null: NO Key: PRIDefault: NULL Extra: auto_increment*************************** 2. row *************************** Field: store_id Type: tinyint(3) unsigned Null: NO Key: MULDefault: NULL Extra: *************************** 3. row *************************** Field: first_name Type: varchar(45) Null: NO Key: Default: NULL Extra: *************************** 4. row *************************** Field: last_name Type: varchar(45) Null: NO Key: MUL

31

Default: NULL Extra: *************************** 5. row *************************** Field: email Type: varchar(50) Null: YES Key: Default: NULL Extra: *************************** 6. row *************************** Field: address_id Type: smallint(5) unsigned Null: NO Key: MULDefault: NULL Extra: *************************** 7. row *************************** Field: active Type: tinyint(1) Null: NO Key: Default: 1 Extra: *************************** 8. row *************************** Field: create_date Type: datetime Null: NO Key: Default: NULL Extra: *************************** 9. row *************************** Field: last_update Type: timestamp Null: NO

32

Key: Default: CURRENT_TIMESTAMP Extra: on update CURRENT_TIMESTAMP9 rows in set (0.01 sec)

mysql> show full columns from customer \G*************************** 1. row *************************** Field: customer_id Type: smallint(5) unsigned Collation: NULL Null: NO Key: PRI Default: NULL Extra: auto_incrementPrivileges: select,insert,update,references Comment: *************************** 2. row *************************** Field: store_id Type: tinyint(3) unsigned Collation: NULL Null: NO Key: MUL Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 3. row *************************** Field: first_name Type: varchar(45) Collation: utf8_general_ci Null: NO Key:

33

Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 4. row *************************** Field: last_name Type: varchar(45) Collation: utf8_general_ci Null: NO Key: MUL Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 5. row *************************** Field: email Type: varchar(50) Collation: utf8_general_ci Null: YES Key: Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 6. row *************************** Field: address_id Type: smallint(5) unsigned Collation: NULL Null: NO Key: MUL Default: NULL Extra: Privileges: select,insert,update,references Comment:

34

*************************** 7. row *************************** Field: active Type: tinyint(1) Collation: NULL Null: NO Key: Default: 1 Extra: Privileges: select,insert,update,references Comment: *************************** 8. row *************************** Field: create_date Type: datetime Collation: NULL Null: NO Key: Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 9. row *************************** Field: last_update Type: timestamp Collation: NULL Null: NO Key: Default: CURRENT_TIMESTAMP Extra: on update CURRENT_TIMESTAMPPrivileges: select,insert,update,references Comment: 9 rows in set (0.01 sec)

35

mysql> SHOW INDEX FROM CUSTOMER \G*************************** 1. row *************************** Table: CUSTOMER Non_unique: 0 Key_name: PRIMARY Seq_in_index: 1 Column_name: customer_id Collation: A Cardinality: 671 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 2. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_store_id Seq_in_index: 1 Column_name: store_id Collation: A Cardinality: 4 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment:

36

*************************** 3. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_address_id Seq_in_index: 1 Column_name: address_id Collation: A Cardinality: 671 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 4. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_last_name Seq_in_index: 1 Column_name: last_name Collation: A Cardinality: 671 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: 4 rows in set (0.00 sec)

mysql> SHOW KEYS FROM CUSTOMER \G*************************** 1. row *************************** Table: CUSTOMER Non_unique: 0

37

Key_name: PRIMARY Seq_in_index: 1 Column_name: customer_id Collation: A Cardinality: 577 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 2. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_store_id Seq_in_index: 1 Column_name: store_id Collation: A Cardinality: 3 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 3. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_address_id Seq_in_index: 1 Column_name: address_id Collation: A Cardinality: 577 Sub_part: NULL

38

Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 4. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_last_name Seq_in_index: 1 Column_name: last_name Collation: A Cardinality: 577 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: 4 rows in set (0.00 sec)

mysql> SHOW INDEX FROM CUSTOMER \G*************************** 1. row *************************** Table: CUSTOMER Non_unique: 0 Key_name: PRIMARY Seq_in_index: 1 Column_name: customer_id Collation: A Cardinality: 505 Sub_part: NULL Packed: NULL Null: Index_type: BTREE

39

Comment: Index_comment: *************************** 2. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_store_id Seq_in_index: 1 Column_name: store_id Collation: A Cardinality: 3 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 3. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_address_id Seq_in_index: 1 Column_name: address_id Collation: A Cardinality: 505 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 4. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_last_name

40

Seq_in_index: 1 Column_name: last_name Collation: A Cardinality: 505 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: 4 rows in set (0.00 sec)

mysql> show columns from customers \GERROR 1146 (42S02): Table 'sakila.customers' doesn't existmysql> show columns from customer \G*************************** 1. row *************************** Field: customer_id Type: smallint(5) unsigned Null: NO Key: PRIDefault: NULL Extra: auto_increment*************************** 2. row *************************** Field: store_id Type: tinyint(3) unsigned Null: NO Key: MULDefault: NULL Extra: *************************** 3. row *************************** Field: first_name Type: varchar(45) Null: NO

41

Key: Default: NULL Extra: *************************** 4. row *************************** Field: last_name Type: varchar(45) Null: NO Key: MULDefault: NULL Extra: *************************** 5. row *************************** Field: email Type: varchar(50) Null: YES Key: Default: NULL Extra: *************************** 6. row *************************** Field: address_id Type: smallint(5) unsigned Null: NO Key: MULDefault: NULL Extra: *************************** 7. row *************************** Field: active Type: tinyint(1) Null: NO Key: Default: 1 Extra: *************************** 8. row *************************** Field: create_date Type: datetime

42

Null: NO Key: Default: NULL Extra: *************************** 9. row *************************** Field: last_update Type: timestamp Null: NO Key: Default: CURRENT_TIMESTAMP Extra: on update CURRENT_TIMESTAMP9 rows in set (0.01 sec)

mysql> SHOW INDEX FROM CUSTOMER \G*************************** 1. row *************************** Table: CUSTOMER Non_unique: 0 Key_name: PRIMARY Seq_in_index: 1 Column_name: customer_id Collation: A Cardinality: 671 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 2. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_store_id Seq_in_index: 1 Column_name: store_id

43

Collation: A Cardinality: 4 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 3. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_address_id Seq_in_index: 1 Column_name: address_id Collation: A Cardinality: 671 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 4. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_last_name Seq_in_index: 1 Column_name: last_name Collation: A Cardinality: 671 Sub_part: NULL Packed: NULL Null: Index_type: BTREE

44

Comment: Index_comment: 4 rows in set (0.00 sec)

mysql> SHOW KEYS FROM CUSTOMER \G*************************** 1. row *************************** Table: CUSTOMER Non_unique: 0 Key_name: PRIMARY Seq_in_index: 1 Column_name: customer_id Collation: A Cardinality: 577 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 2. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_store_id Seq_in_index: 1 Column_name: store_id Collation: A Cardinality: 3 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 3. row ***************************

45

Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_address_id Seq_in_index: 1 Column_name: address_id Collation: A Cardinality: 577 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 4. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_last_name Seq_in_index: 1 Column_name: last_name Collation: A Cardinality: 577 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: 4 rows in set (0.00 sec)

mysql> SHOW INDEX FROM CUSTOMER;+----------+------------+-------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |+----------+------------+-------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+

46

| CUSTOMER | 0 | PRIMARY | 1 | customer_id | A | 646 | NULL | NULL | | BTREE | | || CUSTOMER | 1 | idx_fk_store_id | 1 | store_id | A | 3 | NULL | NULL | | BTREE | | || CUSTOMER | 1 | idx_fk_address_id | 1 | address_id | A | 646 | NULL | NULL | | BTREE | | || CUSTOMER | 1 | idx_last_name | 1 | last_name | A | 646 | NULL | NULL | | BTREE | | |+----------+------------+-------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+4 rows in set (0.00 sec)

mysql> SHOW INDEX FROM CUSTOMER \G*************************** 1. row *************************** Table: CUSTOMER Non_unique: 0 Key_name: PRIMARY Seq_in_index: 1 Column_name: customer_id Collation: A Cardinality: 505 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 2. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_store_id Seq_in_index: 1 Column_name: store_id Collation: A Cardinality: 3 Sub_part: NULL Packed: NULL Null: Index_type: BTREE

47

Comment: Index_comment: *************************** 3. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_address_id Seq_in_index: 1 Column_name: address_id Collation: A Cardinality: 505 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 4. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_last_name Seq_in_index: 1 Column_name: last_name Collation: A Cardinality: 505 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: 4 rows in set (0.00 sec)

mysql> desc customer \G*************************** 1. row ***************************

48

Field: customer_id Type: smallint(5) unsigned Null: NO Key: PRIDefault: NULL Extra: auto_increment*************************** 2. row *************************** Field: store_id Type: tinyint(3) unsigned Null: NO Key: MULDefault: NULL Extra: *************************** 3. row *************************** Field: first_name Type: varchar(45) Null: NO Key: Default: NULL Extra: *************************** 4. row *************************** Field: last_name Type: varchar(45) Null: NO Key: MULDefault: NULL Extra: *************************** 5. row *************************** Field: email Type: varchar(50) Null: YES Key: Default: NULL Extra:

49

*************************** 6. row *************************** Field: address_id Type: smallint(5) unsigned Null: NO Key: MULDefault: NULL Extra: *************************** 7. row *************************** Field: active Type: tinyint(1) Null: NO Key: Default: 1 Extra: *************************** 8. row *************************** Field: create_date Type: datetime Null: NO Key: Default: NULL Extra: *************************** 9. row *************************** Field: last_update Type: timestamp Null: NO Key: Default: CURRENT_TIMESTAMP Extra: on update CURRENT_TIMESTAMP9 rows in set (0.01 sec)

mysql> SHOW Character set \G*************************** 1. row *************************** Charset: big5 Description: Big5 Traditional Chinese

50

Default collation: big5_chinese_ci Maxlen: 2*************************** 2. row *************************** Charset: dec8 Description: DEC West EuropeanDefault collation: dec8_swedish_ci Maxlen: 1*************************** 3. row *************************** Charset: cp850 Description: DOS West EuropeanDefault collation: cp850_general_ci Maxlen: 1*************************** 4. row *************************** Charset: hp8 Description: HP West EuropeanDefault collation: hp8_english_ci Maxlen: 1*************************** 5. row *************************** Charset: koi8r Description: KOI8-R Relcom RussianDefault collation: koi8r_general_ci Maxlen: 1*************************** 6. row *************************** Charset: latin1 Description: cp1252 West EuropeanDefault collation: latin1_swedish_ci Maxlen: 1*************************** 7. row *************************** Charset: latin2 Description: ISO 8859-2 Central EuropeanDefault collation: latin2_general_ci Maxlen: 1*************************** 8. row *************************** Charset: swe7

51

Description: 7bit SwedishDefault collation: swe7_swedish_ci Maxlen: 1*************************** 9. row *************************** Charset: ascii Description: US ASCIIDefault collation: ascii_general_ci Maxlen: 1*************************** 10. row *************************** Charset: ujis Description: EUC-JP JapaneseDefault collation: ujis_japanese_ci Maxlen: 3*************************** 11. row *************************** Charset: sjis Description: Shift-JIS JapaneseDefault collation: sjis_japanese_ci Maxlen: 2*************************** 12. row *************************** Charset: hebrew Description: ISO 8859-8 HebrewDefault collation: hebrew_general_ci Maxlen: 1*************************** 13. row *************************** Charset: tis620 Description: TIS620 ThaiDefault collation: tis620_thai_ci Maxlen: 1*************************** 14. row *************************** Charset: euckr Description: EUC-KR KoreanDefault collation: euckr_korean_ci Maxlen: 2*************************** 15. row ***************************

52

Charset: koi8u Description: KOI8-U UkrainianDefault collation: koi8u_general_ci Maxlen: 1*************************** 16. row *************************** Charset: gb2312 Description: GB2312 Simplified ChineseDefault collation: gb2312_chinese_ci Maxlen: 2*************************** 17. row *************************** Charset: greek Description: ISO 8859-7 GreekDefault collation: greek_general_ci Maxlen: 1*************************** 18. row *************************** Charset: cp1250 Description: Windows Central EuropeanDefault collation: cp1250_general_ci Maxlen: 1*************************** 19. row *************************** Charset: gbk Description: GBK Simplified ChineseDefault collation: gbk_chinese_ci Maxlen: 2*************************** 20. row *************************** Charset: latin5 Description: ISO 8859-9 TurkishDefault collation: latin5_turkish_ci Maxlen: 1*************************** 21. row *************************** Charset: armscii8 Description: ARMSCII-8 ArmenianDefault collation: armscii8_general_ci Maxlen: 1

53

*************************** 22. row *************************** Charset: utf8 Description: UTF-8 UnicodeDefault collation: utf8_general_ci Maxlen: 3*************************** 23. row *************************** Charset: ucs2 Description: UCS-2 UnicodeDefault collation: ucs2_general_ci Maxlen: 2*************************** 24. row *************************** Charset: cp866 Description: DOS RussianDefault collation: cp866_general_ci Maxlen: 1*************************** 25. row *************************** Charset: keybcs2 Description: DOS Kamenicky Czech-SlovakDefault collation: keybcs2_general_ci Maxlen: 1*************************** 26. row *************************** Charset: macce Description: Mac Central EuropeanDefault collation: macce_general_ci Maxlen: 1*************************** 27. row *************************** Charset: macroman Description: Mac West EuropeanDefault collation: macroman_general_ci Maxlen: 1*************************** 28. row *************************** Charset: cp852 Description: DOS Central EuropeanDefault collation: cp852_general_ci

54

Maxlen: 1*************************** 29. row *************************** Charset: latin7 Description: ISO 8859-13 BalticDefault collation: latin7_general_ci Maxlen: 1*************************** 30. row *************************** Charset: utf8mb4 Description: UTF-8 UnicodeDefault collation: utf8mb4_general_ci Maxlen: 4*************************** 31. row *************************** Charset: cp1251 Description: Windows CyrillicDefault collation: cp1251_general_ci Maxlen: 1*************************** 32. row *************************** Charset: utf16 Description: UTF-16 UnicodeDefault collation: utf16_general_ci Maxlen: 4*************************** 33. row *************************** Charset: cp1256 Description: Windows ArabicDefault collation: cp1256_general_ci Maxlen: 1*************************** 34. row *************************** Charset: cp1257 Description: Windows BalticDefault collation: cp1257_general_ci Maxlen: 1*************************** 35. row *************************** Charset: utf32 Description: UTF-32 Unicode

55

Default collation: utf32_general_ci Maxlen: 4*************************** 36. row *************************** Charset: binary Description: Binary pseudo charsetDefault collation: binary Maxlen: 1*************************** 37. row *************************** Charset: geostd8 Description: GEOSTD8 GeorgianDefault collation: geostd8_general_ci Maxlen: 1*************************** 38. row *************************** Charset: cp932 Description: SJIS for Windows JapaneseDefault collation: cp932_japanese_ci Maxlen: 2*************************** 39. row *************************** Charset: eucjpms Description: UJIS for Windows JapaneseDefault collation: eucjpms_japanese_ci Maxlen: 339 rows in set (0.00 sec)

mysql> SHOW Character set from customer;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from customer' at line 1mysql> SHOW Character set ;+----------+-----------------------------+---------------------+--------+| Charset | Description | Default collation | Maxlen |+----------+-----------------------------+---------------------+--------+| big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 || dec8 | DEC West European | dec8_swedish_ci | 1 || cp850 | DOS West European | cp850_general_ci | 1 |

56

| hp8 | HP West European | hp8_english_ci | 1 || koi8r | KOI8-R Relcom Russian | koi8r_general_ci | 1 || latin1 | cp1252 West European | latin1_swedish_ci | 1 || latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 || swe7 | 7bit Swedish | swe7_swedish_ci | 1 || ascii | US ASCII | ascii_general_ci | 1 || ujis | EUC-JP Japanese | ujis_japanese_ci | 3 || sjis | Shift-JIS Japanese | sjis_japanese_ci | 2 || hebrew | ISO 8859-8 Hebrew | hebrew_general_ci | 1 || tis620 | TIS620 Thai | tis620_thai_ci | 1 || euckr | EUC-KR Korean | euckr_korean_ci | 2 || koi8u | KOI8-U Ukrainian | koi8u_general_ci | 1 || gb2312 | GB2312 Simplified Chinese | gb2312_chinese_ci | 2 || greek | ISO 8859-7 Greek | greek_general_ci | 1 || cp1250 | Windows Central European | cp1250_general_ci | 1 || gbk | GBK Simplified Chinese | gbk_chinese_ci | 2 || latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 || armscii8 | ARMSCII-8 Armenian | armscii8_general_ci | 1 || utf8 | UTF-8 Unicode | utf8_general_ci | 3 || ucs2 | UCS-2 Unicode | ucs2_general_ci | 2 || cp866 | DOS Russian | cp866_general_ci | 1 || keybcs2 | DOS Kamenicky Czech-Slovak | keybcs2_general_ci | 1 || macce | Mac Central European | macce_general_ci | 1 || macroman | Mac West European | macroman_general_ci | 1 || cp852 | DOS Central European | cp852_general_ci | 1 || latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 || utf8mb4 | UTF-8 Unicode | utf8mb4_general_ci | 4 || cp1251 | Windows Cyrillic | cp1251_general_ci | 1 || utf16 | UTF-16 Unicode | utf16_general_ci | 4 || cp1256 | Windows Arabic | cp1256_general_ci | 1 || cp1257 | Windows Baltic | cp1257_general_ci | 1 || utf32 | UTF-32 Unicode | utf32_general_ci | 4 || binary | Binary pseudo charset | binary | 1 || geostd8 | GEOSTD8 Georgian | geostd8_general_ci | 1 |

57

| cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2 || eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci | 3 |+----------+-----------------------------+---------------------+--------+39 rows in set (0.00 sec)

mysql> SHOW Character COLLATION;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLLATION' at line 1mysql> SHOW Character collation;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'collation' at line 1mysql> SHOW collation;+-----------------------+----------+-----+---------+----------+---------+| Collation | Charset | Id | Default | Compiled | Sortlen |+-----------------------+----------+-----+---------+----------+---------+| big5_chinese_ci | big5 | 1 | Yes | Yes | 1 || big5_bin | big5 | 84 | | Yes | 1 || dec8_swedish_ci | dec8 | 3 | Yes | Yes | 1 || dec8_bin | dec8 | 69 | | Yes | 1 || cp850_general_ci | cp850 | 4 | Yes | Yes | 1 || cp850_bin | cp850 | 80 | | Yes | 1 || hp8_english_ci | hp8 | 6 | Yes | Yes | 1 || hp8_bin | hp8 | 72 | | Yes | 1 || koi8r_general_ci | koi8r | 7 | Yes | Yes | 1 || koi8r_bin | koi8r | 74 | | Yes | 1 || latin1_german1_ci | latin1 | 5 | | Yes | 1 || latin1_swedish_ci | latin1 | 8 | Yes | Yes | 1 || latin1_danish_ci | latin1 | 15 | | Yes | 1 || latin1_german2_ci | latin1 | 31 | | Yes | 2 || latin1_bin | latin1 | 47 | | Yes | 1 || latin1_general_ci | latin1 | 48 | | Yes | 1 || latin1_general_cs | latin1 | 49 | | Yes | 1 || latin1_spanish_ci | latin1 | 94 | | Yes | 1 || latin2_czech_cs | latin2 | 2 | | Yes | 4 |

58

| latin2_general_ci | latin2 | 9 | Yes | Yes | 1 || latin2_hungarian_ci | latin2 | 21 | | Yes | 1 || latin2_croatian_ci | latin2 | 27 | | Yes | 1 || latin2_bin | latin2 | 77 | | Yes | 1 || swe7_swedish_ci | swe7 | 10 | Yes | Yes | 1 || swe7_bin | swe7 | 82 | | Yes | 1 || ascii_general_ci | ascii | 11 | Yes | Yes | 1 || ascii_bin | ascii | 65 | | Yes | 1 || ujis_japanese_ci | ujis | 12 | Yes | Yes | 1 || ujis_bin | ujis | 91 | | Yes | 1 || sjis_japanese_ci | sjis | 13 | Yes | Yes | 1 || sjis_bin | sjis | 88 | | Yes | 1 || hebrew_general_ci | hebrew | 16 | Yes | Yes | 1 || hebrew_bin | hebrew | 71 | | Yes | 1 || tis620_thai_ci | tis620 | 18 | Yes | Yes | 4 || tis620_bin | tis620 | 89 | | Yes | 1 || euckr_korean_ci | euckr | 19 | Yes | Yes | 1 || euckr_bin | euckr | 85 | | Yes | 1 || koi8u_general_ci | koi8u | 22 | Yes | Yes | 1 || koi8u_bin | koi8u | 75 | | Yes | 1 || gb2312_chinese_ci | gb2312 | 24 | Yes | Yes | 1 || gb2312_bin | gb2312 | 86 | | Yes | 1 || greek_general_ci | greek | 25 | Yes | Yes | 1 || greek_bin | greek | 70 | | Yes | 1 || cp1250_general_ci | cp1250 | 26 | Yes | Yes | 1 || cp1250_czech_cs | cp1250 | 34 | | Yes | 2 || cp1250_croatian_ci | cp1250 | 44 | | Yes | 1 || cp1250_bin | cp1250 | 66 | | Yes | 1 || cp1250_polish_ci | cp1250 | 99 | | Yes | 1 || gbk_chinese_ci | gbk | 28 | Yes | Yes | 1 || gbk_bin | gbk | 87 | | Yes | 1 || latin5_turkish_ci | latin5 | 30 | Yes | Yes | 1 || latin5_bin | latin5 | 78 | | Yes | 1 || armscii8_general_ci | armscii8 | 32 | Yes | Yes | 1 |

59

| armscii8_bin | armscii8 | 64 | | Yes | 1 || utf8_general_ci | utf8 | 33 | Yes | Yes | 1 || utf8_bin | utf8 | 83 | | Yes | 1 || utf8_unicode_ci | utf8 | 192 | | Yes | 8 || utf8_icelandic_ci | utf8 | 193 | | Yes | 8 || utf8_latvian_ci | utf8 | 194 | | Yes | 8 || utf8_romanian_ci | utf8 | 195 | | Yes | 8 || utf8_slovenian_ci | utf8 | 196 | | Yes | 8 || utf8_polish_ci | utf8 | 197 | | Yes | 8 || utf8_estonian_ci | utf8 | 198 | | Yes | 8 || utf8_spanish_ci | utf8 | 199 | | Yes | 8 || utf8_swedish_ci | utf8 | 200 | | Yes | 8 || utf8_turkish_ci | utf8 | 201 | | Yes | 8 || utf8_czech_ci | utf8 | 202 | | Yes | 8 || utf8_danish_ci | utf8 | 203 | | Yes | 8 || utf8_lithuanian_ci | utf8 | 204 | | Yes | 8 || utf8_slovak_ci | utf8 | 205 | | Yes | 8 || utf8_spanish2_ci | utf8 | 206 | | Yes | 8 || utf8_roman_ci | utf8 | 207 | | Yes | 8 || utf8_persian_ci | utf8 | 208 | | Yes | 8 || utf8_esperanto_ci | utf8 | 209 | | Yes | 8 || utf8_hungarian_ci | utf8 | 210 | | Yes | 8 || utf8_sinhala_ci | utf8 | 211 | | Yes | 8 || ucs2_general_ci | ucs2 | 35 | Yes | Yes | 1 || ucs2_bin | ucs2 | 90 | | Yes | 1 || ucs2_unicode_ci | ucs2 | 128 | | Yes | 8 || ucs2_icelandic_ci | ucs2 | 129 | | Yes | 8 || ucs2_latvian_ci | ucs2 | 130 | | Yes | 8 || ucs2_romanian_ci | ucs2 | 131 | | Yes | 8 || ucs2_slovenian_ci | ucs2 | 132 | | Yes | 8 || ucs2_polish_ci | ucs2 | 133 | | Yes | 8 || ucs2_estonian_ci | ucs2 | 134 | | Yes | 8 || ucs2_spanish_ci | ucs2 | 135 | | Yes | 8 || ucs2_swedish_ci | ucs2 | 136 | | Yes | 8 |

60

| ucs2_turkish_ci | ucs2 | 137 | | Yes | 8 || ucs2_czech_ci | ucs2 | 138 | | Yes | 8 || ucs2_danish_ci | ucs2 | 139 | | Yes | 8 || ucs2_lithuanian_ci | ucs2 | 140 | | Yes | 8 || ucs2_slovak_ci | ucs2 | 141 | | Yes | 8 || ucs2_spanish2_ci | ucs2 | 142 | | Yes | 8 || ucs2_roman_ci | ucs2 | 143 | | Yes | 8 || ucs2_persian_ci | ucs2 | 144 | | Yes | 8 || ucs2_esperanto_ci | ucs2 | 145 | | Yes | 8 || ucs2_hungarian_ci | ucs2 | 146 | | Yes | 8 || ucs2_sinhala_ci | ucs2 | 147 | | Yes | 8 || cp866_general_ci | cp866 | 36 | Yes | Yes | 1 || cp866_bin | cp866 | 68 | | Yes | 1 || keybcs2_general_ci | keybcs2 | 37 | Yes | Yes | 1 || keybcs2_bin | keybcs2 | 73 | | Yes | 1 || macce_general_ci | macce | 38 | Yes | Yes | 1 || macce_bin | macce | 43 | | Yes | 1 || macroman_general_ci | macroman | 39 | Yes | Yes | 1 || macroman_bin | macroman | 53 | | Yes | 1 || cp852_general_ci | cp852 | 40 | Yes | Yes | 1 || cp852_bin | cp852 | 81 | | Yes | 1 || latin7_estonian_cs | latin7 | 20 | | Yes | 1 || latin7_general_ci | latin7 | 41 | Yes | Yes | 1 || latin7_general_cs | latin7 | 42 | | Yes | 1 || latin7_bin | latin7 | 79 | | Yes | 1 || utf8mb4_general_ci | utf8mb4 | 45 | Yes | Yes | 1 || utf8mb4_bin | utf8mb4 | 46 | | Yes | 1 || utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 8 || utf8mb4_icelandic_ci | utf8mb4 | 225 | | Yes | 8 || utf8mb4_latvian_ci | utf8mb4 | 226 | | Yes | 8 || utf8mb4_romanian_ci | utf8mb4 | 227 | | Yes | 8 || utf8mb4_slovenian_ci | utf8mb4 | 228 | | Yes | 8 || utf8mb4_polish_ci | utf8mb4 | 229 | | Yes | 8 || utf8mb4_estonian_ci | utf8mb4 | 230 | | Yes | 8 |

61

| utf8mb4_spanish_ci | utf8mb4 | 231 | | Yes | 8 || utf8mb4_swedish_ci | utf8mb4 | 232 | | Yes | 8 || utf8mb4_turkish_ci | utf8mb4 | 233 | | Yes | 8 || utf8mb4_czech_ci | utf8mb4 | 234 | | Yes | 8 || utf8mb4_danish_ci | utf8mb4 | 235 | | Yes | 8 || utf8mb4_lithuanian_ci | utf8mb4 | 236 | | Yes | 8 || utf8mb4_slovak_ci | utf8mb4 | 237 | | Yes | 8 || utf8mb4_spanish2_ci | utf8mb4 | 238 | | Yes | 8 || utf8mb4_roman_ci | utf8mb4 | 239 | | Yes | 8 || utf8mb4_persian_ci | utf8mb4 | 240 | | Yes | 8 || utf8mb4_esperanto_ci | utf8mb4 | 241 | | Yes | 8 || utf8mb4_hungarian_ci | utf8mb4 | 242 | | Yes | 8 || utf8mb4_sinhala_ci | utf8mb4 | 243 | | Yes | 8 || cp1251_bulgarian_ci | cp1251 | 14 | | Yes | 1 || cp1251_ukrainian_ci | cp1251 | 23 | | Yes | 1 || cp1251_bin | cp1251 | 50 | | Yes | 1 || cp1251_general_ci | cp1251 | 51 | Yes | Yes | 1 || cp1251_general_cs | cp1251 | 52 | | Yes | 1 || utf16_general_ci | utf16 | 54 | Yes | Yes | 1 || utf16_bin | utf16 | 55 | | Yes | 1 || utf16_unicode_ci | utf16 | 101 | | Yes | 8 || utf16_icelandic_ci | utf16 | 102 | | Yes | 8 || utf16_latvian_ci | utf16 | 103 | | Yes | 8 || utf16_romanian_ci | utf16 | 104 | | Yes | 8 || utf16_slovenian_ci | utf16 | 105 | | Yes | 8 || utf16_polish_ci | utf16 | 106 | | Yes | 8 || utf16_estonian_ci | utf16 | 107 | | Yes | 8 || utf16_spanish_ci | utf16 | 108 | | Yes | 8 || utf16_swedish_ci | utf16 | 109 | | Yes | 8 || utf16_turkish_ci | utf16 | 110 | | Yes | 8 || utf16_czech_ci | utf16 | 111 | | Yes | 8 || utf16_danish_ci | utf16 | 112 | | Yes | 8 || utf16_lithuanian_ci | utf16 | 113 | | Yes | 8 || utf16_slovak_ci | utf16 | 114 | | Yes | 8 |

62

| utf16_spanish2_ci | utf16 | 115 | | Yes | 8 || utf16_roman_ci | utf16 | 116 | | Yes | 8 || utf16_persian_ci | utf16 | 117 | | Yes | 8 || utf16_esperanto_ci | utf16 | 118 | | Yes | 8 || utf16_hungarian_ci | utf16 | 119 | | Yes | 8 || utf16_sinhala_ci | utf16 | 120 | | Yes | 8 || cp1256_general_ci | cp1256 | 57 | Yes | Yes | 1 || cp1256_bin | cp1256 | 67 | | Yes | 1 || cp1257_lithuanian_ci | cp1257 | 29 | | Yes | 1 || cp1257_bin | cp1257 | 58 | | Yes | 1 || cp1257_general_ci | cp1257 | 59 | Yes | Yes | 1 || utf32_general_ci | utf32 | 60 | Yes | Yes | 1 || utf32_bin | utf32 | 61 | | Yes | 1 || utf32_unicode_ci | utf32 | 160 | | Yes | 8 || utf32_icelandic_ci | utf32 | 161 | | Yes | 8 || utf32_latvian_ci | utf32 | 162 | | Yes | 8 || utf32_romanian_ci | utf32 | 163 | | Yes | 8 || utf32_slovenian_ci | utf32 | 164 | | Yes | 8 || utf32_polish_ci | utf32 | 165 | | Yes | 8 || utf32_estonian_ci | utf32 | 166 | | Yes | 8 || utf32_spanish_ci | utf32 | 167 | | Yes | 8 || utf32_swedish_ci | utf32 | 168 | | Yes | 8 || utf32_turkish_ci | utf32 | 169 | | Yes | 8 || utf32_czech_ci | utf32 | 170 | | Yes | 8 || utf32_danish_ci | utf32 | 171 | | Yes | 8 || utf32_lithuanian_ci | utf32 | 172 | | Yes | 8 || utf32_slovak_ci | utf32 | 173 | | Yes | 8 || utf32_spanish2_ci | utf32 | 174 | | Yes | 8 || utf32_roman_ci | utf32 | 175 | | Yes | 8 || utf32_persian_ci | utf32 | 176 | | Yes | 8 || utf32_esperanto_ci | utf32 | 177 | | Yes | 8 || utf32_hungarian_ci | utf32 | 178 | | Yes | 8 || utf32_sinhala_ci | utf32 | 179 | | Yes | 8 || binary | binary | 63 | Yes | Yes | 1 |

63

| geostd8_general_ci | geostd8 | 92 | Yes | Yes | 1 || geostd8_bin | geostd8 | 93 | | Yes | 1 || cp932_japanese_ci | cp932 | 95 | Yes | Yes | 1 || cp932_bin | cp932 | 96 | | Yes | 1 || eucjpms_japanese_ci | eucjpms | 97 | Yes | Yes | 1 || eucjpms_bin | eucjpms | 98 | | Yes | 1 |+-----------------------+----------+-----+---------+----------+---------+195 rows in set (0.00 sec)

mysql> show full columns from customer;+-------------+----------------------+-----------------+------+-----+-------------------+-----------------------------+---------------------------------+---------+| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |+-------------+----------------------+-----------------+------+-----+-------------------+-----------------------------+---------------------------------+---------+| customer_id | smallint(5) unsigned | NULL | NO | PRI | NULL | auto_increment | select,insert,update,references | || store_id | tinyint(3) unsigned | NULL | NO | MUL | NULL | | select,insert,update,references | || first_name | varchar(45) | utf8_general_ci | NO | | NULL | | select,insert,update,references | || last_name | varchar(45) | utf8_general_ci | NO | MUL | NULL | | select,insert,update,references | || email | varchar(50) | utf8_general_ci | YES | | NULL | | select,insert,update,references | || address_id | smallint(5) unsigned | NULL | NO | MUL | NULL | | select,insert,update,references | || active | tinyint(1) | NULL | NO | | 1 | | select,insert,update,references | || create_date | datetime | NULL | NO | | NULL | | select,insert,update,references | || last_update | timestamp | NULL | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP | select,insert,update,references | |+-------------+----------------------+-----------------+------+-----+-------------------+-----------------------------+---------------------------------+---------+9 rows in set (0.00 sec)

mysql> show full columns from customer \G*************************** 1. row *************************** Field: customer_id Type: smallint(5) unsigned Collation: NULL Null: NO Key: PRI Default: NULL

64

Extra: auto_incrementPrivileges: select,insert,update,references Comment: *************************** 2. row *************************** Field: store_id Type: tinyint(3) unsigned Collation: NULL Null: NO Key: MUL Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 3. row *************************** Field: first_name Type: varchar(45) Collation: utf8_general_ci Null: NO Key: Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 4. row *************************** Field: last_name Type: varchar(45) Collation: utf8_general_ci Null: NO Key: MUL Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 5. row ***************************

65

Field: email Type: varchar(50) Collation: utf8_general_ci Null: YES Key: Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 6. row *************************** Field: address_id Type: smallint(5) unsigned Collation: NULL Null: NO Key: MUL Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 7. row *************************** Field: active Type: tinyint(1) Collation: NULL Null: NO Key: Default: 1 Extra: Privileges: select,insert,update,references Comment: *************************** 8. row *************************** Field: create_date Type: datetime Collation: NULL Null: NO

66

Key: Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 9. row *************************** Field: last_update Type: timestamp Collation: NULL Null: NO Key: Default: CURRENT_TIMESTAMP Extra: on update CURRENT_TIMESTAMPPrivileges: select,insert,update,references Comment: 9 rows in set (0.01 sec)

mysql> SHOW TABLES;+----------------------------+| Tables_in_sakila |+----------------------------+| actor || actor_info || address || books || category || city || country || country2 || country3 || customer || customer_list || film || film_actor |

67

| film_category || film_list || film_text || grade_summary || inventory || language || nicer_but_slower_film_list || orders23 || payment || rental || sales_by_film_category || sales_by_store || singers || singers2 || singers4 || staff || staff_list || store || stud || stud2 || studb || studb6 |+----------------------------+35 rows in set (0.53 sec)

mysql> mysql> SELECT TABLE_NAME,ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES;+----------------------------------------------+------------+| TABLE_NAME | ROW_FORMAT |+----------------------------------------------+------------+| CHARACTER_SETS | Fixed || COLLATIONS | Fixed || COLLATION_CHARACTER_SET_APPLICABILITY | Fixed || COLUMNS | Dynamic |

68

| COLUMN_PRIVILEGES | Fixed || ENGINES | Fixed || EVENTS | Dynamic || FILES | Fixed || GLOBAL_STATUS | Fixed || GLOBAL_VARIABLES | Fixed || KEY_COLUMN_USAGE | Fixed || PARAMETERS | Dynamic || PARTITIONS | Dynamic || PLUGINS | Dynamic || PROCESSLIST | Dynamic || PROFILING | Fixed || REFERENTIAL_CONSTRAINTS | Fixed || ROUTINES | Dynamic || SCHEMATA | Fixed || SCHEMA_PRIVILEGES | Fixed || SESSION_STATUS | Fixed || SESSION_VARIABLES | Fixed || STATISTICS | Fixed || TABLES | Fixed || TABLESPACES | Fixed || TABLE_CONSTRAINTS | Fixed || TABLE_PRIVILEGES | Fixed || TRIGGERS | Dynamic || USER_PRIVILEGES | Fixed || VIEWS | Dynamic || INNODB_CMP_RESET | Fixed || INNODB_TRX | Fixed || INNODB_CMPMEM_RESET | Fixed || INNODB_LOCK_WAITS | Fixed || INNODB_CMPMEM | Fixed || INNODB_CMP | Fixed || INNODB_LOCKS | Fixed || columns_priv | Fixed |

69

| db | Fixed || event | Dynamic || func | Fixed || general_log | Dynamic || help_category | Fixed || help_keyword | Fixed || help_relation | Fixed || help_topic | Dynamic || host | Fixed || ndb_binlog_index | Dynamic || plugin | Dynamic || proc | Dynamic || procs_priv | Fixed || proxies_priv | Fixed || servers | Fixed || slow_log | Dynamic || tables_priv | Fixed || time_zone | Fixed || time_zone_leap_second | Fixed || time_zone_name | Fixed || time_zone_transition | Fixed || time_zone_transition_type | Fixed || user | Dynamic || cond_instances | Dynamic || events_waits_current | Dynamic || events_waits_history | Dynamic || events_waits_history_long | Dynamic || events_waits_summary_by_instance | Dynamic || events_waits_summary_by_thread_by_event_name | Dynamic || events_waits_summary_global_by_event_name | Dynamic || file_instances | Dynamic || file_summary_by_event_name | Dynamic || file_summary_by_instance | Dynamic || mutex_instances | Dynamic |

70

| performance_timers | Fixed || rwlock_instances | Dynamic || setup_consumers | Dynamic || setup_instruments | Dynamic || setup_timers | Dynamic || threads | Dynamic || actor | Compact || actor_info | NULL || address | Compact || books | Compact || category | Compact || city | Compact || country | Compact || country2 | Compact || country3 | Compact || customer | Compact || customer_list | NULL || film | Compact || film_actor | Compact || film_category | Compact || film_list | NULL || film_text | Dynamic || grade_summary | Compact || inventory | Compact || language | Compact || nicer_but_slower_film_list | NULL || orders23 | Compact || payment | Compact || rental | Compact || sales_by_film_category | NULL || sales_by_store | NULL || singers | Compact || singers2 | Compact || singers4 | Compact |

71

| staff | Compact || staff_list | NULL || store | Compact || stud | Compact || stud2 | Compact || studb | Fixed || studb6 | Fixed |+----------------------------------------------+------------+113 rows in set (0.91 sec)

mysql> SELECT * FROM INFORMATION_SCHEMA.TABLES \G*************************** 1. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: CHARACTER_SETS TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 384 DATA_LENGTH: 0MAX_DATA_LENGTH: 16434816 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=43690 TABLE_COMMENT:

72

*************************** 2. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: COLLATIONS TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 231 DATA_LENGTH: 0MAX_DATA_LENGTH: 16704765 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=72628 TABLE_COMMENT: *************************** 3. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: COLLATION_CHARACTER_SET_APPLICABILITY TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 195 DATA_LENGTH: 0MAX_DATA_LENGTH: 16357770

73

INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=86037 TABLE_COMMENT: *************************** 4. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: COLUMNS TABLE_TYPE: SYSTEM VIEW ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: NULL AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-23 06:38:30 UPDATE_TIME: 2013-02-23 06:38:30 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=6130 TABLE_COMMENT: *************************** 5. row *************************** TABLE_CATALOG: def

74

TABLE_SCHEMA: information_schema TABLE_NAME: COLUMN_PRIVILEGES TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 2565 DATA_LENGTH: 0MAX_DATA_LENGTH: 16757145 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=6540 TABLE_COMMENT: *************************** 6. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: ENGINES TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 490 DATA_LENGTH: 0MAX_DATA_LENGTH: 16574250 INDEX_LENGTH: 0 DATA_FREE: 0

75

AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=34239 TABLE_COMMENT: *************************** 7. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: EVENTS TABLE_TYPE: SYSTEM VIEW ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: NULL AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-23 06:38:30 UPDATE_TIME: 2013-02-23 06:38:30 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=1353 TABLE_COMMENT: *************************** 8. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: FILES

76

TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 2677 DATA_LENGTH: 0MAX_DATA_LENGTH: 16758020 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=6267 TABLE_COMMENT: *************************** 9. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: GLOBAL_STATUS TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 3268 DATA_LENGTH: 0MAX_DATA_LENGTH: 16755036 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL

77

UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=5133 TABLE_COMMENT: *************************** 10. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: GLOBAL_VARIABLES TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 3268 DATA_LENGTH: 0MAX_DATA_LENGTH: 16755036 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=5133 TABLE_COMMENT: *************************** 11. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: KEY_COLUMN_USAGE TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY

78

VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 4637 DATA_LENGTH: 0MAX_DATA_LENGTH: 16762755 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=3618 TABLE_COMMENT: *************************** 12. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: PARAMETERS TABLE_TYPE: SYSTEM VIEW ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: NULL AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-23 06:38:30 UPDATE_TIME: 2013-02-23 06:38:30 CHECK_TIME: NULL

79

TABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=13234 TABLE_COMMENT: *************************** 13. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: PARTITIONS TABLE_TYPE: SYSTEM VIEW ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: NULL AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-23 06:38:30 UPDATE_TIME: 2013-02-23 06:38:30 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=12204 TABLE_COMMENT: *************************** 14. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: PLUGINS TABLE_TYPE: SYSTEM VIEW ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic

80

TABLE_ROWS: NULL AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-23 06:38:30 UPDATE_TIME: 2013-02-23 06:38:30 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=24780 TABLE_COMMENT: *************************** 15. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: PROCESSLIST TABLE_TYPE: SYSTEM VIEW ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: NULL AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-23 06:38:30 UPDATE_TIME: 2013-02-23 06:38:30 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL

81

CREATE_OPTIONS: max_rows=52279 TABLE_COMMENT: *************************** 16. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: PROFILING TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 308 DATA_LENGTH: 0MAX_DATA_LENGTH: 16562084 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=54471 TABLE_COMMENT: *************************** 17. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: REFERENTIAL_CONSTRAINTS TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 4814

82

DATA_LENGTH: 0MAX_DATA_LENGTH: 16767162 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=3485 TABLE_COMMENT: *************************** 18. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: ROUTINES TABLE_TYPE: SYSTEM VIEW ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: NULL AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-23 06:38:30 UPDATE_TIME: 2013-02-23 06:38:30 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=1276 TABLE_COMMENT:

83

*************************** 19. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: SCHEMATA TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 3464 DATA_LENGTH: 0MAX_DATA_LENGTH: 16738048 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=4843 TABLE_COMMENT: *************************** 20. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: SCHEMA_PRIVILEGES TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 2179 DATA_LENGTH: 0MAX_DATA_LENGTH: 16736899

84

INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=7699 TABLE_COMMENT: *************************** 21. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: SESSION_STATUS TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 3268 DATA_LENGTH: 0MAX_DATA_LENGTH: 16755036 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=5133 TABLE_COMMENT: *************************** 22. row *************************** TABLE_CATALOG: def

85

TABLE_SCHEMA: information_schema TABLE_NAME: SESSION_VARIABLES TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 3268 DATA_LENGTH: 0MAX_DATA_LENGTH: 16755036 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=5133 TABLE_COMMENT: *************************** 23. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: STATISTICS TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 5753 DATA_LENGTH: 0MAX_DATA_LENGTH: 16752736 INDEX_LENGTH: 0 DATA_FREE: 0

86

AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=2916 TABLE_COMMENT: *************************** 24. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: TABLES TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 9450 DATA_LENGTH: 0MAX_DATA_LENGTH: 16764300 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=1775 TABLE_COMMENT: *************************** 25. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: TABLESPACES

87

TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 6951 DATA_LENGTH: 0MAX_DATA_LENGTH: 16772763 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=2413 TABLE_COMMENT: *************************** 26. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: TABLE_CONSTRAINTS TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 2504 DATA_LENGTH: 0MAX_DATA_LENGTH: 16721712 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL

88

UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=6700 TABLE_COMMENT: *************************** 27. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: TABLE_PRIVILEGES TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 2372 DATA_LENGTH: 0MAX_DATA_LENGTH: 16748692 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=7073 TABLE_COMMENT: *************************** 28. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: TRIGGERS TABLE_TYPE: SYSTEM VIEW ENGINE: MyISAM

89

VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: NULL AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-23 06:38:30 UPDATE_TIME: 2013-02-23 06:38:30 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=1245 TABLE_COMMENT: *************************** 29. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: USER_PRIVILEGES TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 1986 DATA_LENGTH: 0MAX_DATA_LENGTH: 16726092 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULL

90

TABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=8447 TABLE_COMMENT: *************************** 30. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: VIEWS TABLE_TYPE: SYSTEM VIEW ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: NULL AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-23 06:38:30 UPDATE_TIME: 2013-02-23 06:38:30 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=15171 TABLE_COMMENT: *************************** 31. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: INNODB_CMP_RESET TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed

91

TABLE_ROWS: NULL AVG_ROW_LENGTH: 25 DATA_LENGTH: 0MAX_DATA_LENGTH: 13107200 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=671088 TABLE_COMMENT: *************************** 32. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: INNODB_TRX TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 4534 DATA_LENGTH: 0MAX_DATA_LENGTH: 16766732 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL

92

CREATE_OPTIONS: max_rows=3700 TABLE_COMMENT: *************************** 33. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: INNODB_CMPMEM_RESET TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 29 DATA_LENGTH: 0MAX_DATA_LENGTH: 15204352 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=578524 TABLE_COMMENT: *************************** 34. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: INNODB_LOCK_WAITS TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 599

93

DATA_LENGTH: 0MAX_DATA_LENGTH: 16749238 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=28008 TABLE_COMMENT: *************************** 35. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: INNODB_CMPMEM TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 29 DATA_LENGTH: 0MAX_DATA_LENGTH: 15204352 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=578524 TABLE_COMMENT:

94

*************************** 36. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: INNODB_CMP TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 25 DATA_LENGTH: 0MAX_DATA_LENGTH: 13107200 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=671088 TABLE_COMMENT: *************************** 37. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: information_schema TABLE_NAME: INNODB_LOCKS TABLE_TYPE: SYSTEM VIEW ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: NULL AVG_ROW_LENGTH: 31244 DATA_LENGTH: 0MAX_DATA_LENGTH: 16746784

95

INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: max_rows=536 TABLE_COMMENT: *************************** 38. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: columns_priv TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 227994731135631359 INDEX_LENGTH: 4096 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_bin CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Column privileges*************************** 39. row *************************** TABLE_CATALOG: def

96

TABLE_SCHEMA: mysql TABLE_NAME: db TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 880MAX_DATA_LENGTH: 123848989752688639 INDEX_LENGTH: 5120 DATA_FREE: 880 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36 UPDATE_TIME: 2013-01-14 07:41:32 CHECK_TIME: 2011-03-31 09:53:38TABLE_COLLATION: utf8_bin CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Database privileges*************************** 40. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: event TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 2048 DATA_FREE: 0

97

AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:37 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Events*************************** 41. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: func TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 162974011515469823 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_bin CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: User defined functions*************************** 42. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: general_log

98

TABLE_TYPE: BASE TABLE ENGINE: CSV VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 2 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: General log*************************** 43. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: help_category TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 38 AVG_ROW_LENGTH: 581 DATA_LENGTH: 22078MAX_DATA_LENGTH: 163536961468891135 INDEX_LENGTH: 3072 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36

99

UPDATE_TIME: 2011-03-31 17:53:40 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: help categories*************************** 44. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: help_keyword TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 453 AVG_ROW_LENGTH: 197 DATA_LENGTH: 89241MAX_DATA_LENGTH: 55450570411999231 INDEX_LENGTH: 16384 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36 UPDATE_TIME: 2011-03-31 17:53:40 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: help keywords*************************** 45. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: help_relation TABLE_TYPE: BASE TABLE ENGINE: MyISAM

100

VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 992 AVG_ROW_LENGTH: 9 DATA_LENGTH: 8928MAX_DATA_LENGTH: 2533274790395903 INDEX_LENGTH: 18432 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36 UPDATE_TIME: 2011-03-31 17:53:40 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: keyword-topic relation*************************** 46. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: help_topic TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 505 AVG_ROW_LENGTH: 832 DATA_LENGTH: 420296MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 20480 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36 UPDATE_TIME: 2011-03-31 17:53:40 CHECK_TIME: NULL

101

TABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: help topics*************************** 47. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: host TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 110056715893866495 INDEX_LENGTH: 2048 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_bin CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Host privileges; Merged with database privileges*************************** 48. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: ndb_binlog_index TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic

102

TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:37 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 49. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: plugin TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL

103

CREATE_OPTIONS: TABLE_COMMENT: MySQL plugins*************************** 50. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: proc TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 6 AVG_ROW_LENGTH: 1725 DATA_LENGTH: 10352MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 4096 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:37 UPDATE_TIME: 2013-01-27 01:28:55 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Stored Procedures*************************** 51. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: procs_priv TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0

104

DATA_LENGTH: 0MAX_DATA_LENGTH: 239253730204057599 INDEX_LENGTH: 4096 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:37 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_bin CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Procedure privileges*************************** 52. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: proxies_priv TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 1 AVG_ROW_LENGTH: 693 DATA_LENGTH: 693MAX_DATA_LENGTH: 195062158860484607 INDEX_LENGTH: 5120 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:38 UPDATE_TIME: 2011-03-31 17:53:40 CHECK_TIME: 2011-03-31 09:53:38TABLE_COLLATION: utf8_bin CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: User proxy privileges

105

*************************** 53. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: servers TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 433752939111120895 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: MySQL Foreign Servers table*************************** 54. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: slow_log TABLE_TYPE: BASE TABLE ENGINE: CSV VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 2 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0

106

INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Slow log*************************** 55. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: tables_priv TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 239535205180768255 INDEX_LENGTH: 4096 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_bin CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Table privileges*************************** 56. row *************************** TABLE_CATALOG: def

107

TABLE_SCHEMA: mysql TABLE_NAME: time_zone TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 1970324836974591 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: 1 CREATE_TIME: 2011-03-31 09:53:37 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Time zones*************************** 57. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: time_zone_leap_second TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 3659174697238527 INDEX_LENGTH: 1024 DATA_FREE: 0

108

AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:37 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Leap seconds information for time zones*************************** 58. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: time_zone_name TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 55450570411999231 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:37 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Time zone names*************************** 59. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: time_zone_transition

109

TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 4785074604081151 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:37 UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Time zone transitions*************************** 60. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: time_zone_transition_type TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 10696049115004927 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:37

110

UPDATE_TIME: 2011-03-31 17:53:38 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Time zone transition types*************************** 61. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: mysql TABLE_NAME: user TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1 AVG_ROW_LENGTH: 108 DATA_LENGTH: 368MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 2048 DATA_FREE: 260 AUTO_INCREMENT: NULL CREATE_TIME: 2011-03-31 09:53:36 UPDATE_TIME: 2013-01-14 07:11:49 CHECK_TIME: NULLTABLE_COLLATION: utf8_bin CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: Users and global privileges*************************** 62. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: cond_instances TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA

111

VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 63. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: events_waits_current TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULL

112

TABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 64. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: events_waits_history TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 65. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: events_waits_history_long TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic

113

TABLE_ROWS: 10000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 66. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: events_waits_summary_by_instance TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL

114

CREATE_OPTIONS: TABLE_COMMENT: *************************** 67. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: events_waits_summary_by_thread_by_event_name TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 68. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: events_waits_summary_global_by_event_name TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0

115

DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 69. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: file_instances TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT:

116

*************************** 70. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: file_summary_by_event_name TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 71. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: file_summary_by_instance TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0

117

INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 72. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: mutex_instances TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 73. row *************************** TABLE_CATALOG: def

118

TABLE_SCHEMA: performance_schema TABLE_NAME: performance_timers TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 5 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 74. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: rwlock_instances TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0

119

AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 75. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: setup_consumers TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 8 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 76. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: setup_instruments

120

TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 77. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: setup_timers TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL

121

UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 78. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: performance_schema TABLE_NAME: threads TABLE_TYPE: BASE TABLE ENGINE: PERFORMANCE_SCHEMA VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 79. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: actor TABLE_TYPE: BASE TABLE ENGINE: InnoDB

122

VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 200 AVG_ROW_LENGTH: 81 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 16384 DATA_FREE: 9437184 AUTO_INCREMENT: 201 CREATE_TIME: 2013-01-27 01:23:51 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 80. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: actor_info TABLE_TYPE: VIEW ENGINE: NULL VERSION: NULL ROW_FORMAT: NULL TABLE_ROWS: NULL AVG_ROW_LENGTH: NULL DATA_LENGTH: NULLMAX_DATA_LENGTH: NULL INDEX_LENGTH: NULL DATA_FREE: NULL AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULL

123

TABLE_COLLATION: NULL CHECKSUM: NULL CREATE_OPTIONS: NULL TABLE_COMMENT: VIEW*************************** 81. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: address TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 585 AVG_ROW_LENGTH: 140 DATA_LENGTH: 81920MAX_DATA_LENGTH: 0 INDEX_LENGTH: 16384 DATA_FREE: 9437184 AUTO_INCREMENT: 606 CREATE_TIME: 2013-01-27 01:23:51 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 82. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: books TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact

124

TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-20 13:27:25 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 83. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: category TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 16 AVG_ROW_LENGTH: 1024 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: 17 CREATE_TIME: 2013-01-27 01:23:51 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL

125

CREATE_OPTIONS: TABLE_COMMENT: *************************** 84. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: city TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 775 AVG_ROW_LENGTH: 63 DATA_LENGTH: 49152MAX_DATA_LENGTH: 0 INDEX_LENGTH: 16384 DATA_FREE: 9437184 AUTO_INCREMENT: 601 CREATE_TIME: 2013-01-27 01:23:51 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 85. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: country TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 109 AVG_ROW_LENGTH: 150

126

DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: 110 CREATE_TIME: 2013-01-27 01:23:52 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 86. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: country2 TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 109 AVG_ROW_LENGTH: 150 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-20 08:41:24 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT:

127

*************************** 87. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: country3 TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: 1 CREATE_TIME: 2013-02-20 08:41:42 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 88. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: customer TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 505 AVG_ROW_LENGTH: 162 DATA_LENGTH: 81920MAX_DATA_LENGTH: 0

128

INDEX_LENGTH: 49152 DATA_FREE: 9437184 AUTO_INCREMENT: 600 CREATE_TIME: 2013-01-27 01:23:52 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 89. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: customer_list TABLE_TYPE: VIEW ENGINE: NULL VERSION: NULL ROW_FORMAT: NULL TABLE_ROWS: NULL AVG_ROW_LENGTH: NULL DATA_LENGTH: NULLMAX_DATA_LENGTH: NULL INDEX_LENGTH: NULL DATA_FREE: NULL AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: NULL CHECKSUM: NULL CREATE_OPTIONS: NULL TABLE_COMMENT: VIEW*************************** 90. row *************************** TABLE_CATALOG: def

129

TABLE_SCHEMA: sakila TABLE_NAME: film TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 1131 AVG_ROW_LENGTH: 173 DATA_LENGTH: 196608MAX_DATA_LENGTH: 0 INDEX_LENGTH: 81920 DATA_FREE: 9437184 AUTO_INCREMENT: 1001 CREATE_TIME: 2013-01-27 01:23:52 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 91. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: film_actor TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 5920 AVG_ROW_LENGTH: 33 DATA_LENGTH: 196608MAX_DATA_LENGTH: 0 INDEX_LENGTH: 81920 DATA_FREE: 9437184

130

AUTO_INCREMENT: NULL CREATE_TIME: 2013-01-27 01:23:52 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 92. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: film_category TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 1343 AVG_ROW_LENGTH: 48 DATA_LENGTH: 65536MAX_DATA_LENGTH: 0 INDEX_LENGTH: 16384 DATA_FREE: 9437184 AUTO_INCREMENT: NULL CREATE_TIME: 2013-01-27 01:23:52 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 93. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: film_list

131

TABLE_TYPE: VIEW ENGINE: NULL VERSION: NULL ROW_FORMAT: NULL TABLE_ROWS: NULL AVG_ROW_LENGTH: NULL DATA_LENGTH: NULLMAX_DATA_LENGTH: NULL INDEX_LENGTH: NULL DATA_FREE: NULL AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: NULL CHECKSUM: NULL CREATE_OPTIONS: NULL TABLE_COMMENT: VIEW*************************** 94. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: film_text TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Dynamic TABLE_ROWS: 1000 AVG_ROW_LENGTH: 119 DATA_LENGTH: 119616MAX_DATA_LENGTH: 281474976710655 INDEX_LENGTH: 205824 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-01-27 01:23:52

132

UPDATE_TIME: 2013-01-27 01:25:36 CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 95. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: grade_summary TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 5 AVG_ROW_LENGTH: 3276 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-18 22:08:02 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 96. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: inventory TABLE_TYPE: BASE TABLE ENGINE: InnoDB

133

VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 2881 AVG_ROW_LENGTH: 62 DATA_LENGTH: 180224MAX_DATA_LENGTH: 0 INDEX_LENGTH: 196608 DATA_FREE: 9437184 AUTO_INCREMENT: 4582 CREATE_TIME: 2013-01-27 01:23:53 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 97. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: language TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 6 AVG_ROW_LENGTH: 2730 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: 7 CREATE_TIME: 2013-01-27 01:23:53 UPDATE_TIME: NULL CHECK_TIME: NULL

134

TABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 98. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: nicer_but_slower_film_list TABLE_TYPE: VIEW ENGINE: NULL VERSION: NULL ROW_FORMAT: NULL TABLE_ROWS: NULL AVG_ROW_LENGTH: NULL DATA_LENGTH: NULLMAX_DATA_LENGTH: NULL INDEX_LENGTH: NULL DATA_FREE: NULL AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: NULL CHECKSUM: NULL CREATE_OPTIONS: NULL TABLE_COMMENT: VIEW*************************** 99. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: orders23 TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact

135

TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-19 00:40:29 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 100. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: payment TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 16451 AVG_ROW_LENGTH: 96 DATA_LENGTH: 1589248MAX_DATA_LENGTH: 0 INDEX_LENGTH: 638976 DATA_FREE: 9437184 AUTO_INCREMENT: 16050 CREATE_TIME: 2013-01-27 01:23:53 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL

136

CREATE_OPTIONS: TABLE_COMMENT: *************************** 101. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: rental TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 16285 AVG_ROW_LENGTH: 97 DATA_LENGTH: 1589248MAX_DATA_LENGTH: 0 INDEX_LENGTH: 1261568 DATA_FREE: 9437184 AUTO_INCREMENT: 16050 CREATE_TIME: 2013-01-27 01:23:54 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 102. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: sales_by_film_category TABLE_TYPE: VIEW ENGINE: NULL VERSION: NULL ROW_FORMAT: NULL TABLE_ROWS: NULL AVG_ROW_LENGTH: NULL

137

DATA_LENGTH: NULLMAX_DATA_LENGTH: NULL INDEX_LENGTH: NULL DATA_FREE: NULL AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: NULL CHECKSUM: NULL CREATE_OPTIONS: NULL TABLE_COMMENT: VIEW*************************** 103. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: sales_by_store TABLE_TYPE: VIEW ENGINE: NULL VERSION: NULL ROW_FORMAT: NULL TABLE_ROWS: NULL AVG_ROW_LENGTH: NULL DATA_LENGTH: NULLMAX_DATA_LENGTH: NULL INDEX_LENGTH: NULL DATA_FREE: NULL AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: NULL CHECKSUM: NULL CREATE_OPTIONS: NULL TABLE_COMMENT: VIEW

138

*************************** 104. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: singers TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 1 AVG_ROW_LENGTH: 16384 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-18 23:57:56 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 105. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: singers2 TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 1 AVG_ROW_LENGTH: 16384 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0

139

INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-19 00:20:00 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 106. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: singers4 TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 3 AVG_ROW_LENGTH: 5461 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-19 00:26:07 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 107. row *************************** TABLE_CATALOG: def

140

TABLE_SCHEMA: sakila TABLE_NAME: staff TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 1 AVG_ROW_LENGTH: 81920 DATA_LENGTH: 81920MAX_DATA_LENGTH: 0 INDEX_LENGTH: 32768 DATA_FREE: 9437184 AUTO_INCREMENT: 3 CREATE_TIME: 2013-01-27 01:23:55 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 108. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: staff_list TABLE_TYPE: VIEW ENGINE: NULL VERSION: NULL ROW_FORMAT: NULL TABLE_ROWS: NULL AVG_ROW_LENGTH: NULL DATA_LENGTH: NULLMAX_DATA_LENGTH: NULL INDEX_LENGTH: NULL DATA_FREE: NULL

141

AUTO_INCREMENT: NULL CREATE_TIME: NULL UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: NULL CHECKSUM: NULL CREATE_OPTIONS: NULL TABLE_COMMENT: VIEW*************************** 109. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: store TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 2 AVG_ROW_LENGTH: 8192 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 32768 DATA_FREE: 9437184 AUTO_INCREMENT: 3 CREATE_TIME: 2013-01-27 01:23:55 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 110. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: stud

142

TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-18 22:59:25 UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 111. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: stud2 TABLE_TYPE: BASE TABLE ENGINE: InnoDB VERSION: 10 ROW_FORMAT: Compact TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 16384MAX_DATA_LENGTH: 0 INDEX_LENGTH: 0 DATA_FREE: 9437184 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-18 22:59:04

143

UPDATE_TIME: NULL CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 112. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: studb TABLE_TYPE: BASE TABLE ENGINE: MyISAM VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 1970324836974591 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-20 08:59:26 UPDATE_TIME: 2013-02-20 08:59:26 CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: *************************** 113. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: studb6 TABLE_TYPE: BASE TABLE ENGINE: MyISAM

144

VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 0 AVG_ROW_LENGTH: 0 DATA_LENGTH: 0MAX_DATA_LENGTH: 1970324836974591 INDEX_LENGTH: 1024 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2013-02-20 09:09:46 UPDATE_TIME: 2013-02-20 09:09:46 CHECK_TIME: NULLTABLE_COLLATION: latin1_swedish_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: 113 rows in set (0.12 sec)

mysql> SELECT TABLE_NAME, TABLE_ROWS, TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME= 'COUNTRY';+------------+------------+-----------------+| TABLE_NAME | TABLE_ROWS | TABLE_COLLATION |+------------+------------+-----------------+| country | 109 | utf8_general_ci |+------------+------------+-----------------+1 row in set (0.14 sec)

mysql> SELECT TABLE_NAME, TABLE_ROWS, TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME= 'PAYMENT';+------------+------------+-----------------+| TABLE_NAME | TABLE_ROWS | TABLE_COLLATION |+------------+------------+-----------------+| payment | 16451 | utf8_general_ci |+------------+------------+-----------------+1 row in set (0.16 sec)

145

mysql> SELECT TABLE_NAME, TABLE_ROWS, TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA ='SAKILA';+----------------------------+------------+-------------------+| TABLE_NAME | TABLE_ROWS | TABLE_COLLATION |+----------------------------+------------+-------------------+| actor | 200 | utf8_general_ci || actor_info | NULL | NULL || address | 628 | utf8_general_ci || books | 0 | latin1_swedish_ci || category | 16 | utf8_general_ci || city | 427 | utf8_general_ci || country | 109 | utf8_general_ci || country2 | 109 | latin1_swedish_ci || country3 | 0 | utf8_general_ci || customer | 646 | utf8_general_ci || customer_list | NULL | NULL || film | 1025 | utf8_general_ci || film_actor | 3589 | utf8_general_ci || film_category | 1423 | utf8_general_ci || film_list | NULL | NULL || film_text | 1000 | utf8_general_ci || grade_summary | 5 | latin1_swedish_ci || inventory | 3672 | utf8_general_ci || language | 6 | utf8_general_ci || nicer_but_slower_film_list | NULL | NULL || orders23 | 0 | latin1_swedish_ci || payment | 15422 | utf8_general_ci || rental | 15602 | utf8_general_ci || sales_by_film_category | NULL | NULL || sales_by_store | NULL | NULL || singers | 1 | latin1_swedish_ci || singers2 | 1 | latin1_swedish_ci || singers4 | 3 | latin1_swedish_ci || staff | 1 | utf8_general_ci || staff_list | NULL | NULL |

146

| store | 2 | utf8_general_ci || stud | 0 | latin1_swedish_ci || stud2 | 0 | latin1_swedish_ci || studb | 0 | latin1_swedish_ci || studb6 | 0 | latin1_swedish_ci |+----------------------------+------------+-------------------+35 rows in set (0.94 sec)

mysql> show create table customer;+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| Table | Create Table |+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| customer | CREATE TABLE `customer` ( `customer_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `store_id` tinyint(3) unsigned NOT NULL, `first_name` varchar(45) NOT NULL, `last_name` varchar(45) NOT NULL, `email` varchar(50) DEFAULT NULL, `address_id` smallint(5) unsigned NOT NULL, `active` tinyint(1) NOT NULL DEFAULT '1',

147

`create_date` datetime NOT NULL, `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`customer_id`), KEY `idx_fk_store_id` (`store_id`), KEY `idx_fk_address_id` (`address_id`), KEY `idx_last_name` (`last_name`), CONSTRAINT `fk_customer_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE, CONSTRAINT `fk_customer_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE) ENGINE=InnoDB AUTO_INCREMENT=600 DEFAULT CHARSET=utf8 |+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+1 row in set (0.35 sec)

mysql> show create table address;+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| Table | Create Table |+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| address | CREATE TABLE `address` ( `address_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `address` varchar(50) NOT NULL, `address2` varchar(50) DEFAULT NULL,

148

`district` varchar(20) NOT NULL, `city_id` smallint(5) unsigned NOT NULL, `postal_code` varchar(10) DEFAULT NULL, `phone` varchar(20) NOT NULL, `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`address_id`), KEY `idx_fk_city_id` (`city_id`), CONSTRAINT `fk_address_city` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ON UPDATE CASCADE) ENGINE=InnoDB AUTO_INCREMENT=606 DEFAULT CHARSET=utf8 |+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+1 row in set (0.00 sec)

mysql> show create table city;+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| Table | Create Table |+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| city | CREATE TABLE `city` ( `city_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `city` varchar(50) NOT NULL, `country_id` smallint(5) unsigned NOT NULL, `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`city_id`), KEY `idx_fk_country_id` (`country_id`),

149

CONSTRAINT `fk_city_country` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ON UPDATE CASCADE) ENGINE=InnoDB AUTO_INCREMENT=601 DEFAULT CHARSET=utf8 |+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+1 row in set (0.00 sec)

mysql> show table status;+----------------------------+--------+---------+------------+-------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+------------+-------------------+----------+----------------+---------+| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |+----------------------------+--------+---------+------------+-------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+------------+-------------------+----------+----------------+---------+| actor | InnoDB | 10 | Compact | 200 | 81 | 16384 | 0 | 16384 | 9437184 | 201 | 2013-01-27 01:23:51 | NULL | NULL | utf8_general_ci | NULL | | || actor_info | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | VIEW || address | InnoDB | 10 | Compact | 549 | 149 | 81920 | 0 | 16384 | 9437184 | 606 | 2013-01-27 01:23:51 | NULL | NULL | utf8_general_ci | NULL | | || books | InnoDB | 10 | Compact | 0 | 0 | 16384 | 0 | 0 | 9437184 | NULL | 2013-02-20 13:27:25 | NULL | NULL | latin1_swedish_ci | NULL | | || category | InnoDB | 10 | Compact | 16 | 1024 | 16384 | 0 | 0 | 9437184 | 17 | 2013-01-27 01:23:51 | NULL | NULL | utf8_general_ci | NULL | | || city | InnoDB | 10 | Compact | 427 | 115 | 49152 | 0 | 16384 | 9437184 | 601 | 2013-01-27 01:23:51 | NULL | NULL | utf8_general_ci | NULL | | || country | InnoDB | 10 | Compact | 109 | 150 | 16384 | 0 | 0 | 9437184 | 110 | 2013-01-27 01:23:52 | NULL | NULL | utf8_general_ci | NULL | | || country2 | InnoDB | 10 | Compact | 109 | 150 | 16384 | 0 | 0 | 9437184 | NULL | 2013-02-20 08:41:24 | NULL | NULL | latin1_swedish_ci | NULL | | || country3 | InnoDB | 10 | Compact | 0 | 0 | 16384 | 0 | 0 | 9437184 | 1 | 2013-02-20 08:41:42 | NULL | NULL | utf8_general_ci | NULL | | |

150

| customer | InnoDB | 10 | Compact | 671 | 122 | 81920 | 0 | 49152 | 9437184 | 600 | 2013-01-27 01:23:52 | NULL | NULL | utf8_general_ci | NULL | | || customer_list | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | VIEW || film | InnoDB | 10 | Compact | 1054 | 186 | 196608 | 0 | 81920 | 9437184 | 1001 | 2013-01-27 01:23:52 | NULL | NULL | utf8_general_ci | NULL | | || film_actor | InnoDB | 10 | Compact | 5143 | 38 | 196608 | 0 | 81920 | 9437184 | NULL | 2013-01-27 01:23:52 | NULL | NULL | utf8_general_ci | NULL | | || film_category | InnoDB | 10 | Compact | 460 | 142 | 65536 | 0 | 16384 | 9437184 | NULL | 2013-01-27 01:23:52 | NULL | NULL | utf8_general_ci | NULL | | || film_list | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | VIEW || film_text | MyISAM | 10 | Dynamic | 1000 | 119 | 119616 | 281474976710655 | 205824 | 0 | NULL | 2013-01-27 01:23:52 | 2013-01-27 01:25:36 | NULL | utf8_general_ci | NULL | | || grade_summary | InnoDB | 10 | Compact | 5 | 3276 | 16384 | 0 | 0 | 9437184 | NULL | 2013-02-18 22:08:02 | NULL | NULL | latin1_swedish_ci | NULL | | || inventory | InnoDB | 10 | Compact | 5007 | 35 | 180224 | 0 | 196608 | 9437184 | 4582 | 2013-01-27 01:23:53 | NULL | NULL | utf8_general_ci | NULL | | || language | InnoDB | 10 | Compact | 6 | 2730 | 16384 | 0 | 0 | 9437184 | 7 | 2013-01-27 01:23:53 | NULL | NULL | utf8_general_ci | NULL | | || nicer_but_slower_film_list | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | VIEW || orders23 | InnoDB | 10 | Compact | 0 | 0 | 16384 | 0 | 0 | 9437184 | NULL | 2013-02-19 00:40:29 | NULL | NULL | latin1_swedish_ci | NULL | | || payment | InnoDB | 10 | Compact | 15123 | 105 | 1589248 | 0 | 638976 | 9437184 | 16050 | 2013-01-27 01:23:53 | NULL | NULL | utf8_general_ci | NULL | | || rental | InnoDB | 10 | Compact | 16291 | 97 | 1589248 | 0 | 1261568 | 9437184 | 16050 | 2013-01-27 01:23:54 | NULL | NULL | utf8_general_ci | NULL | | || sales_by_film_category | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | VIEW || sales_by_store | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | VIEW || singers | InnoDB | 10 | Compact | 1 | 16384 | 16384 | 0 | 0 | 9437184 | NULL | 2013-02-18 23:57:56 | NULL | NULL | latin1_swedish_ci | NULL | | |

151

| singers2 | InnoDB | 10 | Compact | 1 | 16384 | 16384 | 0 | 0 | 9437184 | NULL | 2013-02-19 00:20:00 | NULL | NULL | latin1_swedish_ci | NULL | | || singers4 | InnoDB | 10 | Compact | 3 | 5461 | 16384 | 0 | 0 | 9437184 | NULL | 2013-02-19 00:26:07 | NULL | NULL | latin1_swedish_ci | NULL | | || so | InnoDB | 10 | Compact | 0 | 0 | 16384 | 0 | 0 | 9437184 | NULL | 2013-02-23 20:26:58 | NULL | NULL | latin1_swedish_ci | NULL | | || staff | InnoDB | 10 | Compact | 1 | 81920 | 81920 | 0 | 32768 | 9437184 | 3 | 2013-01-27 01:23:55 | NULL | NULL | utf8_general_ci | NULL | | || staff_list | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | VIEW || store | InnoDB | 10 | Compact | 2 | 8192 | 16384 | 0 | 32768 | 9437184 | 3 | 2013-01-27 01:23:55 | NULL | NULL | utf8_general_ci | NULL | | || stud | InnoDB | 10 | Compact | 0 | 0 | 16384 | 0 | 0 | 9437184 | NULL | 2013-02-18 22:59:25 | NULL | NULL | latin1_swedish_ci | NULL | | || stud2 | InnoDB | 10 | Compact | 0 | 0 | 16384 | 0 | 0 | 9437184 | NULL | 2013-02-18 22:59:04 | NULL | NULL | latin1_swedish_ci | NULL | | || studb | MyISAM | 10 | Fixed | 0 | 0 | 0 | 1970324836974591 | 1024 | 0 | NULL | 2013-02-20 08:59:26 | 2013-02-20 08:59:26 | NULL | latin1_swedish_ci | NULL | | || studb6 | MyISAM | 10 | Fixed | 0 | 0 | 0 | 1970324836974591 | 1024 | 0 | NULL | 2013-02-20 09:09:46 | 2013-02-20 09:09:46 | NULL | latin1_swedish_ci | NULL | | |+----------------------------+--------+---------+------------+-------+----------------+-------------+------------------+--------------+-----------+----------------+---------------------+---------------------+------------+-------------------+----------+----------------+---------+36 rows in set (1.17 sec)

mysql> show table status \G*************************** 1. row *************************** Name: actor Engine: InnoDB Version: 10 Row_format: Compact Rows: 200 Avg_row_length: 81 Data_length: 16384Max_data_length: 0

152

Index_length: 16384 Data_free: 9437184 Auto_increment: 201 Create_time: 2013-01-27 01:23:51 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 2. row *************************** Name: actor_info Engine: NULL Version: NULL Row_format: NULL Rows: NULL Avg_row_length: NULL Data_length: NULLMax_data_length: NULL Index_length: NULL Data_free: NULL Auto_increment: NULL Create_time: NULL Update_time: NULL Check_time: NULL Collation: NULL Checksum: NULL Create_options: NULL Comment: VIEW*************************** 3. row *************************** Name: address Engine: InnoDB Version: 10 Row_format: Compact

153

Rows: 628 Avg_row_length: 130 Data_length: 81920Max_data_length: 0 Index_length: 16384 Data_free: 9437184 Auto_increment: 606 Create_time: 2013-01-27 01:23:51 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 4. row *************************** Name: books Engine: InnoDB Version: 10 Row_format: Compact Rows: 0 Avg_row_length: 0 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: NULL Create_time: 2013-02-20 13:27:25 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *************************** 5. row ***************************

154

Name: category Engine: InnoDB Version: 10 Row_format: Compact Rows: 16 Avg_row_length: 1024 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: 17 Create_time: 2013-01-27 01:23:51 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 6. row *************************** Name: city Engine: InnoDB Version: 10 Row_format: Compact Rows: 427 Avg_row_length: 115 Data_length: 49152Max_data_length: 0 Index_length: 16384 Data_free: 9437184 Auto_increment: 601 Create_time: 2013-01-27 01:23:51 Update_time: NULL Check_time: NULL Collation: utf8_general_ci

155

Checksum: NULL Create_options: Comment: *************************** 7. row *************************** Name: country Engine: InnoDB Version: 10 Row_format: Compact Rows: 109 Avg_row_length: 150 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: 110 Create_time: 2013-01-27 01:23:52 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 8. row *************************** Name: country2 Engine: InnoDB Version: 10 Row_format: Compact Rows: 109 Avg_row_length: 150 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: NULL

156

Create_time: 2013-02-20 08:41:24 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *************************** 9. row *************************** Name: country3 Engine: InnoDB Version: 10 Row_format: Compact Rows: 0 Avg_row_length: 0 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: 1 Create_time: 2013-02-20 08:41:42 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 10. row *************************** Name: customer Engine: InnoDB Version: 10 Row_format: Compact Rows: 646 Avg_row_length: 126 Data_length: 81920

157

Max_data_length: 0 Index_length: 49152 Data_free: 9437184 Auto_increment: 600 Create_time: 2013-01-27 01:23:52 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 11. row *************************** Name: customer_list Engine: NULL Version: NULL Row_format: NULL Rows: NULL Avg_row_length: NULL Data_length: NULLMax_data_length: NULL Index_length: NULL Data_free: NULL Auto_increment: NULL Create_time: NULL Update_time: NULL Check_time: NULL Collation: NULL Checksum: NULL Create_options: NULL Comment: VIEW*************************** 12. row *************************** Name: film Engine: InnoDB Version: 10

158

Row_format: Compact Rows: 628 Avg_row_length: 313 Data_length: 196608Max_data_length: 0 Index_length: 81920 Data_free: 9437184 Auto_increment: 1001 Create_time: 2013-01-27 01:23:52 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 13. row *************************** Name: film_actor Engine: InnoDB Version: 10 Row_format: Compact Rows: 5143 Avg_row_length: 38 Data_length: 196608Max_data_length: 0 Index_length: 81920 Data_free: 9437184 Auto_increment: NULL Create_time: 2013-01-27 01:23:52 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment:

159

*************************** 14. row *************************** Name: film_category Engine: InnoDB Version: 10 Row_format: Compact Rows: 1198 Avg_row_length: 54 Data_length: 65536Max_data_length: 0 Index_length: 16384 Data_free: 9437184 Auto_increment: NULL Create_time: 2013-01-27 01:23:52 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 15. row *************************** Name: film_list Engine: NULL Version: NULL Row_format: NULL Rows: NULL Avg_row_length: NULL Data_length: NULLMax_data_length: NULL Index_length: NULL Data_free: NULL Auto_increment: NULL Create_time: NULL Update_time: NULL Check_time: NULL

160

Collation: NULL Checksum: NULL Create_options: NULL Comment: VIEW*************************** 16. row *************************** Name: film_text Engine: MyISAM Version: 10 Row_format: Dynamic Rows: 1000 Avg_row_length: 119 Data_length: 119616Max_data_length: 281474976710655 Index_length: 205824 Data_free: 0 Auto_increment: NULL Create_time: 2013-01-27 01:23:52 Update_time: 2013-01-27 01:25:36 Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 17. row *************************** Name: grade_summary Engine: InnoDB Version: 10 Row_format: Compact Rows: 5 Avg_row_length: 3276 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184

161

Auto_increment: NULL Create_time: 2013-02-18 22:08:02 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *************************** 18. row *************************** Name: inventory Engine: InnoDB Version: 10 Row_format: Compact Rows: 5007 Avg_row_length: 35 Data_length: 180224Max_data_length: 0 Index_length: 196608 Data_free: 9437184 Auto_increment: 4582 Create_time: 2013-01-27 01:23:53 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 19. row *************************** Name: language Engine: InnoDB Version: 10 Row_format: Compact Rows: 6 Avg_row_length: 2730

162

Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: 7 Create_time: 2013-01-27 01:23:53 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 20. row *************************** Name: nicer_but_slower_film_list Engine: NULL Version: NULL Row_format: NULL Rows: NULL Avg_row_length: NULL Data_length: NULLMax_data_length: NULL Index_length: NULL Data_free: NULL Auto_increment: NULL Create_time: NULL Update_time: NULL Check_time: NULL Collation: NULL Checksum: NULL Create_options: NULL Comment: VIEW*************************** 21. row *************************** Name: orders23 Engine: InnoDB

163

Version: 10 Row_format: Compact Rows: 0 Avg_row_length: 0 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: NULL Create_time: 2013-02-19 00:40:29 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *************************** 22. row *************************** Name: payment Engine: InnoDB Version: 10 Row_format: Compact Rows: 13366 Avg_row_length: 118 Data_length: 1589248Max_data_length: 0 Index_length: 638976 Data_free: 9437184 Auto_increment: 16050 Create_time: 2013-01-27 01:23:53 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options:

164

Comment: *************************** 23. row *************************** Name: rental Engine: InnoDB Version: 10 Row_format: Compact Rows: 15278 Avg_row_length: 104 Data_length: 1589248Max_data_length: 0 Index_length: 1261568 Data_free: 9437184 Auto_increment: 16050 Create_time: 2013-01-27 01:23:54 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 24. row *************************** Name: sales_by_film_category Engine: NULL Version: NULL Row_format: NULL Rows: NULL Avg_row_length: NULL Data_length: NULLMax_data_length: NULL Index_length: NULL Data_free: NULL Auto_increment: NULL Create_time: NULL Update_time: NULL

165

Check_time: NULL Collation: NULL Checksum: NULL Create_options: NULL Comment: VIEW*************************** 25. row *************************** Name: sales_by_store Engine: NULL Version: NULL Row_format: NULL Rows: NULL Avg_row_length: NULL Data_length: NULLMax_data_length: NULL Index_length: NULL Data_free: NULL Auto_increment: NULL Create_time: NULL Update_time: NULL Check_time: NULL Collation: NULL Checksum: NULL Create_options: NULL Comment: VIEW*************************** 26. row *************************** Name: singers Engine: InnoDB Version: 10 Row_format: Compact Rows: 1 Avg_row_length: 16384 Data_length: 16384Max_data_length: 0 Index_length: 0

166

Data_free: 9437184 Auto_increment: NULL Create_time: 2013-02-18 23:57:56 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *************************** 27. row *************************** Name: singers2 Engine: InnoDB Version: 10 Row_format: Compact Rows: 1 Avg_row_length: 16384 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: NULL Create_time: 2013-02-19 00:20:00 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *************************** 28. row *************************** Name: singers4 Engine: InnoDB Version: 10 Row_format: Compact Rows: 3

167

Avg_row_length: 5461 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: NULL Create_time: 2013-02-19 00:26:07 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *************************** 29. row *************************** Name: so Engine: InnoDB Version: 10 Row_format: Compact Rows: 0 Avg_row_length: 0 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: NULL Create_time: 2013-02-23 20:26:58 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *************************** 30. row *************************** Name: staff

168

Engine: InnoDB Version: 10 Row_format: Compact Rows: 1 Avg_row_length: 81920 Data_length: 81920Max_data_length: 0 Index_length: 32768 Data_free: 9437184 Auto_increment: 3 Create_time: 2013-01-27 01:23:55 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 31. row *************************** Name: staff_list Engine: NULL Version: NULL Row_format: NULL Rows: NULL Avg_row_length: NULL Data_length: NULLMax_data_length: NULL Index_length: NULL Data_free: NULL Auto_increment: NULL Create_time: NULL Update_time: NULL Check_time: NULL Collation: NULL Checksum: NULL

169

Create_options: NULL Comment: VIEW*************************** 32. row *************************** Name: store Engine: InnoDB Version: 10 Row_format: Compact Rows: 2 Avg_row_length: 8192 Data_length: 16384Max_data_length: 0 Index_length: 32768 Data_free: 9437184 Auto_increment: 3 Create_time: 2013-01-27 01:23:55 Update_time: NULL Check_time: NULL Collation: utf8_general_ci Checksum: NULL Create_options: Comment: *************************** 33. row *************************** Name: stud Engine: InnoDB Version: 10 Row_format: Compact Rows: 0 Avg_row_length: 0 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: NULL Create_time: 2013-02-18 22:59:25

170

Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *************************** 34. row *************************** Name: stud2 Engine: InnoDB Version: 10 Row_format: Compact Rows: 0 Avg_row_length: 0 Data_length: 16384Max_data_length: 0 Index_length: 0 Data_free: 9437184 Auto_increment: NULL Create_time: 2013-02-18 22:59:04 Update_time: NULL Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *************************** 35. row *************************** Name: studb Engine: MyISAM Version: 10 Row_format: Fixed Rows: 0 Avg_row_length: 0 Data_length: 0Max_data_length: 1970324836974591

171

Index_length: 1024 Data_free: 0 Auto_increment: NULL Create_time: 2013-02-20 08:59:26 Update_time: 2013-02-20 08:59:26 Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: *************************** 36. row *************************** Name: studb6 Engine: MyISAM Version: 10 Row_format: Fixed Rows: 0 Avg_row_length: 0 Data_length: 0Max_data_length: 1970324836974591 Index_length: 1024 Data_free: 0 Auto_increment: NULL Create_time: 2013-02-20 09:09:46 Update_time: 2013-02-20 09:09:46 Check_time: NULL Collation: latin1_swedish_ci Checksum: NULL Create_options: Comment: 36 rows in set (0.59 sec)

mysql> SHOW INDEX FROM CUSTOMER \G*************************** 1. row ***************************

172

Table: CUSTOMER Non_unique: 0 Key_name: PRIMARY Seq_in_index: 1 Column_name: customer_id Collation: A Cardinality: 646 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 2. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_store_id Seq_in_index: 1 Column_name: store_id Collation: A Cardinality: 4 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 3. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_fk_address_id Seq_in_index: 1 Column_name: address_id Collation: A

173

Cardinality: 646 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 4. row *************************** Table: CUSTOMER Non_unique: 1 Key_name: idx_last_name Seq_in_index: 1 Column_name: last_name Collation: A Cardinality: 646 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: 4 rows in set (0.00 sec)

mysql> create or replace view customerinfo -> as -> select c.customer_id, c.store_id, c.last_name, c.first_name , -> a.address, a.address2,a.phone, t.city,a.postal_code, con.country, -> Date_format(c.create_date, '%Y-%M-%d') as Membership_Date -> from customer c -> inner join -> address a -> on c.address_id = a.address_id -> inner join

174

-> city t -> on a.city_id = t.city_id -> inner join country con -> on t.country_id = con.country_id -> order by c.last_name,c.first_name -> with check option;Query OK, 0 rows affected (0.06 sec)

mysql> desc customerinfo;+-----------------+----------------------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+-----------------+----------------------+------+-----+---------+-------+| customer_id | smallint(5) unsigned | NO | | 0 | || store_id | tinyint(3) unsigned | NO | | NULL | || last_name | varchar(45) | NO | | NULL | || first_name | varchar(45) | NO | | NULL | || address | varchar(50) | NO | | NULL | || address2 | varchar(50) | YES | | NULL | || phone | varchar(20) | NO | | NULL | || city | varchar(50) | NO | | NULL | || postal_code | varchar(10) | YES | | NULL | || country | varchar(50) | NO | | NULL | || Membership_Date | varchar(72) | YES | | NULL | |+-----------------+----------------------+------+-----+---------+-------+11 rows in set (0.03 sec)

mysql> show create table customerinfo \G*************************** 1. row *************************** View: customerinfo Create View: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `customerinfo` AS select `c`.`customer_id` AS `customer_id`,`c`.`store_id` AS `store_id`,`c`.`last_name` AS `last_name`,`c`.`first_name` AS `first_name`,`a`.`address` AS `address`,`a`.`address2` AS `address2`,`a`.`phone` AS `phone`,`t`.`city` AS `city`,`a`.`postal_code` AS `postal_code`,`con`.`country` AS `country`,date_format(`c`.`create_date`,'%Y-%M-%d') AS `Membership_Date` from (((`customer` `c` join `address` `a` on((`c`.`address_id` =

175

`a`.`address_id`))) join `city` `t` on((`a`.`city_id` = `t`.`city_id`))) join `country` `con` on((`t`.`country_id` = `con`.`country_id`))) order by `c`.`last_name`,`c`.`first_name` WITH CASCADED CHECK OPTIONcharacter_set_client: latin1collation_connection: latin1_swedish_ci1 row in set (0.00 sec)

mysql> SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_nAME = 'customerinfo' and table_schema ='sakila'\G*************************** 1. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: sakila TABLE_NAME: customerinfo VIEW_DEFINITION: select `c`.`customer_id` AS `customer_id`,`c`.`store_id` AS `store_id`,`c`.`last_name` AS `last_name`,`c`.`first_name` AS `first_name`,`a`.`address` AS `address`,`a`.`address2` AS `address2`,`a`.`phone` AS `phone`,`t`.`city` AS `city`,`a`.`postal_code` AS `postal_code`,`con`.`country` AS `country`,date_format(`c`.`create_date`,'%Y-%M-%d') AS `Membership_Date` from (((`sakila`.`customer` `c` join `sakila`.`address` `a` on((`c`.`address_id` = `a`.`address_id`))) join `sakila`.`city` `t` on((`a`.`city_id` = `t`.`city_id`))) join `sakila`.`country` `con` on((`t`.`country_id` = `con`.`country_id`))) order by `c`.`last_name`,`c`.`first_name` CHECK_OPTION: CASCADED IS_UPDATABLE: YES DEFINER: root@localhost SECURITY_TYPE: DEFINERCHARACTER_SET_CLIENT: latin1COLLATION_CONNECTION: latin1_swedish_ci1 row in set (0.00 sec)

mysql> SHOW CREATE VIEW CUSTOMERINFO\G*************************** 1. row *************************** View: customerinfo Create View: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `customerinfo` AS select `c`.`customer_id` AS `customer_id`,`c`.`store_id` AS `store_id`,`c`.`last_name` AS `last_name`,`c`.`first_name` AS `first_name`,`a`.`address` AS `address`,`a`.`address2` AS `address2`,`a`.`phone` AS `phone`,`t`.`city` AS `city`,`a`.`postal_code` AS `postal_code`,`con`.`country` AS `country`,date_format(`c`.`create_date`,'%Y-%M-%d') AS `Membership_Date` from (((`customer` `c` join `address` `a` on((`c`.`address_id` =

176

`a`.`address_id`))) join `city` `t` on((`a`.`city_id` = `t`.`city_id`))) join `country` `con` on((`t`.`country_id` = `con`.`country_id`))) order by `c`.`last_name`,`c`.`first_name` WITH CASCADED CHECK OPTIONcharacter_set_client: latin1collation_connection: latin1_swedish_ci1 row in set (0.00 sec)

mysql> SHOW FULL TABLES FROM SAKILA;+----------------------------+------------+| Tables_in_sakila | Table_type |+----------------------------+------------+| actor | BASE TABLE || actor_info | VIEW || address | BASE TABLE || books | BASE TABLE || category | BASE TABLE || city | BASE TABLE || country | BASE TABLE || country2 | BASE TABLE || country3 | BASE TABLE || customer | BASE TABLE || customer_list | VIEW || customerinfo | VIEW || film | BASE TABLE || film_actor | BASE TABLE || film_category | BASE TABLE || film_list | VIEW || film_text | BASE TABLE || grade_summary | BASE TABLE || inventory | BASE TABLE || language | BASE TABLE || nicer_but_slower_film_list | VIEW || orders23 | BASE TABLE || payment | BASE TABLE |

177

| rental | BASE TABLE || sales_by_film_category | VIEW || sales_by_store | VIEW || singers | BASE TABLE || singers2 | BASE TABLE || singers4 | BASE TABLE || so | BASE TABLE || staff | BASE TABLE || staff_list | VIEW || store | BASE TABLE || stud | BASE TABLE || stud2 | BASE TABLE || studb | BASE TABLE || studb6 | BASE TABLE |+----------------------------+------------+37 rows in set (0.61 sec)

mysql> CHECK TABLE CUSTOMERINFO\G*************************** 1. row *************************** Table: sakila.customerinfo Op: checkMsg_type: statusMsg_text: OK1 row in set (0.03 sec)

mysql> CHECK TABLE CUSTOMERINFO\G*************************** 1. row *************************** Table: sakila.customerinfo Op: checkMsg_type: statusMsg_text: OK1 row in set (0.03 sec)

178

mysql> CREATE TABLE CUSTOMER2 SELECT * FROM CUSTOMER;Query OK, 599 rows affected (0.25 sec)Records: 599 Duplicates: 0 Warnings: 0

mysql> DESC CUSTOMER2;+-------------+----------------------+------+-----+---------------------+-------+| Field | Type | Null | Key | Default | Extra |+-------------+----------------------+------+-----+---------------------+-------+| customer_id | smallint(5) unsigned | NO | | 0 | || store_id | tinyint(3) unsigned | NO | | NULL | || first_name | varchar(45) | NO | | NULL | || last_name | varchar(45) | NO | | NULL | || email | varchar(50) | YES | | NULL | || address_id | smallint(5) unsigned | NO | | NULL | || active | tinyint(1) | NO | | 1 | || create_date | datetime | NO | | NULL | || last_update | timestamp | NO | | 0000-00-00 00:00:00 | |+-------------+----------------------+------+-----+---------------------+-------+9 rows in set (0.01 sec)

mysql> DESC CUSTOMER;+-------------+----------------------+------+-----+-------------------+-----------------------------+| Field | Type | Null | Key | Default | Extra |+-------------+----------------------+------+-----+-------------------+-----------------------------+| customer_id | smallint(5) unsigned | NO | PRI | NULL | auto_increment || store_id | tinyint(3) unsigned | NO | MUL | NULL | || first_name | varchar(45) | NO | | NULL | || last_name | varchar(45) | NO | MUL | NULL | || email | varchar(50) | YES | | NULL | || address_id | smallint(5) unsigned | NO | MUL | NULL | || active | tinyint(1) | NO | | 1 | || create_date | datetime | NO | | NULL | || last_update | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |+-------------+----------------------+------+-----+-------------------+-----------------------------+

179

9 rows in set (0.00 sec)

mysql> ALTER TABLE CUSTOMER2 MODIFY CREATE_DATE DATE;Query OK, 599 rows affected, 599 warnings (0.75 sec)Records: 599 Duplicates: 0 Warnings: 599

mysql> DESC CUSTOMER2;+-------------+----------------------+------+-----+---------------------+-------+| Field | Type | Null | Key | Default | Extra |+-------------+----------------------+------+-----+---------------------+-------+| customer_id | smallint(5) unsigned | NO | | 0 | || store_id | tinyint(3) unsigned | NO | | NULL | || first_name | varchar(45) | NO | | NULL | || last_name | varchar(45) | NO | | NULL | || email | varchar(50) | YES | | NULL | || address_id | smallint(5) unsigned | NO | | NULL | || active | tinyint(1) | NO | | 1 | || CREATE_DATE | date | YES | | NULL | || last_update | timestamp | NO | | 0000-00-00 00:00:00 | |+-------------+----------------------+------+-----+---------------------+-------+9 rows in set (0.03 sec)

mysql> SELECT CREATE_DATE FROM CUSTOMER2;+-------------+| CREATE_DATE |+-------------+| 2006-02-14 || 2006-02-14 || 2006-02-14 |

USING FILE TO CREATE AND LOAD DATABASE.

-----------------------------university.sql-----------------------------------------------------------------

180

use world;

CREATE TABLE students(STUDENT_ID INT NOT NULL Auto_Increment,FIRST_NAME CHAR(55),LAST_NAME CHAR(55),DOB DATE,SNN INT,PRIMARY KEY(STUDENT_ID));

CREATE TABLE CONTACTS(Contact_ID INT NOT NULL Auto_Increment,STUDENT_ID INT NOT NULL,Address VARCHAR(55),CITY VARCHAR(55),CONTACT_STATE ENUM('AL','AK','AZ','AR','CA','CO','CT','DE','DC','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD', 'TN','TX','UT','VT','VA','WA','WV','WY'),PHONE INT,PRIMARY KEY(STUDENT_ID,CONTACT_ID) ,UNIQUE(CONTACT_ID)

);

ALTER TABLE CONTACTS ADD CONSTRAINT CONTSTUID_FK FOREIGN KEY(STUDENT_ID) REFERENCES STUDENTS(STUDENT_ID) ON DELETE CASCADE; ALTER TABLE students ADD CREATED_DATE TIMESTAMP AFTER DOB;

181

INSERT INTO STUDENTS(FIRST_NAME, LAST_NAME, DOB,SNN) VALUES('JOHN','JOHN','1986-08-09','444444444'); INSERT INTO STUDENTS(FIRST_NAME, LAST_NAME, DOB,SNN) VALUES('MARY', 'PLUMBERS', '1985-09-01','555555555'); INSERT INTO STUDENTS(FIRST_NAME, LAST_NAME, DOB,SNN) VALUES('ROSIE','WASHINGTON','1984-03-09','33333333'); INSERT INTO CONTACTS(STUDENT_ID, Address,City,Contact_state, phone) values(1,'989 S Bell Apt 34b', 'New Heaven', 3, 773289098);

INSERT INTO CONTACTS(STUDENT_ID, Address,City,Contact_state, phone) values(2,'989 E Bell ', 'Old Ford', 2, 2122500897);

mysql> SOURCE C:\MYSQL\university.sqlDatabase changedQuery OK, 0 rows affected (0.09 sec)

Query OK, 0 rows affected (0.08 sec)

Query OK, 0 rows affected (0.23 sec)Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.28 sec)Records: 0 Duplicates: 0 Warnings: 0

Query OK, 1 row affected (0.03 sec)

Query OK, 1 row affected (0.03 sec)

Query OK, 1 row affected (0.03 sec)

182

Query OK, 1 row affected (0.03 sec)

Query OK, 1 row affected (0.03 sec)

mysql> desc world.students;+--------------+-----------+------+-----+-------------------+-----------------------------+| Field | Type | Null | Key | Default | Extra |+--------------+-----------+------+-----+-------------------+-----------------------------+| STUDENT_ID | int(11) | NO | PRI | NULL | auto_increment || FIRST_NAME | char(55) | YES | | NULL | || LAST_NAME | char(55) | YES | | NULL | || DOB | date | YES | | NULL | || CREATED_DATE | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP || SNN | int(11) | YES | | NULL | |+--------------+-----------+------+-----+-------------------+-----------------------------+6 rows in set (0.00 sec)

mysql> desc world.contacts\G*************************** 1. row *************************** Field: Contact_ID Type: int(11) Null: NO Key: PRIDefault: NULL Extra: auto_increment*************************** 2. row *************************** Field: STUDENT_ID Type: int(11) Null: NO Key: PRI

183

Default: NULL Extra: *************************** 3. row *************************** Field: Address Type: varchar(55) Null: YES Key: Default: NULL Extra: *************************** 4. row *************************** Field: CITY Type: varchar(55) Null: YES Key: Default: NULL Extra: *************************** 5. row *************************** Field: CONTACT_STATE Type: enum('AL','AK','AZ','AR','CA','CO','CT','DE','DC','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WY') Null: YES Key: Default: NULL Extra: *************************** 6. row *************************** Field: PHONE Type: int(11) Null: YES Key: Default: NULL Extra: 6 rows in set (0.00 sec)

184

mysql> SHOW FULL COLUMNS FROM CONTACTS \G*************************** 1. row *************************** Field: Contact_ID Type: int(11) Collation: NULL Null: NO Key: PRI Default: NULL Extra: auto_incrementPrivileges: select,insert,update,references Comment: *************************** 2. row *************************** Field: STUDENT_ID Type: int(11) Collation: NULL Null: NO Key: PRI Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 3. row *************************** Field: Address Type: varchar(55) Collation: latin1_swedish_ci Null: YES Key: Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 4. row *************************** Field: CITY Type: varchar(55)

185

Collation: latin1_swedish_ci Null: YES Key: Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 5. row *************************** Field: CONTACT_STATE Type: enum('AL','AK','AZ','AR','CA','CO','CT','DE','DC','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WY') Collation: latin1_swedish_ci Null: YES Key: Default: NULL Extra: Privileges: select,insert,update,references Comment: *************************** 6. row *************************** Field: PHONE Type: int(11) Collation: NULL Null: YES Key: Default: NULL Extra: Privileges: select,insert,update,references Comment: 6 rows in set (0.00 sec)

mysql> SHOW FULL COLUMNS FROM STUDENTS;+--------------+-----------+-------------------+------+-----+-------------------+-----------------------------+---------------------------------+---------+| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |

186

+--------------+-----------+-------------------+------+-----+-------------------+-----------------------------+---------------------------------+---------+| STUDENT_ID | int(11) | NULL | NO | PRI | NULL | auto_increment | select,insert,update,references | || FIRST_NAME | char(55) | latin1_swedish_ci | YES | | NULL | | select,insert,update,references | || LAST_NAME | char(55) | latin1_swedish_ci | YES | | NULL | | select,insert,update,references | || DOB | date | NULL | YES | | NULL | | select,insert,update,references | || CREATED_DATE | timestamp | NULL | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP | select,insert,update,references | || SNN | int(11) | NULL | YES | | NULL | | select,insert,update,references | |+--------------+-----------+-------------------+------+-----+-------------------+-----------------------------+---------------------------------+---------+6 rows in set (0.00 sec)

mysql> SHOW INDEX FROM STUDENTS;+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+| STUDENTS | 0 | PRIMARY | 1 | STUDENT_ID | A | 3 | NULL | NULL | | BTREE | | |+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+1 row in set (0.00 sec)

mysql> SHOW INDEX FROM STUDENTS \G*************************** 1. row *************************** Table: STUDENTS Non_unique: 0 Key_name: PRIMARY Seq_in_index: 1 Column_name: STUDENT_ID Collation: A Cardinality: 3 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment:

187

Index_comment: 1 row in set (0.00 sec)

mysql> SHOW INDEX FROM CONTACTS \G*************************** 1. row *************************** Table: CONTACTS Non_unique: 0 Key_name: PRIMARY Seq_in_index: 1 Column_name: STUDENT_ID Collation: A Cardinality: 2 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 2. row *************************** Table: CONTACTS Non_unique: 0 Key_name: PRIMARY Seq_in_index: 2 Column_name: Contact_ID Collation: A Cardinality: 2 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: *************************** 3. row *************************** Table: CONTACTS

188

Non_unique: 0 Key_name: Contact_ID Seq_in_index: 1 Column_name: Contact_ID Collation: A Cardinality: 2 Sub_part: NULL Packed: NULL Null: Index_type: BTREE Comment: Index_comment: 3 rows in set (0.00 sec)

mysql> SELECT * FROM STUDENTS;+------------+------------+------------+------------+---------------------+-----------+| STUDENT_ID | FIRST_NAME | LAST_NAME | DOB | CREATED_DATE | SNN |+------------+------------+------------+------------+---------------------+-----------+| 1 | JOHN | JOHN | 1986-08-09 | 2013-02-24 16:09:18 | 444444444 || 2 | MARY | PLUMBERS | 1985-09-01 | 2013-02-24 16:09:18 | 555555555 || 3 | ROSIE | WASHINGTON | 1984-03-09 | 2013-02-24 16:09:18 | 33333333 |+------------+------------+------------+------------+---------------------+-----------+3 rows in set (0.00 sec)

mysql> SELECT * FROM CONTACTS;+------------+------------+--------------------+------------+---------------+------------+| Contact_ID | STUDENT_ID | Address | CITY | CONTACT_STATE | PHONE |+------------+------------+--------------------+------------+---------------+------------+| 1 | 1 | 989 S Bell Apt 34b | New Heaven | AZ | 773289098 || 2 | 2 | 989 E Bell | Old Ford | AK | 2122500897 |+------------+------------+--------------------+------------+---------------+------------+2 rows in set (0.00 sec)

189

Triggers-After

mysql> create table student_aduit -> (student_id int, -> first_name char(55), -> last_name char(55), -> dob date, -> created_date timestamp, -> snn int, -> action_type char(12), -> action_date datetime -> );Query OK, 0 rows affected (0.15 sec)

mysql> mysql> DELIMITER //mysql> mysql> create trigger studentint -> AFTER INSERT ON world.students -> FOR EACH ROW -> BEGIN -> INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) -> VALUES(NEW.STUDENT_ID,NEW.FIRST_NAME, NEW.LAST_NAME,NEW.DOB, NEW.CREATED_DATE, NEW.SNN,'Inserted',NOW()); -> END //Query OK, 0 rows affected (0.12 sec)

mysql> mysql> DELIMITER //mysql> mysql> create trigger studentupdt -> AFTER update ON world.students -> FOR EACH ROW -> BEGIN

190

-> INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) -> VALUES(NEW.STUDENT_ID,NEW.FIRST_NAME, NEW.LAST_NAME,NEW.DOB, NEW.CREATED_DATE, NEW.SNN,'updated',NOW()); -> END //Query OK, 0 rows affected (0.11 sec)

mysql> mysql> DELIMITER //mysql> mysql> create trigger studentdelt -> AFTER delete ON world.students -> FOR EACH ROW -> BEGIN -> INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) -> VALUES(OLD.STUDENT_ID,OLD.FIRST_NAME, OLD.LAST_NAME,OLD.DOB, OLD.CREATED_DATE, OLD.SNN,'DELETED',NOW()); -> END //Query OK, 0 rows affected (0.09 sec)

mysql> SHOW TABLES;+-----------------+| Tables_in_world |+-----------------+| contacts || customer || student_aduit || students |+-----------------+4 rows in set (0.00 sec)

mysql> DESC STUDENTS;+--------------+-----------+------+-----+-------------------+-----------------------------+| Field | Type | Null | Key | Default | Extra |+--------------+-----------+------+-----+-------------------+-----------------------------+| STUDENT_ID | int(11) | NO | PRI | NULL | auto_increment |

191

| FIRST_NAME | char(55) | YES | | NULL | || LAST_NAME | char(55) | YES | | NULL | || DOB | date | YES | | NULL | || CREATED_DATE | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP || SNN | int(11) | YES | | NULL | |+--------------+-----------+------+-----+-------------------+-----------------------------+6 rows in set (0.02 sec)

mysql> INSERT INTO STUDENTS(FIRST_NAME, LAST_NAME, DOB,SNN) -> VALUES('WASHINGTON','JOHN','1986-08-09','777777777');Query OK, 1 row affected (0.03 sec)

mysql> SELECT * FROM STUDENT_ADUIT;+------------+------------+-----------+------------+---------------------+-----------+-------------+---------------------+| student_id | first_name | last_name | dob | created_date | snn | action_type | action_date |+------------+------------+-----------+------------+---------------------+-----------+-------------+---------------------+| 4 | WASHINGTON | JOHN | 1986-08-09 | 2013-03-04 00:19:43 | 777777777 | Inserted | 2013-03-04 00:19:43 |+------------+------------+-----------+------------+---------------------+-----------+-------------+---------------------+1 row in set (0.00 sec)

mysql> SELECT * FROM STUDENTS;+------------+------------+------------+------------+---------------------+-----------+| STUDENT_ID | FIRST_NAME | LAST_NAME | DOB | CREATED_DATE | SNN |+------------+------------+------------+------------+---------------------+-----------+| 1 | JOHN | JOHN | 1986-08-09 | 2013-02-24 16:09:18 | 444444444 || 2 | MARY | PLUMBERS | 1985-09-01 | 2013-02-24 16:09:18 | 555555555 || 3 | ROSIE | WASHINGTON | 1984-03-09 | 2013-02-24 16:09:18 | 33333333 || 4 | WASHINGTON | JOHN | 1986-08-09 | 2013-03-04 00:19:43 | 777777777 |+------------+------------+------------+------------+---------------------+-----------+4 rows in set (0.00 sec)

192

mysql> DELETE FROM STUDENTS WHERE STUDENT_ID = 4;Query OK, 1 row affected (0.06 sec)

mysql> SELECT * FROM STUDENT_ADUIT;+------------+------------+-----------+------------+---------------------+-----------+-------------+---------------------+| student_id | first_name | last_name | dob | created_date | snn | action_type | action_date |+------------+------------+-----------+------------+---------------------+-----------+-------------+---------------------+| 4 | WASHINGTON | JOHN | 1986-08-09 | 2013-03-04 00:19:43 | 777777777 | Inserted | 2013-03-04 00:19:43 || 4 | WASHINGTON | JOHN | 1986-08-09 | 2013-03-04 00:19:43 | 777777777 | DELETED | 2013-03-04 00:27:09 |+------------+------------+-----------+------------+---------------------+-----------+-------------+---------------------+2 rows in set (0.00 sec)

mysql> UPDATE STUDENTS SET SNN = 566899234 WHERE STUDENT_ID =3;Query OK, 1 row affected (0.04 sec)Rows matched: 1 Changed: 1 Warnings: 0

mysql> SELECT * FROM STUDENT_ADUIT;+------------+------------+------------+------------+---------------------+-----------+-------------+---------------------+| student_id | first_name | last_name | dob | created_date | snn | action_type | action_date |+------------+------------+------------+------------+---------------------+-----------+-------------+---------------------+| 4 | WASHINGTON | JOHN | 1986-08-09 | 2013-03-04 00:19:43 | 777777777 | Inserted | 2013-03-04 00:19:43 || 4 | WASHINGTON | JOHN | 1986-08-09 | 2013-03-04 00:19:43 | 777777777 | DELETED | 2013-03-04 00:27:09 || 3 | ROSIE | WASHINGTON | 1984-03-09 | 2013-03-04 00:30:28 | 566899234 | updated | 2013-03-04 00:30:28 |+------------+------------+------------+------------+---------------------+-----------+-------------+---------------------+3 rows in set (0.00 sec)

mysql> SHOW TRIGGERS IN WORLD;+-------------+--------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+---------+----------------------------------------------------------------+----------------+----------------------+----------------------+--------------------+| Trigger | Event | Table | Statement | Timing | Created | sql_mode | Definer | character_set_client | collation_connection | Database Collation |

193

+-------------+--------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+---------+----------------------------------------------------------------+----------------+----------------------+----------------------+--------------------+| studentint | INSERT | students | BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) VALUES(NEW.STUDENT_ID,NEW.FIRST_NAME, NEW.LAST_NAME,NEW.DOB, NEW.CREATED_DATE, NEW.SNN,'Inserted',NOW());END | AFTER | NULL | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | root@localhost | latin1 | latin1_swedish_ci | latin1_swedish_ci || studentupdt | UPDATE | students | BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) VALUES(NEW.STUDENT_ID,NEW.FIRST_NAME, NEW.LAST_NAME,NEW.DOB, NEW.CREATED_DATE, NEW.SNN,'updated',NOW());END | AFTER | NULL | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | root@localhost | latin1 | latin1_swedish_ci | latin1_swedish_ci || studentdelt | DELETE | students | BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) VALUES(OLD.STUDENT_ID,OLD.FIRST_NAME, OLD.LAST_NAME,OLD.DOB, OLD.CREATED_DATE, OLD.SNN,'DELETED',NOW());END | AFTER | NULL | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | root@localhost | latin1 | latin1_swedish_ci | latin1_swedish_ci |+-------------+--------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+---------+----------------------------------------------------------------+----------------+----------------------+----------------------+--------------------+3 rows in set (0.01 sec)

mysql> SHOW TRIGGERS IN WORLD \G*************************** 1. row *************************** Trigger: studentint Event: INSERT Table: students Statement: BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) VALUES(NEW.STUDENT_ID,NEW.FIRST_NAME, NEW.LAST_NAME,NEW.DOB, NEW.CREATED_DATE, NEW.SNN,'Inserted',NOW());END

194

Timing: AFTER Created: NULL sql_mode: STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Definer: root@localhostcharacter_set_client: latin1collation_connection: latin1_swedish_ci Database Collation: latin1_swedish_ci*************************** 2. row *************************** Trigger: studentupdt Event: UPDATE Table: students Statement: BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) VALUES(NEW.STUDENT_ID,NEW.FIRST_NAME, NEW.LAST_NAME,NEW.DOB, NEW.CREATED_DATE, NEW.SNN,'updated',NOW());END Timing: AFTER Created: NULL sql_mode: STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Definer: root@localhostcharacter_set_client: latin1collation_connection: latin1_swedish_ci Database Collation: latin1_swedish_ci*************************** 3. row *************************** Trigger: studentdelt Event: DELETE Table: students Statement: BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) VALUES(OLD.STUDENT_ID,OLD.FIRST_NAME, OLD.LAST_NAME,OLD.DOB, OLD.CREATED_DATE, OLD.SNN,'DELETED',NOW());END Timing: AFTER Created: NULL sql_mode: STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Definer: root@localhost

195

character_set_client: latin1collation_connection: latin1_swedish_ci Database Collation: latin1_swedish_ci3 rows in set (0.01 sec)

mysql> DESC STUDNETS;ERROR 1146 (42S02): Table 'world.studnets' doesn't existmysql> desc students;+--------------+-----------+------+-----+-------------------+-----------------------------+| Field | Type | Null | Key | Default | Extra |+--------------+-----------+------+-----+-------------------+-----------------------------+| STUDENT_ID | int(11) | NO | PRI | NULL | auto_increment || FIRST_NAME | char(55) | YES | | NULL | || LAST_NAME | char(55) | YES | | NULL | || DOB | date | YES | | NULL | || CREATED_DATE | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP || SNN | int(11) | YES | | NULL | |+--------------+-----------+------+-----+-------------------+-----------------------------+6 rows in set (0.01 sec)

Triggers-Before

mysql> DESC STUDENTS;+--------------+-----------+------+-----+-------------------+-----------------------------+| Field | Type | Null | Key | Default | Extra |+--------------+-----------+------+-----+-------------------+-----------------------------+| STUDENT_ID | int(11) | NO | PRI | NULL | auto_increment || FIRST_NAME | char(55) | YES | | NULL | || LAST_NAME | char(55) | YES | | NULL | || DOB | date | YES | | NULL | || CREATED_DATE | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP || SNN | int(11) | YES | | NULL | |

196

+--------------+-----------+------+-----+-------------------+-----------------------------+6 rows in set (0.01 sec)mysql> mysql> mysql> mysql> mysql> DELIMITER //mysql> CREATE TRIGGER STUDBF -> BEFORE UPDATE ON STUDENTS -> FOR EACH ROW -> BEGIN -> SET NEW.FIRST_NAME = UPPER(NEW.FIRST_NAME); -> END//Query OK, 0 rows affected (0.14 sec)

mysql> UPDATE STUDENTS SET FIRST_NAME='michael' where student_id =1;Query OK, 1 row affected (0.06 sec)Rows matched: 1 Changed: 1 Warnings: 0

mysql> select * from students;+------------+------------+------------+------------+---------------------+-----------+| STUDENT_ID | FIRST_NAME | LAST_NAME | DOB | CREATED_DATE | SNN |+------------+------------+------------+------------+---------------------+-----------+| 1 | MICHAEL | JOHN | 1986-08-09 | 2013-03-09 20:25:24 | 444444444 || 2 | MARY | PLUMBERS | 1985-09-01 | 2013-02-24 16:09:18 | 555555555 || 3 | ROSIE | WASHINGTON | 1984-03-09 | 2013-03-04 00:30:28 | 566899234 |+------------+------------+------------+------------+---------------------+-----------+3 rows in set (0.00 sec)

mysql> show triggers in world;+-------------+--------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+---------+----------------------------------------------------------------+----------------+----------------------+----------------------+--------------------+

197

| Trigger | Event | Table | Statement | Timing | Created | sql_mode | Definer | character_set_client | collation_connection | Database Collation |+-------------+--------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+---------+----------------------------------------------------------------+----------------+----------------------+----------------------+--------------------+| studentint | INSERT | students | BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) VALUES(NEW.STUDENT_ID,NEW.FIRST_NAME, NEW.LAST_NAME,NEW.DOB, NEW.CREATED_DATE, NEW.SNN,'Inserted',NOW());END | AFTER | NULL | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | root@localhost | latin1 | latin1_swedish_ci | latin1_swedish_ci || STUDBF | UPDATE | students | BEGIN SET NEW.FIRST_NAME = UPPER(NEW.FIRST_NAME); END | BEFORE | NULL | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | root@localhost | latin1 | latin1_swedish_ci | latin1_swedish_ci || studentupdt | UPDATE | students | BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) VALUES(NEW.STUDENT_ID,NEW.FIRST_NAME, NEW.LAST_NAME,NEW.DOB, NEW.CREATED_DATE, NEW.SNN,'updated',NOW());END | AFTER | NULL | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | root@localhost | latin1 | latin1_swedish_ci | latin1_swedish_ci || studentdelt | DELETE | students | BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) VALUES(OLD.STUDENT_ID,OLD.FIRST_NAME, OLD.LAST_NAME,OLD.DOB, OLD.CREATED_DATE, OLD.SNN,'DELETED',NOW());END | AFTER | NULL | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | root@localhost | latin1 | latin1_swedish_ci | latin1_swedish_ci |+-------------+--------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+---------+----------------------------------------------------------------+----------------+----------------------+----------------------+--------------------+4 rows in set (0.01 sec)

mysql> show triggers in world \G*************************** 1. row ***************************

198

Trigger: studentint Event: INSERT Table: students Statement: BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) VALUES(NEW.STUDENT_ID,NEW.FIRST_NAME, NEW.LAST_NAME,NEW.DOB, NEW.CREATED_DATE, NEW.SNN,'Inserted',NOW());END Timing: AFTER Created: NULL sql_mode: STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Definer: root@localhostcharacter_set_client: latin1collation_connection: latin1_swedish_ci Database Collation: latin1_swedish_ci*************************** 2. row *************************** Trigger: STUDBF Event: UPDATE Table: students Statement: BEGIN SET NEW.FIRST_NAME = UPPER(NEW.FIRST_NAME); END Timing: BEFORE Created: NULL sql_mode: STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Definer: root@localhostcharacter_set_client: latin1collation_connection: latin1_swedish_ci Database Collation: latin1_swedish_ci*************************** 3. row *************************** Trigger: studentupdt Event: UPDATE Table: students Statement: BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date)

199

VALUES(NEW.STUDENT_ID,NEW.FIRST_NAME, NEW.LAST_NAME,NEW.DOB, NEW.CREATED_DATE, NEW.SNN,'updated',NOW());END Timing: AFTER Created: NULL sql_mode: STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Definer: root@localhostcharacter_set_client: latin1collation_connection: latin1_swedish_ci Database Collation: latin1_swedish_ci*************************** 4. row *************************** Trigger: studentdelt Event: DELETE Table: students Statement: BEGIN INSERT INTO world.student_aduit(student_id,first_name,last_name,dob,created_date,snn, action_type,action_date) VALUES(OLD.STUDENT_ID,OLD.FIRST_NAME, OLD.LAST_NAME,OLD.DOB, OLD.CREATED_DATE, OLD.SNN,'DELETED',NOW());END Timing: AFTER Created: NULL sql_mode: STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Definer: root@localhostcharacter_set_client: latin1collation_connection: latin1_swedish_ci Database Collation: latin1_swedish_ci4 rows in set (0.01 sec)

mysql> DELIMITER //mysql> CREATE TRIGGER STUDINT -> BEFORE INSERT ON STUDENTS -> FOR EACH ROW -> BEGIN -> SET NEW.FIRST_NAME = UPPER(NEW.FIRST_NAME);

200

-> SET NEW.LAST_NAME = UPPER(NEW.LAST_NAME); -> END//Query OK, 0 rows affected (0.08 sec)

mysql> DESC STUDENTS -> ;+--------------+-----------+------+-----+-------------------+-----------------------------+| Field | Type | Null | Key | Default | Extra |+--------------+-----------+------+-----+-------------------+-----------------------------+| STUDENT_ID | int(11) | NO | PRI | NULL | auto_increment || FIRST_NAME | char(55) | YES | | NULL | || LAST_NAME | char(55) | YES | | NULL | || DOB | date | YES | | NULL | || CREATED_DATE | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP || SNN | int(11) | YES | | NULL | |+--------------+-----------+------+-----+-------------------+-----------------------------+6 rows in set (0.01 sec)

mysql> INSERT INTO STUDENTS(FIRST_NAME, LAST_NAME,DOB,SNN) -> VALUES('sam','jon','1990-09-0','456778881');Query OK, 1 row affected (0.04 sec)

mysql> select * from student;ERROR 1146 (42S02): Table 'world.student' doesn't existmysql> select * from students;+------------+------------+------------+------------+---------------------+-----------+| STUDENT_ID | FIRST_NAME | LAST_NAME | DOB | CREATED_DATE | SNN |+------------+------------+------------+------------+---------------------+-----------+| 1 | MICHAEL | JOHN | 1986-08-09 | 2013-03-09 20:25:24 | 444444444 || 2 | MARY | PLUMBERS | 1985-09-01 | 2013-02-24 16:09:18 | 555555555 || 3 | ROSIE | WASHINGTON | 1984-03-09 | 2013-03-04 00:30:28 | 566899234 || 4 | SAM | JON | 1990-09-00 | 2013-03-09 20:37:22 | 456778881 |+------------+------------+------------+------------+---------------------+-----------+4 rows in set (0.00 sec)

201

Stored Procedures

mysql> mysql> mysql> DELIMITER //mysql> mysql> CREATE PROCEDURE STUDENT_UPDATE -> (STUDENTID INT, -> birth DATE -> ) -> BEGIN -> -> DECLARE sql_error TINYINT DEFAULT FALSE; -> DECLARE CONTINUE HANDLER FOR SQLEXCEPTION -> SET sql_error = TRUE; -> -> START TRANSACTION; -> -> UPDATE WORLD.STUDENTS -> SET DOB = birth -> WHERE STUDENT_ID = STUDENTID; -> -> IF sql_error = FALSE THEN -> COMMIT; -> ELSE -> ROLLBACK; -> END IF; -> END//Query OK, 0 rows affected (0.00 sec)

mysql> select * from students \g

202

+------------+------------+------------+------------+---------------------+-----------+| STUDENT_ID | FIRST_NAME | LAST_NAME | DOB | CREATED_DATE | SNN |+------------+------------+------------+------------+---------------------+-----------+| 1 | MICHAEL | JOHN | 1989-09-10 | 2013-03-11 00:59:14 | 444444444 || 2 | MARY | PLUMBERS | 1975-09-20 | 2013-03-10 23:11:47 | 555555555 || 3 | ROSIE | WASHINGTON | 1975-09-20 | 2013-03-10 23:11:47 | 566899234 || 4 | SAM | JON | 1975-09-20 | 2013-03-10 23:11:47 | 456778881 |+------------+------------+------------+------------+---------------------+-----------+4 rows in set (0.00 sec)

mysql> mysql> call student_update(1,'1971-09-20');Query OK, 0 rows affected (0.09 sec)

mysql> select * from students \g+------------+------------+------------+------------+---------------------+-----------+| STUDENT_ID | FIRST_NAME | LAST_NAME | DOB | CREATED_DATE | SNN |+------------+------------+------------+------------+---------------------+-----------+| 1 | MICHAEL | JOHN | 1971-09-20 | 2013-03-11 01:03:58 | 444444444 || 2 | MARY | PLUMBERS | 1975-09-20 | 2013-03-10 23:11:47 | 555555555 || 3 | ROSIE | WASHINGTON | 1975-09-20 | 2013-03-10 23:11:47 | 566899234 || 4 | SAM | JON | 1975-09-20 | 2013-03-10 23:11:47 | 456778881 |+------------+------------+------------+------------+---------------------+-----------+4 rows in set (0.00 sec)

mysql> DESC STUDENTS -> ;+--------------+-----------+------+-----+-------------------+-----------------------------+| Field | Type | Null | Key | Default | Extra |+--------------+-----------+------+-----+-------------------+-----------------------------+| STUDENT_ID | int(11) | NO | PRI | NULL | auto_increment || FIRST_NAME | char(55) | YES | | NULL | || LAST_NAME | char(55) | YES | | NULL | || DOB | date | YES | | NULL | |

203

| CREATED_DATE | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP || SNN | int(11) | YES | | NULL | |+--------------+-----------+------+-----+-------------------+-----------------------------+6 rows in set (0.01 sec)

mysql> DELIMITER //mysql> mysql> CREATE PROCEDURE STUDENT_INSERT -> (FNAME CHAR(55), -> LNAME CHAR(55), -> birth DATE, -> S_NN INT -> ) -> BEGIN -> -> -> START TRANSACTION; -> -> INSERT INTO WORLD.STUDENTS( FIRST_NAME,LAST_NAME,DOB,SNN) -> VALUES(FNAME,LNAME,birth,S_NN); -> -> COMMIT; -> -> END//Query OK, 0 rows affected (0.00 sec)

mysql> mysql> mysql> CALL STUDENT_INSERT('Rosa','Jones','1967-11-20',987567890);Query OK, 0 rows affected (0.08 sec)

mysql> select * from students;+------------+------------+------------+------------+---------------------+-----------+| STUDENT_ID | FIRST_NAME | LAST_NAME | DOB | CREATED_DATE | SNN |

204

+------------+------------+------------+------------+---------------------+-----------+| 1 | MICHAEL | JOHN | 1971-09-20 | 2013-03-11 01:03:58 | 444444444 || 2 | MARY | PLUMBERS | 1975-09-20 | 2013-03-10 23:11:47 | 555555555 || 3 | ROSIE | WASHINGTON | 1975-09-20 | 2013-03-10 23:11:47 | 566899234 || 4 | SAM | JON | 1975-09-20 | 2013-03-10 23:11:47 | 456778881 || 5 | ROSA | JONES | 1967-11-20 | 2013-03-11 01:26:54 | 987567890 |+------------+------------+------------+------------+---------------------+-----------+5 rows in set (0.02 sec)

mysql> DELIMITER //mysql> mysql> CREATE PROCEDURE STUDENT_DELETE -> (STUDID INT -> ) -> BEGIN -> -> -> START TRANSACTION; -> DELETE FROM WORLD.STUDENTS -> WHERE STUDENT_ID = STUDID -> -> COMMIT; -> -> END//ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COMMIT;

END' at line 11mysql> mysql> DELIMITER //mysql> mysql> CREATE PROCEDURE STUDENT_DELETE -> (STUDID INT -> )

205

-> BEGIN -> -> -> START TRANSACTION; -> DELETE FROM WORLD.STUDENTS -> WHERE STUDENT_ID = STUDID; -> -> COMMIT; -> -> END//Query OK, 0 rows affected (0.00 sec)

mysql> mysql> SELECT * FROM STUDENTS;+------------+------------+------------+------------+---------------------+-----------+| STUDENT_ID | FIRST_NAME | LAST_NAME | DOB | CREATED_DATE | SNN |+------------+------------+------------+------------+---------------------+-----------+| 1 | MICHAEL | JOHN | 1971-09-20 | 2013-03-11 01:03:58 | 444444444 || 2 | MARY | PLUMBERS | 1975-09-20 | 2013-03-10 23:11:47 | 555555555 || 3 | ROSIE | WASHINGTON | 1975-09-20 | 2013-03-10 23:11:47 | 566899234 || 4 | SAM | JON | 1975-09-20 | 2013-03-10 23:11:47 | 456778881 || 5 | ROSA | JONES | 1967-11-20 | 2013-03-11 01:26:54 | 987567890 |+------------+------------+------------+------------+---------------------+-----------+5 rows in set (0.00 sec)

mysql> CALL STUDENT_DELETE(5);Query OK, 0 rows affected (0.10 sec)

mysql> SELECT * FROM STUDENTS;+------------+------------+------------+------------+---------------------+-----------+| STUDENT_ID | FIRST_NAME | LAST_NAME | DOB | CREATED_DATE | SNN |+------------+------------+------------+------------+---------------------+-----------+| 1 | MICHAEL | JOHN | 1971-09-20 | 2013-03-11 01:03:58 | 444444444 || 2 | MARY | PLUMBERS | 1975-09-20 | 2013-03-10 23:11:47 | 555555555 |

206

| 3 | ROSIE | WASHINGTON | 1975-09-20 | 2013-03-10 23:11:47 | 566899234 || 4 | SAM | JON | 1975-09-20 | 2013-03-10 23:11:47 | 456778881 |+------------+------------+------------+------------+---------------------+-----------+4 rows in set (0.00 sec)

mysql> SELECT routine_definition -> FROM information_schema.routines -> WHERE -> routine_schema = 'world';+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| routine_definition |+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| BEGIN

START TRANSACTION;DELETE FROM WORLD.STUDENTS WHERE STUDENT_ID = STUDID;

COMMIT;

END || BEGIN

START TRANSACTION;

INSERT INTO WORLD.STUDENTS( FIRST_NAME,LAST_NAME,DOB,SNN) VALUES(FNAME,LNAME,birth,S_NN);

207

COMMIT;

END || BEGIN

DECLARE sql_error TINYINT DEFAULT FALSE;DECLARE CONTINUE HANDLER FOR SQLEXCEPTION

SET sql_error = TRUE;

START TRANSACTION;

UPDATE WORLD.STUDENTS SET DOB = birth WHERE STUDENT_ID = STUDENTID;

IF sql_error = FALSE THEN COMMIT;ELSEROLLBACK;END IF;END |

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+3 rows in set (0.01 sec)

mysql> \T C:\Users\GOC\MYSQL\PROC.SQLmysql> SELECT routine_definition -> FROM information_schema.routines -> WHERE -> routine_schema = 'world';+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

208

| routine_definition |+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| BEGIN

START TRANSACTION;DELETE FROM WORLD.STUDENTS WHERE STUDENT_ID = STUDID;

COMMIT;

END || BEGIN

START TRANSACTION;

INSERT INTO WORLD.STUDENTS( FIRST_NAME,LAST_NAME,DOB,SNN) VALUES(FNAME,LNAME,birth,S_NN);

COMMIT;

END || BEGIN

DECLARE sql_error TINYINT DEFAULT FALSE;DECLARE CONTINUE HANDLER FOR SQLEXCEPTION

SET sql_error = TRUE;

START TRANSACTION;

UPDATE WORLD.STUDENTS

209

SET DOB = birth WHERE STUDENT_ID = STUDENTID;

IF sql_error = FALSE THEN COMMIT;ELSEROLLBACK;END IF;END |

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+3 rows in set (0.01 sec)

Recommended