Schema or Database is logical structure in MySQL or MairaDB which consists of tables, views, stored procedures , functions, triggers and other objects. Tables are the objects which are used to store the data in Schema / Database.
While choosing the database name or schema name in MySQL, keep in mind below restrictions
While choosing the database name or schema name in MySQL, keep in mind below restrictions
- Database name in MySQL cannot be longer than 64 characters.
- Database name in MySQL cannot contain / \ or . characters.
- Database name in MySQL cannot contain characters that are not permitted in file names.
- Database name in MySQL cannot end with space character.
You can have space in the database name or schema name in MySQL, in that case you have to use acute character ` around database name or schema name.
Create schema or database in MySQL:
Syntax to create database or schema in MySQL
Create Schema/Database [Schema or DatabaseName];
Let's say if I want to create techbrothers, I can either of below statement.
Or
In case if I need to have space between the tech and brothers, then I will be using acute characters around the database name.
Create Schema techbrothers;
Or
Create Database techbrothers;
Create database `tech brothers`;
Drop Schema or Database in MySQL:
Syntax to drop schema or database in MySQL
Drop Schema/Database [Schema or Database Name]
Video Demo : How to create Schema or Database in MySQL and Drop Schema
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.