0% found this document useful (0 votes)
64 views

Crear Tablas Oracle

The document contains SQL commands to create multiple tables in an Oracle database including tables for students (ALUMNOS), careers (CARRERAS), student-career assignments (ALUMNOS_CARRERAS), courses (MATERIAS), and career-course assignments (CARRERAS_MATERIAS). It also includes commands to insert data into these tables.

Uploaded by

'Josue Alejandro
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Crear Tablas Oracle

The document contains SQL commands to create multiple tables in an Oracle database including tables for students (ALUMNOS), careers (CARRERAS), student-career assignments (ALUMNOS_CARRERAS), courses (MATERIAS), and career-course assignments (CARRERAS_MATERIAS). It also includes commands to insert data into these tables.

Uploaded by

'Josue Alejandro
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

TOPICOS AVANZADOS CREATE TABLE "AL08040877".

"ALUMNOS" ( "NO_CONTROL" VARCHAR2(8 BYTE) NOT NULL ENABLE, "NOMBRE_COMPLETO" VARCHAR2(80 BYTE) NOT NULL ENABLE, "SEXO" CHAR(1 BYTE) NOT NULL ENABLE, "FECHA_NACIMIENTO" DATE NOT NULL ENABLE, CONSTRAINT "ALUMNOS_CON" PRIMARY KEY ("NO_CONTROL") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ENABLE ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ; CREATE TABLE "AL08040877"."CARRERAS" ( "CLAVE_CARRERA" VARCHAR2(3 BYTE) NOT NULL ENABLE, "NOMBRE_CARRERA" VARCHAR2(30 BYTE) NOT NULL ENABLE, "FECHA_INICIO" DATE NOT NULL ENABLE, "CREDITOS" NUMBER(5,0) NOT NULL ENABLE, CONSTRAINT "CARRERAS_CON" PRIMARY KEY ("CLAVE_CARRERA") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ENABLE ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 MARTHA DANIELA ZAMORA GALINDO

TOPICOS AVANZADOS PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ;

CREATE TABLE "AL08040868"."ALUMNOS_CARRERAS" ( "NO_CONTROL" VARCHAR2(8 BYTE) NOT NULL ENABLE, "CLAVE_CARRERA" VARCHAR2(3 BYTE) NOT NULL ENABLE, CONSTRAINT "FK_CARRERAS" FOREIGN KEY ("CLAVE_CARRERA") REFERENCES "AL08040868"."CARRERAS" ("CLAVE_CARRERA") ENABLE, CONSTRAINT "FK_ALUMNOS" FOREIGN KEY ("NO_CONTROL") REFERENCES "AL08040868"."ALUMNOS" ("NO_CONTROL") ENABLE ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ;

CREATE TABLE "AL08040868"."MATERIAS" ( "CLAVE_MATERIA" VARCHAR2(7 BYTE) NOT NULL ENABLE, "NOMBRE" VARCHAR2(50 BYTE) NOT NULL ENABLE, "HORAS_TEORICAS" NUMBER NOT NULL ENABLE, "HORAS_PRACTICAS" NUMBER NOT NULL ENABLE, "CREDITOS" NUMBER NOT NULL ENABLE, CONSTRAINT "MATERIAS_PK" PRIMARY KEY ("CLAVE_MATERIA") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) MARTHA DANIELA ZAMORA GALINDO

TOPICOS AVANZADOS TABLESPACE "USERS" ENABLE ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ;

CREATE TABLE "AL08040868"."CARRERAS_MATERIAS" ( "CLAVE_CARRERA" VARCHAR2(3 BYTE) NOT NULL ENABLE, "CLAVE_MATERIA" VARCHAR2(7 BYTE), CONSTRAINT "FK_CARRERA" FOREIGN KEY ("CLAVE_CARRERA") REFERENCES "AL08040868"."CARRERAS" ("CLAVE_CARRERA") ENABLE, CONSTRAINT "FK_MATERIA" FOREIGN KEY ("CLAVE_MATERIA") REFERENCES "AL08040868"."MATERIAS" ("CLAVE_MATERIA") ENABLE ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ;

insert into alumnos values ('08040205', 'Manuel Rodriguez', 'M', '15-02-1991'); 10042356 Alejandro Jimenez 11256545 Alejandro Jimenez 11040563 Veronica Arias Hernndez 08040869 Oscar Saucedo Romero 10040236 Francisco Calderon Pia 11040856 Mara Sanchez MARTHA DANIELA ZAMORA GALINDO M 13/09/92 M 13/09/92 F 15/08/93 M 09/07/90 M 14/04/92 F 10/12/93

TOPICOS AVANZADOS 08040205 Manuel Rodriguez 09152445 Ana Lucero 09154569 Daniela Zamora 08052636 Brayan Sanchez M 15/02/91 F 16/03/91 F 20/10/90 M 15/02/93

insert into carreras values ('c01', 'Licenciatura en Informtica', '02-05-1996', 380 );

c02 c01 c03

Licenciatura en Informtica ingeniera en Sistemas Ingeniera en Civil

02/05/96 04/05/89 10/08/92

380 400 390

insert into materias values ('1931', 'Probabilidad', '8', '7', '8'); 1931 1937 1928 1948 1964 1986 1956 Probabilidad Matemticas Desarrollo empresarial Taller de investigacin Sistemas operativos Costos Topicos Avanzados 8 8 6 8 8 8 6 7 7 7 8 8 8 8 8 6 10 2 8 6 8

insert into carreras_materias values ('c01', '1931'); c01 c01 1931 1928

insert into alumnos_carreras values ('08040869', 'c01');} 08040869 c01 MARTHA DANIELA ZAMORA GALINDO

TOPICOS AVANZADOS Es un poco mas accesible el oracle que el postgres ya qe las plantillas o la forma de crear las tablas es un poco mas especifico qe en postgress

MARTHA DANIELA ZAMORA GALINDO

You might also like