You are on page 1of 20

EXPT-6 OPEN SOURCE COMPUTING

EXPT: 06 METADATA, COLLATE, JOINS AND VIEWS IN MYSQL


DATE: 25-08-10

AIM:

To perform operations such as Meta data, Collate, Joins, Views concept in Mysql.

PROCEDURE:

META DATA:

mysql> select table_name,table_type,engine from information_schema.tables where


table_schema='emp_info'order by table_type DESC;

+------------+------------+--------+

| table_name | table_type | engine |

+------------+------------+--------+

| emp | BASE TABLE | InnoDB |

+------------+------------+--------+

1 row in set (0.04 sec)

mysql> show variables like'character_set_system';

+----------------------+-------+

| Variable_name | Value |

+----------------------+-------+

| character_set_system | utf8 |

+----------------------+-------+

1 row in set (0.00 sec)

mysql> show variables like'character_set_results';

+-----------------------+--------+

| Variable_name | Value |

+-----------------------+--------+

| character_set_results | latin1 |

+-----------------------+--------+

1 row in set (0.00 sec)

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

COLLATE:

Using collate in SQL Statements (Collate is just to write in the Observation note and
record not for execution)

The COLLATE clause is used to override whatever the default collation is for a comparison.
COLLATE may be used in various parts of SQL statements.

4. With ORDER BY:

mysql> select table_name,table_type,engine from information_schema.tables


wheretable_schema ='emp_info'order by table_name COLLATE utf8_bin='emp_name';

+------------+------------+--------+

| table_name | table_type | engine |

+------------+------------+--------+

| emp | BASE TABLE | InnoDB |

+------------+------------+--------+

1 row in set (0.01 sec)

mysql> select table_name,table_type from information_schema.tables order by


table_name COLLATE utf8_general_ci;

+---------------------------------------+-------------+

| table_name | table_type |

+---------------------------------------+-------------+

| CHARACTER_SETS | SYSTEM VIEW |

| COLLATIONS | SYSTEM VIEW |

| COLLATION_CHARACTER_SET_APPLICABILITY | SYSTEM VIEW |

| COLUMNS | SYSTEM VIEW |

| columns_priv | BASE TABLE |

| COLUMN_PRIVILEGES | SYSTEM VIEW |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| db | BASE TABLE |

| emp | BASE TABLE |

| ENGINES | SYSTEM VIEW |

| event | BASE TABLE |

| EVENTS | SYSTEM VIEW |

| FILES | SYSTEM VIEW |

| func | BASE TABLE |

| general_log | BASE TABLE |

| GLOBAL_STATUS | SYSTEM VIEW |

| GLOBAL_VARIABLES | SYSTEM VIEW |

| help_category | BASE TABLE |

| help_keyword | BASE TABLE |

| help_relation | BASE TABLE |

| help_topic | BASE TABLE |

| host | BASE TABLE |

| KEY_COLUMN_USAGE | SYSTEM VIEW |

| ndb_binlog_index | BASE TABLE |

| PARTITIONS | SYSTEM VIEW |

| plugin | BASE TABLE |

| PLUGINS | SYSTEM VIEW |

| proc | BASE TABLE |

| PROCESSLIST | SYSTEM VIEW |

| procs_priv | BASE TABLE |

| PROFILING | SYSTEM VIEW |

| REFERENTIAL_CONSTRAINTS | SYSTEM VIEW |

| ROUTINES | SYSTEM VIEW |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| SCHEMATA | SYSTEM VIEW |

| SCHEMA_PRIVILEGES | SYSTEM VIEW |

| servers | BASE TABLE |

| SESSION_STATUS | SYSTEM VIEW |

| SESSION_VARIABLES | SYSTEM VIEW |

| slow_log | BASE TABLE |

| STATISTICS | SYSTEM VIEW |

| TABLES | SYSTEM VIEW |

| tables_priv | BASE TABLE |

| TABLE_CONSTRAINTS | SYSTEM VIEW |

| TABLE_PRIVILEGES | SYSTEM VIEW |

| time_zone | BASE TABLE |

| time_zone_leap_second | BASE TABLE |

| time_zone_name | BASE TABLE |

