In this article. I am going to teach you about the creation of tables made with two different DBMS(DataBase Managment System)
What is a table?
Microsoft defines a table such as database objects that contain all the data in a database. In tables, data is logically organized in a row-and-column format similar to a spreadsheet. Each row represents a unique record, and each column represents a field in the record. For example, a table that contains employee data for a company might contain a row for each employee and columns representing employee information such as employee number, name, address, job title, and home telephone number.
Oralce defines a table such as the basic unit of data organization in an Oracle database.
If We want to create a table, We first have to create a database.In both DBMS We can create in both DBMS a database by using the word create database NAMEOFDATABASE in oracle We add ; and SQL SERVER We do not need to use ;
How to create a table in SQL Server?
First We need to use the DDL command CREATE then We need to use the reserve word know as table then We add the name of the table then we use () inside the parentesis we put the
name of the column and the data type. If We want to add more columns we just add a , and then the data type.
We can add a Primary Key if we want to make connection between tables.
Example
create table Anime(
idanime int primary key,nombreanimne varchar(50))
create table Genero
(idgenero int primary key, nombre varchar(20) )
In SQL Server we do not need to use the ; at the end of each sentence
Create a table in Oracle
In Oracle We can create a table in the next way.
CREATE TABLE Libro(
idlibro number not null,
Nombre varchar2(50) not null,
NumeroPaginas number not null,
Editorial varchar2(50) not null,
ano number not null,
CONSTRAINT PKLibroidlibro Primary Key(idlibro));
One of the biggest differences between SQL Server and Oracle are the data types and the ;
In oracle we use the language PL/SQL while in SQL Server we use Transct-SQL