Schema Vs. User
Technically, a schema is a collection of database objects owned by a specific user. Those objects include tables, indexes, views, stored procedures, etc. In Oracle, a schema requires a user to be created. But you can create a user that has no schema (i.e, no objects). So in Oracle, the user is the account and the schema is the objects.
声音1;
Schema Vs. User
Whenever a new user is created, a schema with the same name as of user is also created. The user owns the schema and all the objects created in his schema.
The term 'user' is normally used in context to 'login' and schema is used while refering to database objects e.g. tables, views etc. However, both terms could be used interchangeably and you can consider a user to be schema and vica versa.
声音2;
-------------------------------------------------痴情的分割线-------------------------------------
schema vs. database
声音1:
Schema Vs Database
It seems that schema and database are interchangeable terms with the same meaning in MySQL, is that right? Is this how it is in other RDBMSs, or is MySQL different in this regard?
Looking up briefly on other RDBMSs, it seems that they use database to refer to the database (good description, huh? ) and schema to refer to the "owner" of that database?
I don't really know what the difference is, and how to define on versus the other. Can somebody explain the difference (better than my "a database is a database"), and why other RDBMSs see a need to do it this way (i.e. what's the benefit of implementing a whole other concept known as schema)?
Does MySQL have plans to change things in the future on this issue?
Or have I totally misunderstood the concepts of database vs schema, and how MySQL defines it?
声音2:
A schema is essentially a logical grouping of SQL objects, like tables, views and stored procedures etc.
But it is used very different by different DB's.
In Oracle for example you create a DB and in the DB you then create users where each user gets an implicit schema named the same.
When you then create tables you do this in a specific schema which means that the names doesn't collide if different users are using the same table name.
In Oracle you need to choose which schema you want to work with much like you choose a database in MySQL.
The thing is that what makes this very confusing is that Oracle has an extra level of abstraction that doesnt' exist at all in MySQL.
You can sort of look at it like this:
Oracle:
table->schema->database
MySQL:
table->database
Because Oracle and MySQL has a very different view of what is a database. Because a database in MySQL is much more like a schema in Oracle.
In Oracle a database is a separate set of data files and a separate set of processes running. While in MySQL it is only one process running.
So summary is that schema is a logical grouping of database objects inside a database. Making it possible to have several tables with the same name in the same database.
声音3:
Schema vs Database?
A database can be described as a collection of structured data that usually are stored in computer systems. The structure for a database is arrived at by properly organizing the data with the help of a database model. The term “schema” means “a plan or a shape” and can be defined as the terminology used to model or create a logical structure using which data can be stored in a database. Technically speaking, a database schema is the underlying structure described by and supported by the database management system that is used to store records.
Generally, a schema is a higher level of abstraction of the design models which are captured and documented by database designers and business analysts during the analysis phase of a project or product development. They do not exist as such in a database, but in some variants of databases they can be realized at some levels in a physical form.
When we bring a user into this perspective, then we can define these three entities (database, schema, and user) as below:
Database is a collection of physical files.
A user is one who connects to a database.
Schema is the collection of objects which are owned by the user.
To sum it up briefly, a schema is usually a graphical representation of the database system’s structure whereas the database itself is a structured collection of records or data.
Summary:
1.A database is the physical structure.
2.Schema is the logical structure.
3.A database is a collection of related records and data stored in tables.
4.A schema, on the other hand, is a logical definition of the database or, in other words, a blueprint that defines the names of all the tables and columns and defines what type each column is, etc.
5.In some database management systems, a schema can be realized in a physical form at any of the levels.
6.There is no one-on-one correspondence between schema objects and the physical files which store information on disks.
Read more: Difference Between Schema and Database | Difference Between | Schema vs Database http://www.differencebetween.net/technology/software-technology/difference-between-schema-and-database/#ixzz1SdugG4M0
声音四:
14 INTRODUCTION TO DATABASE SYSTEM
S 1.8.3 Physical Data Model
Physical data model describes the data in terms of a collection of fi les, indices, and other storage struc
-tures such as record formats, record ordering, and access paths. This model specifi es how the database
will be executed in a particular DBMS software such as Oracle, Sybase, etc., by taking into account
the facilities and constraints of a given database management system. It also describes how the data is
stored on disk and what access methods are available to it.
NOTE An access path (for example , an index) is a structure that helps in effi cient searching
and retrieval of data from a particular database .
P_ID Pname Address State Phone Email_id
P001 Hills
Publications 12, Park street,
Atlanta Georgia 7134019 h_pub@hills.com
P002 Sunshine
Publishers
Ltd. 45, Second street,
Newark New
Jersey 6548909 Null
P003 Bright
Publications 123, Main street,
Honolulu Hawai 7678985 bright@bp.com
P004 Paramount
Publishing
House 789, Oak street,
New York New
York 9254834 param_house@
param.com
P005 Wesley
Publications 456, First street,
Las Vegas Nevada 5683452 Null
Fig. 1.7 An example of instance - PUBLISHER instance
The schema and instance can be compared with a program written in a programming language.
The database schema is similar to a variable declared along with the type description in a program.
The variable contains a value at a given point of time. This value of a variable corresponds to an
instance of a database schema.
看完理解理解,先放这了;
分享到:
相关推荐
可以把 Database 看作是一个大仓库,仓库分了很多很多的房间,Schema 就是其中的房间,一个 Schema 代表一个房间,Table 可以看作是每个 Schema 中的床,Table(床)就被放入每个房间中,不能放置在房间之外,那岂...
本文档“jira-7-9-2-database-schema.pdf”所包含的是Jira 7.9.2版本的数据库模式信息,即数据库中各个表的结构、字段类型、索引等信息。这些信息对于二次开发者来说极具价值,因为它们可以准确指导开发者如何在...
常见电商网站的业务需求包括商品管理、用户管理、订单管理、购物车管理等。...运行:sqlite3 your_database_name.db < database_schema.sql 打开数据库:sqlite3 your_database_name.db 显示表结构:.schema
SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_schema = 'your_database' AND table_name = 'your_table'; ``` 4. **获取某张表的所有索引信息**: ```sql SELECT ...
5. 用户(User):用户是音乐平台的使用者,他们的行为如收藏、评分、创建播放列表等需要记录。用户表包含用户ID、用户名、密码、邮箱等字段。 二、关系模型建立 在音乐数据库中,各实体之间存在多种关联。例如,一...
在"database-schema-main"这个文件中,很可能是包含了整个数据库模式的JSON文件,或者是用于创建和管理数据库模式的脚本或配置。具体的内容需要查看文件才能详细解析和讨论。 在实际应用中,我们可能还会用到如...
在`config/database.php`配置文件中,你可以设置和管理不同的数据库连接,包括主机名、用户名、密码和数据库名称。 2. **Schema Builder** `laravel-schema`提供了Schema构建器,它是处理数据库表的接口。通过这个...
随着Oracle 12c引入了多租户架构(Multi-Tenant Architecture),即容器数据库(Container Database, CDB)与可插拔数据库(Pluggable Database, PDB)的概念,Goldengate 12c在进行数据复制时也相应地进行了更新以适应...
在mysql中创建一个Schema和创建一个Database的效果好像是一样的,但是在sqlserver和orcal数据库中效果又是不同的,目前我只能理解为在mysql中schema<==>database; 数据库中的user和schema的关系: 假如...
在MySQL中,`information_schema`是一个特殊的数据库,它包含了所有数据库服务器中的元数据信息,比如表、列、索引和权限等。用户通常可以通过查询`information_schema`来获取数据库的相关信息,例如表结构、约束等...
1 Introduction 3 1.1 Overview . . . . . . . . ....1.2 History ....1.3 Getting involved ....1.4 License ....2.1 Windows installer ....2.2 Windows binary ....2.3 Mac OS X installer ....2.4 Mac OS X binary ....
"database": { "host": str, "port": int, "name": str, "user": str, "password": str }, "logging": { "level": {"oneOf": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]} } }) ``` 然后,我们...
在描述中提到的XML文件内容是一个DataSource的表示,其中包含了一个param元素,param元素又包含了driver、url、user和password四个子元素,以及database和version两个属性。这些元素和属性的类型都是字符串。 以下...
databaseName=${dataSource.databaseName};serverName=${dataSource.serverName};password=${dataSource.password} 09.dataSource.hbm2ddl.auto=update 配置已经完成,下面开始例子 先在数据库建表,例子...
about using system privileges and roles to control user access to the database. Chapter 8, "Managing Schema Objects" This chapter discusses managing tables, indexes, and other schema objects. Chapter ...
- 用户名下的所有表、视图等对象称为**Schema**。 - 安装完成后,默认创建的用户包括:`sys`、`system`、`scott`。 - 创建新用户需使用DBA权限,命令为:`CREATE USER 用户名 IDENTIFIED BY 密码;` - 切换用户可...
4. 列出所有数据库的所有表(除mysql和information_schema外):`SELECT table_schema, table_name FROM information_schema.tables WHERE table_schema != 'mysql' AND table_schema != 'information_schema'` 5. ...