| time_zone_transition | BASE TABLE |

| time_zone_transition_type | BASE TABLE |

| TRIGGERS | SYSTEM VIEW |

| user | BASE TABLE |

| USER_PRIVILEGES | SYSTEM VIEW |

| VIEWS | SYSTEM VIEW |

+---------------------------------------+-------------+

52 rows in set (0.17 sec)

5. With AS:

mysql> select table_name,table_type COLLATE utf8_general_ci AS


table_name,table_type from information_schema.tables;

+---------------------------------------+-------------+-------------+

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| table_name | table_name | table_type |

+---------------------------------------+-------------+-------------+

| CHARACTER_SETS | SYSTEM VIEW | SYSTEM VIEW |

| COLLATIONS | SYSTEM VIEW | SYSTEM VIEW |

| COLLATION_CHARACTER_SET_APPLICABILITY | SYSTEM VIEW | SYSTEM VIEW |

| COLUMNS | SYSTEM VIEW | SYSTEM VIEW |

| COLUMN_PRIVILEGES | SYSTEM VIEW | SYSTEM VIEW |

| ENGINES | SYSTEM VIEW | SYSTEM VIEW |

| EVENTS | SYSTEM VIEW | SYSTEM VIEW |

| FILES | SYSTEM VIEW | SYSTEM VIEW |

| GLOBAL_STATUS | SYSTEM VIEW | SYSTEM VIEW |

| GLOBAL_VARIABLES | SYSTEM VIEW | SYSTEM VIEW |

| KEY_COLUMN_USAGE | SYSTEM VIEW | SYSTEM VIEW |

| PARTITIONS | SYSTEM VIEW | SYSTEM VIEW |

| PLUGINS | SYSTEM VIEW | SYSTEM VIEW |

| PROCESSLIST | SYSTEM VIEW | SYSTEM VIEW |

| PROFILING | SYSTEM VIEW | SYSTEM VIEW |

| REFERENTIAL_CONSTRAINTS | SYSTEM VIEW | SYSTEM VIEW |

| ROUTINES | SYSTEM VIEW | SYSTEM VIEW |

| SCHEMATA | SYSTEM VIEW | SYSTEM VIEW |

| SCHEMA_PRIVILEGES | SYSTEM VIEW | SYSTEM VIEW |

| SESSION_STATUS | SYSTEM VIEW | SYSTEM VIEW |

| SESSION_VARIABLES | SYSTEM VIEW | SYSTEM VIEW |

| STATISTICS | SYSTEM VIEW | SYSTEM VIEW |

| TABLES | SYSTEM VIEW | SYSTEM VIEW |

| TABLE_CONSTRAINTS | SYSTEM VIEW | SYSTEM VIEW |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| TABLE_PRIVILEGES | SYSTEM VIEW | SYSTEM VIEW |

| TRIGGERS | SYSTEM VIEW | SYSTEM VIEW |

| USER_PRIVILEGES | SYSTEM VIEW | SYSTEM VIEW |

| VIEWS | SYSTEM VIEW | SYSTEM VIEW |

| emp | BASE TABLE | BASE TABLE |

| columns_priv | BASE TABLE | BASE TABLE |

| db | BASE TABLE | BASE TABLE |

| event | BASE TABLE | BASE TABLE |

| func | BASE TABLE | BASE TABLE |

| general_log | BASE TABLE | BASE TABLE |

| help_category | BASE TABLE | BASE TABLE |

| help_keyword | BASE TABLE | BASE TABLE |

| help_relation | BASE TABLE | BASE TABLE |

| help_topic | BASE TABLE | BASE TABLE |

| host | BASE TABLE | BASE TABLE |

| ndb_binlog_index | BASE TABLE | BASE TABLE |

| plugin | BASE TABLE | BASE TABLE |

| proc | BASE TABLE | BASE TABLE |

| procs_priv | BASE TABLE | BASE TABLE |

| servers | BASE TABLE | BASE TABLE |

| slow_log | BASE TABLE | BASE TABLE |

| tables_priv | BASE TABLE | BASE TABLE |

| time_zone | BASE TABLE | BASE TABLE |

