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

Lab Assignment No1

Uploaded by

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

Lab Assignment No1

Uploaded by

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

Lab Assignment No: 01

Lab Assignment name: Mysql perform with command workbench ,table create ,show table, drop,
distinct,insert,select etc

C:\Users\susha>mysql -u root -p

Enter password: *****

mysql> show databases;

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

| Database |

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

| information |

| information_schema |

| mysql |

| performance_schema |

| sushanta |

| sys |

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

6 rows in set (0.01 sec)

mysql> use infomation;

Database changed

mysql> select * from student;

Empty set (0.01 sec)

mysql> insert into student (Id,Name ,Roll)

-> values(01,'Akash',76478);

Query OK, 1 row affected (0.15 sec)

mysql> select * from student;

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

| Id | Name | Roll |

+------+-------+-------+
| 1 | Akash | 76478 |

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

1 row in set (0.00 sec)

mysql> insert into student (Id,Name ,Roll)

-> values(2,'Rahim',09658);

Query OK, 1 row affected (0.10 sec)

mysql> insert into student (Id,Name ,Roll)

-> values(1,Akash',76478);

'> values(1,Akash',76478;

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 '',76478);

values(1,Akash',76478' at line 2

mysql> insert into student (Id,Name ,Roll)

-> values(2,'Rahim',09658);

Query OK, 1 row affected (0.06 sec)

mysql> select * from student;

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

| Id | Name | Roll |

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

| 1 | Akash | 76478 |

| 2 | Rahim | 9658 |

| 2 | Rahim | 9658 |

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

3 rows in set (0.00 sec)

mysql> select * from student

-> where Name = 'Rahim';


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

| Id | Name | Roll |

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

| 2 | Rahim | 9658 |

| 2 | Rahim | 9658 |

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

2 rows in set (0.00 sec)

mysql> select DISTINCT Name from student;

+-------+

| Name |

+-------+

| Akash |

| Rahim |

+-------+

2 rows in set (0.01 sec)

mysql> select DISTINCT Name,Id,Roll from student;

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

| Name | Id | Roll |

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

| Akash | 1 | 76478 |

| Rahim | 2 | 9658 |

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

2 rows in set (0.00 sec)

mysql>

You might also like