You are on page 1of 3

(base) student@student-OptiPlex-3020:~$ mysql -u root -p

Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 40
Server version: 5.6.33-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

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 |
| MYDATABASE |
| mydatabase |
| mysql |
| mystore |
| performance_schema |
| prrr |
| student |
| utkarsha |
+--------------------+
9 rows in set (0.03 sec)

mysql> CREATE DATABASE Ak;


Query OK, 1 row affected (0.01 sec)

mysql> SHOW DATABASES;


+--------------------+
| Database |
+--------------------+
| information_schema |
| Ak |
| MYDATABASE |
| mydatabase |
| mysql |
| mystore |
| performance_schema |
| prrr |
| student |
| utkarsha |
+--------------------+
10 rows in set (0.00 sec)

mysql> use Ak;


Database changed
mysql> create table student(Roll_no int(5) , Name varchar(10) , marks float(5));
Query OK, 0 rows affected (0.19 sec)

mysql> desc student ;


+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| Roll_no | int(5) | YES | | NULL | |
| Name | varchar(10) | YES | | NULL | |
| marks | float | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)
mysql> DESC student ;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| Roll_no | int(5) | YES | | NULL | |
| Name | varchar(10) | YES | | NULL | |
| marks | float | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> DESCRIBE student;


+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| Roll_no | int(5) | YES | | NULL | |
| Name | varchar(10) | YES | | NULL | |
| marks | float | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> create table faculty(fac_id int(5) , fac_name varchar(10) , fac_sal


float(5));
Query OK, 0 rows affected (0.19 sec)

mysql> create table book_details(Name varchar(10) , Price int(5) , Title


varchar(10) , Publication varchar(10));
Query OK, 0 rows affected (0.19 sec)

mysql> create table Emp_details(Name varchar(10) , Sal int(5) , Emp_Id int(5));


Query OK, 0 rows affected (0.20 sec)

mysql> DESCRIBE student;


+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| Roll_no | int(5) | YES | | NULL | |
| Name | varchar(10) | YES | | NULL | |
| marks | float | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> DESCRIBE faculty;


+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| fac_id | int(5) | YES | | NULL | |
| fac_name | varchar(10) | YES | | NULL | |
| fac_sal | float | YES | | NULL | |
+----------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> DESCRIBE book_details;


+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| Name | varchar(10) | YES | | NULL | |
| Price | int(5) | YES | | NULL | |
| Title | varchar(10) | YES | | NULL | |
| Publication | varchar(10) | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+
4 rows in set (0.00 sec)

mysql> DESCRIBE Emp_details;


+--------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| Name | varchar(10) | YES | | NULL | |
| Sal | int(5) | YES | | NULL | |
| Emp_Id | int(5) | YES | | NULL | |
+--------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

You might also like