| time_zone_leap_second | BASE TABLE | BASE TABLE |

| time_zone_name | BASE TABLE | BASE TABLE |

| time_zone_transition | BASE TABLE | BASE TABLE |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| time_zone_transition_type | BASE TABLE | BASE TABLE |

| user | BASE TABLE | BASE TABLE |

+---------------------------------------+-------------+-------------+

52 ows in set (0.02 sec)

6. With GROUP BY:

mysql> select table_name,table_type from information_schema.tables group by


table_name COLLATE utf8_general_ci;

+---------------------------------------+-------------+

| table_name | table_type |

+---------------------------------------+-------------+

| CHARACTER_SETS | SYSTEM VIEW |

| COLLATIONS | SYSTEM VIEW |

| COLLATION_CHARACTER_SET_APPLICABILITY | SYSTEM VIEW |

| COLUMNS | SYSTEM VIEW |

| columns_priv | BASE TABLE |

| COLUMN_PRIVILEGES | SYSTEM VIEW |

| db | BASE TABLE |

| emp | BASE TABLE |

| ENGINES | SYSTEM VIEW |

| event | BASE TABLE |

| EVENTS | SYSTEM VIEW |

| FILES | SYSTEM VIEW |

| func | BASE TABLE |

| general_log | BASE TABLE |

| GLOBAL_STATUS | SYSTEM VIEW |

| GLOBAL_VARIABLES | SYSTEM VIEW |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| help_category | BASE TABLE |

| help_keyword | BASE TABLE |

| help_relation | BASE TABLE |

| help_topic | BASE TABLE |

| host | BASE TABLE |

| KEY_COLUMN_USAGE | SYSTEM VIEW |

| ndb_binlog_index | BASE TABLE |

| PARTITIONS | SYSTEM VIEW |

| plugin | BASE TABLE |

| PLUGINS | SYSTEM VIEW |

| proc | BASE TABLE |

| PROCESSLIST | SYSTEM VIEW |

| procs_priv | BASE TABLE |

| PROFILING | SYSTEM VIEW |

| REFERENTIAL_CONSTRAINTS | SYSTEM VIEW |

| ROUTINES | SYSTEM VIEW |

| SCHEMATA | SYSTEM VIEW |

| SCHEMA_PRIVILEGES | SYSTEM VIEW |

| servers | BASE TABLE |

| SESSION_STATUS | SYSTEM VIEW |

| SESSION_VARIABLES | SYSTEM VIEW |

| slow_log | BASE TABLE |

| STATISTICS | SYSTEM VIEW |

| TABLES | SYSTEM VIEW |

| tables_priv | BASE TABLE |

| TABLE_CONSTRAINTS | SYSTEM VIEW |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| TABLE_PRIVILEGES | SYSTEM VIEW |

| time_zone | BASE TABLE |

| time_zone_leap_second | BASE TABLE |

| time_zone_name | BASE TABLE |

| time_zone_transition | BASE TABLE |

| time_zone_transition_type | BASE TABLE |

| TRIGGERS | SYSTEM VIEW |

| user | BASE TABLE |

| USER_PRIVILEGES | SYSTEM VIEW |

| VIEWS | SYSTEM VIEW |

+---------------------------------------+-------------+

52 ows in set (0.02 sec)

7. With aggregate functions:

mysql> select MAX(table_name collate utf8_general_ci)from information_schema.tables;

+-----------------------------------------+

| MAX(table_name collate utf8_general_ci) |

+-----------------------------------------+

| VIEWS |

+-----------------------------------------+

1 row in set (0.01 sec)

8. With DISTINCT:

mysql> select DISTINCT table_name,table_type COLLATE utf8_general_ci from


information_schema.tables;

+---------------------------------------+------------------------------------+

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| table_name | table_type COLLATE utf8_general_ci |

+---------------------------------------+------------------------------------+

| CHARACTER_SETS | SYSTEM VIEW |

| COLLATIONS | SYSTEM VIEW |

| COLLATION_CHARACTER_SET_APPLICABILITY | SYSTEM VIEW |

| COLUMNS | SYSTEM VIEW |

| COLUMN_PRIVILEGES | SYSTEM VIEW |

