Differences between Database and Schema using different databases?

后端 未结 4 634
予麋鹿
予麋鹿 2020-12-23 14:17

What are the differences in database terminology between MS SQL and MySQL?

Can a MySQL instance have more than one database? It appears that it can only create diffe

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 14:17

    I believe by saying 'schema' for MS SQL you are meaning 'owner'.

    From my understand, in MySQL when you do a

    SELECT * from world.city;
    

    This query is selecting from the world database the table city.

    In MsSQL you will have to do a

    SELECT * from world.dbo.city;
    

    Where 'dbo' is the default owner of the table.

    To make life easier define the default database by typing

    USE world
    SELECT * from city;
    

    In MySQL there is no way to declare the owner of the table. ie. 'dbo'.

提交回复
热议问题