Hello,
I'm having trouble determining the difference between CREATE SCHEMA and CREATE DATABASE. I'm of the understanding that they are the same and that it's usual to use the latter.
Is that so?
Thanks!
Hello,
I'm having trouble determining the difference between CREATE SCHEMA and CREATE DATABASE. I'm of the understanding that they are the same and that it's usual to use the latter.
Is that so?
Thanks!
CREATE schema is to create a schema above the database. So can a CREATE SCHEMA create tables, views, etc etc.
CREATE SCHEMA can't create a database.
They are definitely not that same! A database may consist of several schemas. Schemas are basically securable objects that can contain other securable objects such as tables, views, procedures etc. Securable in this context means something that is owned by someone and to which operations can be granted.
Create schema creates new schema while create database creates database. See this link for more information about schemas: User-Schema Separation
In MySQL, the two commands are synonymous from 5.0.2 upwards - this is perhaps why you had the understanding they were the same.
http://dev.mysql.com/doc/refman/5.0/en/create-database.html
However, as the others have mentioned, Schemas and Databases are different types of entity in other RDBMS.