| ENGINES | SYSTEM VIEW |

| EVENTS | SYSTEM VIEW |

| FILES | SYSTEM VIEW |

| GLOBAL_STATUS | SYSTEM VIEW |

| GLOBAL_VARIABLES | SYSTEM VIEW |

| KEY_COLUMN_USAGE | SYSTEM VIEW |

| PARTITIONS | SYSTEM VIEW |

| PLUGINS | SYSTEM VIEW |

| PROCESSLIST | SYSTEM VIEW |

| PROFILING | SYSTEM VIEW |

| REFERENTIAL_CONSTRAINTS | SYSTEM VIEW |

| ROUTINES | SYSTEM VIEW |

| SCHEMATA | SYSTEM VIEW |

| SCHEMA_PRIVILEGES | SYSTEM VIEW |

| SESSION_STATUS | SYSTEM VIEW |

| SESSION_VARIABLES | SYSTEM VIEW |

| STATISTICS | SYSTEM VIEW |

| TABLES | SYSTEM VIEW |

| TABLE_CONSTRAINTS | SYSTEM VIEW |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| TABLE_PRIVILEGES | SYSTEM VIEW |

| TRIGGERS | SYSTEM VIEW |

| USER_PRIVILEGES | SYSTEM VIEW |

| VIEWS | SYSTEM VIEW |

| emp | BASE TABLE |

| columns_priv | BASE TABLE |

| db | BASE TABLE |

| event | BASE TABLE |

| func | BASE TABLE |

| general_log | BASE TABLE |

| help_category | BASE TABLE |

| help_keyword | BASE TABLE |

| help_relation | BASE TABLE |

| help_topic | BASE TABLE |

| host | BASE TABLE |

| ndb_binlog_index | BASE TABLE |

| plugin | BASE TABLE |

| proc | BASE TABLE |

| procs_priv | BASE TABLE |

| servers | BASE TABLE |

| slow_log | BASE TABLE |

| tables_priv | BASE TABLE |

| time_zone | BASE TABLE |

| time_zone_leap_second | BASE TABLE |

| time_zone_name | BASE TABLE |

| time_zone_transition | BASE TABLE |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| time_zone_transition_type | BASE TABLE |

| user | BASE TABLE |

+---------------------------------------+------------------------------------+

52 ows in set (0.02 sec)

9. With WHERE:

mysql> select * from information_schema.tables where _latin1'Muller'collate


latin1_general_ci='table_name';

Empty set (0.00 sec)

mysql> select table_name,table_type from information_schema.tables where table_n

ame like _utf8'muller'collate utf8_general_ci='table_name';

+---------------------------------------+-------------+

| table_name | table_type |

+---------------------------------------+-------------+

| CHARACTER_SETS | SYSTEM VIEW |

| COLLATIONS | SYSTEM VIEW |

| COLLATION_CHARACTER_SET_APPLICABILITY | SYSTEM VIEW |

| COLUMNS | SYSTEM VIEW |

| COLUMN_PRIVILEGES | SYSTEM VIEW |

| ENGINES | SYSTEM VIEW |

| EVENTS | SYSTEM VIEW |

| FILES | SYSTEM VIEW |

| GLOBAL_STATUS | SYSTEM VIEW |

| GLOBAL_VARIABLES | SYSTEM VIEW |

| KEY_COLUMN_USAGE | SYSTEM VIEW |

| PARTITIONS | SYSTEM VIEW |

| PLUGINS | SYSTEM VIEW |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| PROCESSLIST | SYSTEM VIEW |

| PROFILING | SYSTEM VIEW |

| REFERENTIAL_CONSTRAINTS | SYSTEM VIEW |

| ROUTINES | SYSTEM VIEW |

| SCHEMATA | SYSTEM VIEW |

| SCHEMA_PRIVILEGES | SYSTEM VIEW |

| SESSION_STATUS | SYSTEM VIEW |

| SESSION_VARIABLES | SYSTEM VIEW |

| STATISTICS | SYSTEM VIEW |

| TABLES | SYSTEM VIEW |

| TABLE_CONSTRAINTS | SYSTEM VIEW |

