0% found this document useful (0 votes)
36 views

MySQL 8.1 Command Line Client

ip
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

MySQL 8.1 Command Line Client

ip
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Enter password: ***********

Welcome to the MySQL monitor. Commands end with ; or \g.


Your MySQL connection id is 9
Server version: 8.1.0 MySQL Community Server - GPL

Copyright (c) 2000, 2023, 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> create database blockchain;


Query OK, 1 row affected (0.04 sec)

mysql> use database blockchain;


ERROR 1049 (42000): Unknown database 'database'
mysql> use blockchain;
Database changed
mysql> create database (
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntaxto use near '(' at
line 1
mysql> create table blockchain (
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntaxto use near '' at line
1
mysql> create table block(
-> id int PRIMARY KEY,
-> user char(50),
-> value int,
-> hash varchar(50),
-> transaction_date DATE);
Query OK, 0 rows affected (0.04 sec)

mysql> show table block;


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntaxto use near 'block' at
line 1
mysql> desc block;
+------------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------+-------------+------+-----+---------+-------+
| id | int | NO | PRI | NULL | |
| user | char(50) | YES | | NULL | |
| value | int | YES | | NULL | |
| hash | varchar(50) | YES | | NULL | |
| transaction_date | date | YES | | NULL | |
+------------------+-------------+------+-----+---------+-------+
5 rows in set (0.03 sec)

mysql> insert into block values (1,"steve",900,"ERTYU","2020-09-19");


Query OK, 1 row affected (0.01 sec)

mysql> select*from block


-> ;
+----+-------+-------+-------+------------------+
| id | user | value | hash | transaction_date |
+----+-------+-------+-------+------------------+
| 1 | steve | 900 | ERTYU | 2020-09-19 |
+----+-------+-------+-------+------------------+
1 row in set (0.00 sec)

mysql> insert into block values (2,"meesha",145,"@345r","2021-03-23");


Query OK, 1 row affected (0.00 sec)

mysql> insert into block values (3,"nimsha",567,"#wert5","2020-05-06");

Query OK, 1 row affected (0.00 sec)

mysql> insert into block values (4,"pihu",678,"%rtyu","2022-07-13");


Query OK, 1 row affected (0.00 sec)

mysql> insert into block values (5,"kopal",768,"rrt4%","2021-05-15");


Query OK, 1 row affected (0.00 sec)

mysql> insert into block values (7,"palakshi",534,"wer03","2022-11-29")


;
Query OK, 1 row affected (0.00 sec)

mysql> show*table block;


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntaxto use near '*table
block' at line 1
mysql> select*from block
-> ;
+----+----------+-------+--------+------------------+
| id | user | value | hash | transaction_date |
+----+----------+-------+--------+------------------+
| 1 | steve | 900 | ERTYU | 2020-09-19 |
| 2 | meesha | 145 | @345r | 2021-03-23 |
| 3 | nimsha | 567 | #wert5 | 2020-05-06 |
| 4 | pihu | 678 | %rtyu | 2022-07-13 |
| 5 | kopal | 768 | rrt4% | 2021-05-15 |
| 7 | palakshi | 534 | wer03 | 2022-11-29 |
+----+----------+-------+--------+------------------+
6 rows in set (0.00 sec)

mysql>

You might also like