2. Write SQL query for given problem statement

Sahil Sahani
0


2 Practical . Write SQL query for given problem statement

A) Viewing all databases : 
In MySQL, you can view a list of all databases using the following SQL command:
> show databases;

mysql> show databases;
+------------------+
|Databases         |
+------------------+
|information_schema|
|bank_system       |
|college           | 
|sahil138          |
+------------------+
7 rows in set (0.01 sec)

B) Creating a Databases:
In MySQL, you can create a new database using the CREATE DATABASE statement. Here's the basic syntax: create databases [IF NOT EXISTS] database_name;

mysql> create databases sahil38;
Query OK, 1 row affectedn(0.01 sec)
    

C) Use Databases:
After creating the database, you can use it by selecting it with the USE statement:
syntax : USE database_name;

mysql> use sahil38;
Database changed
    

D) Viewing all Tables in a Databases:
To view all tables from your database, you can use the following SQL query:
>show tables;


mysql> show tables;
+------------------+
|Tables_in_sahil38 |
+------------------+
|sahil_info        |
+------------------+
1 row is set (0.00 sec)
    

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)