

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between Schema and Database in MySQL?
In MySQL, schema is synonymous with database. As the query is written to create the database, similarly the query can be written to create the schema.
Logical structure can be used by the schema to store data while memory component can be used by the database to store data. Also, a schema is collection of tables while a database is a collection of schema.
To clarify this concept, a database and a schema are created. The steps for this are as follows −
First, a database is created with the following syntax −
create database yourDatabaseName;
The above syntax is used in a query as follows −
mysql> create database DatabaseSample; Query OK, 1 row affected (0.14 sec)
The syntax to create a schema is as follows −
create schema yourSchemaName;
The above syntax is used in a query as follows −
mysql> create schema SchemaSample; Query OK, 1 row affected (0.19 sec)
Now both the database and the schema have been created
To display the database and the schema as well, the show command is used. The query for that is as follows −
mysql> show databases;
The following is the output of the above query
+--------------------+ | Database | +--------------------+ | business | | databasesample | | hello | | information_schema | | mybusiness | | mysql | | performance_schema | | sample | | schemasample | | sys | | test | +--------------------+ 11 rows in set (0.07 sec)
In the oracle database, the schema can be used to represent a part of the database.
- Related Questions & Answers
- Difference between Star Schema and Snowflake Schema?
- Difference Between Schema and Instance
- Difference between Star schema and Snowflake schema in SQL Server
- Difference Between Star and Snowflake Schema
- Difference between _SYS_BIC and _SYS_BI schema in SAP HANA
- Methods for tracking database schema changes in MySQL?
- Difference between Database and a Blockchain
- Difference between Data warehouse and Operational database
- Difference between Operational Database and Data Warehouse?
- Difference between a data warehouse database and an OLTP database?
- What are some good tools to visualize MySQL database schema?
- Difference between Row oriented and column oriented database
- Difference between hierarchical and network database model in SQL
- Difference between Primary key and Foreign key in Database
- Different schema types in SAP HANA database