Author Topic: What is the difference between create database and create table in SQL?  (Read 58 times)

free stown

  • Newbie
  • *
  • Posts: 19
    • View Profile
What is the difference between create database and create table in SQL? :'(

oliviadavis

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: What is the difference between create database and create table in SQL?
« Reply #1 on: February 05, 2021, 08:10:12 AM »
Databases contain tables. You can't create a table outside of a database. The actual syntax for creating a database in most systems is simply “creat database dbname”. The syntax for creating a table on the other hand is much more complicated. You must spicify each column name it's size it's data type, if a null value is allowed, possibly it's default value. Also you'll need to define indexes and forign keys as needed.


patrick Blizzak

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: What is the difference between create database and create table in SQL?
« Reply #2 on: February 05, 2021, 08:13:18 AM »
Well, there is a way to create temp table in sql server https://codingsight.com/introduction-to-temporary-tables-in-sql-server/ Simply follow the instruction and you will succeed. You see, this is the most trusted blog about SQL Server I have ever met. Plus there are articles mainly focused on SQL Server database and Microsoft stack technologies. Still, these guys strive to cover other interesting topics and technologies. Hope it can be helpful.

viscaar

  • Hero Member
  • *****
  • Posts: 69988
    • View Profile