What is the difference between a schema and a table and a database?

后端 未结 14 1181
一整个雨季
一整个雨季 2020-12-07 07:18

This is probably a n00blike (or worse) question. But I\'ve always viewed a schema as a table definition in a database. This is wrong or not entirely correct. I don\'t rememb

14条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 07:22

    Schema behaves seem like a parent object as seen in OOP world. so it's not a database itself. maybe this link is useful.

    But, In MySQL, the two are equivalent. The keyword DATABASE or DATABASES can be replaced with SCHEMA or SCHEMAS wherever it appears. Examples:

    • CREATE DATABASE <=> CREATE SCHEMA
    • SHOW DATABASES <=> SHOW SCHEMAS

    Documentation of MySQL

    SCHEMA & DATABASE terms are something DBMS dependent.

    A Table is a set of data elements (values) that is organized using a model of vertical columns (which are identified by their name) and horizontal rows. A database contains one or more(usually) Tables . And you store your data in these tables. The tables may be related with one another(See here).

提交回复
热议问题