Nuevo Documento de Tecchchxto
-
Upload
cristofher-fernandez-prado -
Category
Documents
-
view
215 -
download
0
Transcript of Nuevo Documento de Tecchchxto
-
7/24/2019 Nuevo Documento de Tecchchxto
1/5
SQL> alter table empresas modify gerente varvhar2(40) not null;alter table empresas modify gerente varvhar2(40) not null *ERROR at line 1:ORA-01735: invalid ALTER TABLE option
SQL> alter table empresa modify gerente varvhar2(40) not null;alter table empresa modify gerente varvhar2(40) not null *ERROR at line 1:ORA-01735: invalid ALTER TABLE option
SQL> alter table empresa modify gerente varchar2(40) not null;alter table empresa modify gerente varchar2(40) not null*ERROR at line 1:ORA-00942: table or view does not exist
SQL> describe empresas;Name Null? Type----------------------------------------- -------- ----------------------------
COD_EMPRESA NOT NULL CHAR(5)RAZON_SOCIAL NOT NULL VARCHAR2(40)F_INGRESO NOT NULL DATETELEFONO NOT NULL CHAR(8)GERENTE NOT NULL CHAR(40)DIRECCION NOT NULL VARCHAR2(40)COD_DISTRITO NOT NULL CHAR(3)
SQL> alter table empresa modify gerente varchar2(40);alter table empresa modify gerente varchar2(40)*ERROR at line 1:ORA-00942: table or view does not exist
SQL> alter table empresas modify gerente varchar2(40);
Table altered.
SQL> describe empresas;Name Null? Type----------------------------------------- -------- ----------------------------
COD_EMPRESA NOT NULL CHAR(5)RAZON_SOCIAL NOT NULL VARCHAR2(40)F_INGRESO NOT NULL DATETELEFONO NOT NULL CHAR(8)GERENTE NOT NULL VARCHAR2(40)DIRECCION NOT NULL VARCHAR2(40)COD_DISTRITO NOT NULL CHAR(3)
SQL> alter table empresas drop column razon_social;
Table altered.
-
7/24/2019 Nuevo Documento de Tecchchxto
2/5
SQL> describe empresas;Name Null? Type----------------------------------------- -------- ----------------------------
COD_EMPRESA NOT NULL CHAR(5)F_INGRESO NOT NULL DATETELEFONO NOT NULL CHAR(8)
GERENTE NOT NULL VARCHAR2(40)DIRECCION NOT NULL VARCHAR2(40)COD_DISTRITO NOT NULL CHAR(3)
SQL> alter table empresas modify column f_ingreso varchar2(35);alter table empresas modify column f_ingreso varchar2(35) *ERROR at line 1:ORA-00905: missing keyword
SQL> alter table empresas modify f_ingreso varchar2(35);
Table altered.
SQL> describe empresas;Name Null? Type----------------------------------------- -------- ----------------------------
COD_EMPRESA NOT NULL CHAR(5)F_INGRESO NOT NULL VARCHAR2(35)TELEFONO NOT NULL CHAR(8)GERENTE NOT NULL VARCHAR2(40)DIRECCION NOT NULL VARCHAR2(40)COD_DISTRITO NOT NULL CHAR(3)
SQL> insert into empresas values( 2 'e0001','mussa','4545454','Gonzales mero jose','calle los perros 4587','001');
1 row created.
SQL> insert into empresas values( 2 'e0002','mustin','2155425','Huertas contreras rafael','calle los sanot 4589','002');
1 row created.
SQL> insert into empresas values( 2 'e0003','batta','9525421','Vasquez contreras rafael','jr los aros 598','003');
1 row created.
SQL> insert into empresas values( 2 'e0004','maggy','3548222','Julca mamani maria','calle los paltos 520','004');
1 row created.
SQL> select * from empresas;
COD_E F_INGRESO TELEFONO
-
7/24/2019 Nuevo Documento de Tecchchxto
3/5
----- ----------------------------------- --------GERENTE----------------------------------------DIRECCION COD---------------------------------------- ---e0001 mussa 4545454Gonzales mero jose
calle los perros 4587 001
e0002 mustin 2155425Huertas contreras rafaelcalle los sanot 4589 002
COD_E F_INGRESO TELEFONO----- ----------------------------------- --------GERENTE----------------------------------------DIRECCION COD---------------------------------------- ---
e0003 batta 9525421Vasquez contreras rafaeljr los aros 598 003
e0004 maggy 3548222Julca mamani maria
COD_E F_INGRESO TELEFONO----- ----------------------------------- --------GERENTE----------------------------------------DIRECCION COD
---------------------------------------- ---calle los paltos 520 004
SQL> describe distritos;Name Null? Type----------------------------------------- -------- ----------------------------
COD_DISTRITO CHAR(3)NOM_DISTRITO NOT NULL VARCHAR2(25)
SQL> insert into distritos values( 2 '001','p.piedra');
1 row created.
SQL> insert into distritos values( 2 '002','comas');
1 row created.
SQL> insert into distritos values( 2 '003','collique');
1 row created.
SQL> insert into distritos values( 2 '004','ancon');
-
7/24/2019 Nuevo Documento de Tecchchxto
4/5
1 row created.
SQL> select* from distritos;
COD NOM_DISTRITO--- -------------------------
001 p.piedra002 comas003 collique004 ancon
SQL> select 2 CL.apellidos, CL.nombres, CL.direccion, EM.f_ingreso 3 FROM clientes CL join empresas EM ON 4 CL.cod_empresa=EM.cod_empresa WHERE 5 EM.f_ingreso='mustin';
no rows selected
SQL> select * from empresas;
COD_E F_INGRESO TELEFONO----- ----------------------------------- --------GERENTE----------------------------------------DIRECCION COD---------------------------------------- ---e0001 mussa 4545454Gonzales mero josecalle los perros 4587 001
e0002 mustin 2155425Huertas contreras rafaelcalle los sanot 4589 002
COD_E F_INGRESO TELEFONO----- ----------------------------------- --------GERENTE----------------------------------------DIRECCION COD---------------------------------------- ---
e0003 batta 9525421Vasquez contreras rafaeljr los aros 598 003
e0004 maggy 3548222Julca mamani maria
COD_E F_INGRESO TELEFONO----- ----------------------------------- --------GERENTE----------------------------------------DIRECCION COD---------------------------------------- ---calle los paltos 520 004
SQL> select
-
7/24/2019 Nuevo Documento de Tecchchxto
5/5
2 CL.apellidos, CL.nombres, CL.direccion, EM.f_ingreso 3 FROM clientes CL join empresas EM ON 4 CL.cod_empresa=EM.cod_empresa WHERE 5 EM.nombre empresa='mustin';EM.nombre empresa='mustin' *ERROR at line 5:
ORA-00920: invalid relational operator
SQL> select 2 CL.apellidos, CL.nombres, CL.direccion, EM.f_ingreso 3 FROM clientes CL join empresas EM ON 4 CL.cod_empresa=EM.cod_empresa WHERE 5 EM.f_ingreso='Mustin';
no rows selected
SQL> select
2 CL.apellidos, CL.nombres, CL.direccion, EM.f_ingreso, EM.gerente 3 FROM clientes CL join empresas EM ON 4 CL.cod_distrito=EM.cod_distrito join distritos DIS ON 5 EM.cod_distrito=DIS.cod_distrito 6 WHERE DIS.f_ingreso='comas';WHERE DIS.f_ingreso='comas' *ERROR at line 6:ORA-00904: "DIS"."F_INGRESO": invalid identifier
SQL> select 2 CL.apellidos, CL.nombres, CL.direccion, EM.f_ingreso, EM.gerente
3 FROM clientes CL join empresas EM ON 4 CL.cod_distrito=EM.cod_distrito join distritos DIS ON 5 EM.cod_distrito=DIS.cod_distrito 6 WHERE DIS.nom_distrito='comas';
APELLIDOS NOMBRES----------------------------------- -------------------------DIRECCION--------------------------------------------------F_INGRESO GERENTE----------------------------------- ----------------------------------------Julca malca juliamz H lt 40mustin Huertas contreras rafael
Huertas delgado joseJR los alamosmustin Huertas contreras rafael
APELLIDOS NOMBRES----------------------------------- -------------------------DIRECCION--------------------------------------------------F_INGRESO GERENTE----------------------------------- ----------------------------------------
SQL>