Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 8.0.43 MySQL Community Server - GPL
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.07 sec)
mysql> use mysql;
Database changed
mysql> show tables;
+------------------------------------------------------+
| Tables_in_mysql |
+------------------------------------------------------+
| columns_priv |
| component |
| db |
| default_roles |
| engine_cost |
| func |
| general_log |
| global_grants |
| gtid_executed |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| innodb_index_stats |
| innodb_table_stats |
| ndb_binlog_index |
| password_history |
| plugin |
| procs_priv |
| proxies_priv |
| replication_asynchronous_connection_failover |
| replication_asynchronous_connection_failover_managed |
| replication_group_configuration_version |
| replication_group_member_actions |
| role_edges |
| server_cost |
| servers |
| slave_master_info |
| slave_relay_log_info |
| slave_worker_info |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+------------------------------------------------------+
38 rows in set (0.04 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql> USE SYS;
Database changed
mysql> SHOW TABLES;
+-----------------------------------------------+
| Tables_in_sys |
+-----------------------------------------------+
| host_summary |
| host_summary_by_file_io |
| host_summary_by_file_io_type |
| host_summary_by_stages |
| host_summary_by_statement_latency |
| host_summary_by_statement_type |
| innodb_buffer_stats_by_schema |
| innodb_buffer_stats_by_table |
| innodb_lock_waits |
| io_by_thread_by_latency |
| io_global_by_file_by_bytes |
| io_global_by_file_by_latency |
| io_global_by_wait_by_bytes |
| io_global_by_wait_by_latency |
| latest_file_io |
| memory_by_host_by_current_bytes |
| memory_by_thread_by_current_bytes |
| memory_by_user_by_current_bytes |
| memory_global_by_current_bytes |
| memory_global_total |
| metrics |
| processlist |
| ps_check_lost_instrumentation |
| schema_auto_increment_columns |
| schema_index_statistics |
| schema_object_overview |
| schema_redundant_indexes |
| schema_table_lock_waits |
| schema_table_statistics |
| schema_table_statistics_with_buffer |
| schema_tables_with_full_table_scans |
| schema_unused_indexes |
| session |
| session_ssl_status |
| statement_analysis |
| statements_with_errors_or_warnings |
| statements_with_full_table_scans |
| statements_with_runtimes_in_95th_percentile |
| statements_with_sorting |
| statements_with_temp_tables |
| sys_config |
| user_summary |
| user_summary_by_file_io |
| user_summary_by_file_io_type |
| user_summary_by_stages |
| user_summary_by_statement_latency |
| user_summary_by_statement_type |
| version |
| wait_classes_global_by_avg_latency |
| wait_classes_global_by_latency |
| waits_by_host_by_latency |
| waits_by_user_by_latency |
| waits_global_by_latency |
| x$host_summary |
| x$host_summary_by_file_io |
| x$host_summary_by_file_io_type |
| x$host_summary_by_stages |
| x$host_summary_by_statement_latency |
| x$host_summary_by_statement_type |
| x$innodb_buffer_stats_by_schema |
| x$innodb_buffer_stats_by_table |
| x$innodb_lock_waits |
| x$io_by_thread_by_latency |
| x$io_global_by_file_by_bytes |
| x$io_global_by_file_by_latency |
| x$io_global_by_wait_by_bytes |
| x$io_global_by_wait_by_latency |
| x$latest_file_io |
| x$memory_by_host_by_current_bytes |
| x$memory_by_thread_by_current_bytes |
| x$memory_by_user_by_current_bytes |
| x$memory_global_by_current_bytes |
| x$memory_global_total |
| x$processlist |
| x$ps_digest_95th_percentile_by_avg_us |
| x$ps_digest_avg_latency_distribution |
| x$ps_schema_table_statistics_io |
| x$schema_flattened_keys |
| x$schema_index_statistics |
| x$schema_table_lock_waits |
| x$schema_table_statistics |
| x$schema_table_statistics_with_buffer |
| x$schema_tables_with_full_table_scans |
| x$session |
| x$statement_analysis |
| x$statements_with_errors_or_warnings |
| x$statements_with_full_table_scans |
| x$statements_with_runtimes_in_95th_percentile |
| x$statements_with_sorting |
| x$statements_with_temp_tables |
| x$user_summary |
| x$user_summary_by_file_io |
| x$user_summary_by_file_io_type |
| x$user_summary_by_stages |
| x$user_summary_by_statement_latency |
| x$user_summary_by_statement_type |
| x$wait_classes_global_by_avg_latency |
| x$wait_classes_global_by_latency |
| x$waits_by_host_by_latency |
| x$waits_by_user_by_latency |
| x$waits_global_by_latency |
+-----------------------------------------------+
101 rows in set (0.02 sec)
mysql> CREATE DATABASE SCHOOL;
Query OK, 1 row affected (0.03 sec)
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| school |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql> CREAT DDD;
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 'CREAT DDD' at line 1
mysql> USE SCHOOL;
Database changed
mysql> SHOW TABLES;
Empty set (0.00 sec)
mysql> create table student(admno integer,name varchar(20),city varchar(10),marks integer,dob
date);
Query OK, 0 rows affected (0.06 sec)
mysql> create table student1(admno integr,name varchar(20),city varchar(10),marks integer,dob
date);
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 'integr,name varchar(20),city
varchar(10),marks integer,dob date)' at line 1
mysql> show tables;
+------------------+
| Tables_in_school |
+------------------+
| student |
+------------------+
1 row in set (0.00 sec)
mysql> desc student;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| admno | int | YES | | NULL | |
| name | varchar(20) | YES | | NULL | |
| city | varchar(10) | YES | | NULL | |
| marks | int | YES | | NULL | |
| dob | date | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
5 rows in set (0.02 sec)
mysql> insert into student values(1,"ABC","mahasamund",45,"2000/12/06");
Query OK, 1 row affected, 1 warning (0.04 sec)
mysql> insert into student values(2,"XYZ","Saraipali",55,"2001/12/06");
Query OK, 1 row affected, 1 warning (0.02 sec)
mysql> insert into student values(3,"pqr","Raipur",60,"2002/10/01");
Query OK, 1 row affected, 1 warning (0.02 sec)
mysql> select * from student;
+-------+------+------------+-------+------------+
| admno | name | city | marks | dob |
+-------+------+------------+-------+------------+
| 1 | ABC | mahasamund | 45 | 2000-12-06 |
| 2 | XYZ | Saraipali | 55 | 2001-12-06 |
| 3 | pqr | Raipur | 60 | 2002-10-01 |
+-------+------+------------+-------+------------+
3 rows in set (0.00 sec)
mysql> select name from student;
+------+
| name |
+------+
| ABC |
| XYZ |
| pqr |
+------+
3 rows in set (0.00 sec)
mysql> select * from student;
+-------+------+------------+-------+------------+
| admno | name | city | marks | dob |
+-------+------+------------+-------+------------+
| 1 | ABC | mahasamund | 45 | 2000-12-06 |
| 2 | XYZ | Saraipali | 55 | 2001-12-06 |
| 3 | pqr | Raipur | 60 | 2002-10-01 |
+-------+------+------------+-------+------------+
3 rows in set (0.00 sec)
mysql> select name,dob from student;
+------+------------+
| name | dob |
+------+------------+
| ABC | 2000-12-06 |
| XYZ | 2001-12-06 |
| pqr | 2002-10-01 |
+------+------------+
3 rows in set (0.00 sec)
mysql> select dob city from student;
+------------+
| city |
+------------+
| 2000-12-06 |
| 2001-12-06 |
| 2002-10-01 |
+------------+
3 rows in set (0.00 sec)
mysql> select dob ,city from student;
+------------+------------+
| dob | city |
+------------+------------+
| 2000-12-06 | mahasamund |
| 2001-12-06 | Saraipali |
| 2002-10-01 | Raipur |
+------------+------------+
3 rows in set (0.00 sec)
mysql> select * from student;
+-------+------+------------+-------+------------+
| admno | name | city | marks | dob |
+-------+------+------------+-------+------------+
| 1 | ABC | mahasamund | 45 | 2000-12-06 |
| 2 | XYZ | Saraipali | 55 | 2001-12-06 |
| 3 | pqr | Raipur | 60 | 2002-10-01 |
+-------+------+------------+-------+------------+
3 rows in set (0.00 sec)
mysql> select * from student where city="Raipur";
+-------+------+--------+-------+------------+
| admno | name | city | marks | dob |
+-------+------+--------+-------+------------+
| 3 | pqr | Raipur | 60 | 2002-10-01 |
+-------+------+--------+-------+------------+
1 row in set (0.02 sec)
mysql> select * from student where admno>2;
+-------+------+--------+-------+------------+
| admno | name | city | marks | dob |
+-------+------+--------+-------+------------+
| 3 | pqr | Raipur | 60 | 2002-10-01 |
+-------+------+--------+-------+------------+
1 row in set (0.00 sec)
mysql> select * from student where admno>=2;
+-------+------+-----------+-------+------------+
| admno | name | city | marks | dob |
+-------+------+-----------+-------+------------+
| 2 | XYZ | Saraipali | 55 | 2001-12-06 |
| 3 | pqr | Raipur | 60 | 2002-10-01 |
+-------+------+-----------+-------+------------+
2 rows in set (0.00 sec)
mysql> select * from student where admno>=2 and admno<=5;
+-------+------+-----------+-------+------------+
| admno | name | city | marks | dob |
+-------+------+-----------+-------+------------+
| 2 | XYZ | Saraipali | 55 | 2001-12-06 |
| 3 | pqr | Raipur | 60 | 2002-10-01 |
+-------+------+-----------+-------+------------+
2 rows in set (0.00 sec)