| TABLE_PRIVILEGES | SYSTEM VIEW |

| TRIGGERS | SYSTEM VIEW |

| USER_PRIVILEGES | SYSTEM VIEW |

| VIEWS | SYSTEM VIEW |

| emp | BASE TABLE |

| columns_priv | BASE TABLE |

| db | BASE TABLE |

| event | BASE TABLE |

| func | BASE TABLE |

| general_log | BASE TABLE |

| help_category | BASE TABLE |

| help_keyword | BASE TABLE |

| help_relation | BASE TABLE |

| help_topic | BASE TABLE |

| host | BASE TABLE |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| ndb_binlog_index | BASE TABLE |

| plugin | BASE TABLE |

| proc | BASE TABLE |

| procs_priv | BASE TABLE |

| servers | BASE TABLE |

| slow_log | BASE TABLE |

| tables_priv | BASE TABLE |

| time_zone | BASE TABLE |

| time_zone_leap_second | BASE TABLE |

| time_zone_name | BASE TABLE |

| time_zone_transition | BASE TABLE |

| time_zone_transition_type | BASE TABLE |

| user | BASE TABLE |

+---------------------------------------+-------------+

52 rows in set, 104 warnings (0.02 sec)

10.With HAVING:

mysql> select table_name,table_type from information_schema.tables group by


table_name HAVING table_name= _utf8 ''collate utf8_general_ci;

Empty set (0.02 sec)

JOINS:

A join is a SQL query that is used to select the data from more than one table or views. When
you define multiple tables or views in the FROM clause of a query the MySQL performs a join
that linking the rows from multiple tables together.

Types of Joins :

INNER Joins

OUTER Joins

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

SELF Joins

mysql> show tables;

+--------------------+

| Tables_in_emp_info |

+--------------------+

| emp |

| employee |

+--------------------+

2 rows in set (0.00 sec)

mysql> select * from emp;

+----------+--------+------------+------------+

| emp_name | emp_id | emp_salary | emp_dob |

+----------+--------+------------+------------+

| surean | e1 | 50000 | 1987-07-10 |

| vimal | e2 | 45000 | 2000-03-03 |

| sekar | e3 | 30000 | 2004-01-07 |

| guru | e4 | 65000 | 2010-01-01 |

| vishnu | e5 | 32000 | 2010-10-10 |

| dhivagar | e6 | 55000 | 1999-06-08 |

| kannan | e7 | 80000 | 2009-09-09 |

+----------+--------+------------+------------+

7 rows in set (0.00 sec)

mysql> select * from employee;

+--------+-----------+-----------+

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| emp_id | emp_fname | emp_lname |

+--------+-----------+-----------+

| e1 | sunil | kumar |

| e2 | raj | kumar |

| e4 | guru | singh |

| e3 | ram | shankar |

| e9 | prem | kumar |

| e10 | anandha | krishnan |

+--------+-----------+-----------+

6 rows in set (0.00 sec)

INNER JOIN:

mysql> select * from emp inner join employee where emp.emp_id = employee.emp_id;

+----------+--------+------------+------------+--------+-----------+-----------+

| emp_name | emp_id | emp_salary | emp_dob | emp_id | emp_fname | emp_lname |

+----------+--------+------------+------------+--------+-----------+-----------+

| surean | e1 | 50000 | 1987-07-10 | e1 | sunil | kumar |

| vimal | e2 | 45000 | 2000-03-03 | e2 | raj | kumar |

| sekar | e3 | 30000 | 2004-01-07 | e3 | ram | shankar |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

| guru | e4 | 65000 | 2010-01-01 | e4 | guru | singh |

+----------+--------+------------+------------+--------+-----------+-----------+

4 rows in set (0.00 sec)

OUTER JOIN:

LEFT OUTER JOIN:

mysql> select * from emp LEFT OUTER JOIN employee on


emp.emp_id=employee.emp_id;

+----------+--------+------------+------------+--------+-----------+-----------+

| emp_name | emp_id | emp_salary | emp_dob | emp_id | emp_fname | emp_lname |

+----------+--------+------------+------------+--------+-----------+-----------+

| surean | e1 | 50000 | 1987-07-10 | e1 | sunil | kumar |

| vimal | e2 | 45000 | 2000-03-03 | e2 | raj | kumar |

| sekar | e3 | 30000 | 2004-01-07 | e3 | ram | shankar |

| guru | e4 | 65000 | 2010-01-01 | e4 | guru | singh |

| vishnu | e5 | 32000 | 2010-10-10 | NULL | NULL | NULL |

| dhivagar | e6 | 55000 | 1999-06-08 | NULL | NULL | NULL |

| kannan | e7 | 80000 | 2009-09-09 | NULL | NULL | NULL |

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

+----------+--------+------------+------------+--------+-----------+-----------+

7 rows in set (0.00 sec)

RIGHT OUTER JOIN:

mysql> select * from emp RIGHT OUTER JOIN employee on


emp.emp_id=employee.emp_id;

+----------+--------+------------+------------+--------+-----------+-----------+

| emp_name | emp_id | emp_salary | emp_dob | emp_id | emp_fname | emp_lname |

+----------+--------+------------+------------+--------+-----------+-----------+

| surean | e1 | 50000 | 1987-07-10 | e1 | sunil | kumar |

| vimal | e2 | 45000 | 2000-03-03 | e2 | raj | kumar |

| guru | e4 | 65000 | 2010-01-01 | e4 | guru | singh |

| sekar | e3 | 30000 | 2004-01-07 | e3 | ram | shankar |

| NULL | NULL | NULL | NULL | e9 | prem | kumar |

| NULL | NULL | NULL | NULL | e10 | anandha | krishnan |

+----------+--------+------------+------------+--------+-----------+-----------+

6 rows in set (0.00 sec)

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

SELF JOIN:

mysql> select a.emp_name,a.emp_id,a.emp_salary,a.emp_dob from emp a,emp b where


a.emp_id=b.emp_id;

+----------+--------+------------+------------+

| emp_name | emp_id | emp_salary | emp_dob |

+----------+--------+------------+------------+

| surean | e1 | 50000 | 1987-07-10 |

| vimal | e2 | 45000 | 2000-03-03 |

| sekar | e3 | 30000 | 2004-01-07 |

| guru | e4 | 65000 | 2010-01-01 |

| vishnu | e5 | 32000 | 2010-10-10 |

| dhivagar | e6 | 55000 | 1999-06-08 |

| kannan | e7 | 80000 | 2009-09-09 |

+----------+--------+------------+------------+

7 rows in set (0.32 sec)

VIEWS:

VIEW is a virtual table, which acts like a table but actually it contains no data. That is
based on the result set of a SELECT statement.
A VIEW consists rows and columns from one or more than one tables. A VIEW is a query
that’s stored as an object. A VIEW is nothing more than a way to select a subset of table’s
columns.
When you defined a view then you can reference it like any other table in a database. A
VIEW provides as a security mechanism also. VIEWS ensures that users are able to modify
and retrieve only that data which seen by them. 
By using Views you can ensure about the security of data by restricting access to the
following data:
 Specific columns of the tables. 
 Specific rows of the tables. 

 Specific rows and columns of the tables. 

 Subsets of another view or a subset of views and tables

SURENDRAN.M
09I450
EXPT-6 OPEN SOURCE COMPUTING

 Rows fetched by using joins. 

 Statistical summary of data in a given tables. 

mysql> create view it_employee as select * from emp where emp_id in(select emp_id
from employee)with CHECK OPTION;

Query OK, 0 rows affected (0.08 sec)

mysql> select * from it_employee;

+----------+--------+------------+------------+

| emp_name | emp_id | emp_salary | emp_dob |

+----------+--------+------------+------------+

| surean | e1 | 50000 | 1987-07-10 |

| vimal | e2 | 45000 | 2000-03-03 |

| sekar | e3 | 30000 | 2004-01-07 |

| guru | e4 | 65000 | 2010-01-01 |

+----------+--------+------------+------------+

4 rows in set (0.00 sec)

RESULT:

Thus the concept of MetaData, Collate, Joins, Views are implemented in Mysql queries
successfully.

SURENDRAN.M
09I450

You might also like