Base de Datos
Base de Datos
Base de Datos
dbf'
size 50m;
Tablespace created.
User created.
Grant succeeded.
/////////////**********************************************************************
***********************
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
SQL> select * from venta;
8 rows selected.
ID
----------
NOMBRE
--------------------------------------------------------------------------------
SALDO
----------
DIRECCION
--------------------------------------------------------------------------------
1
Gustavo
3
Calle El hielo
ID
----------
NOMBRE
--------------------------------------------------------------------------------
SALDO
----------
DIRECCION
--------------------------------------------------------------------------------
2
Adhir
4
Ameyalco
ID
----------
NOMBRE
--------------------------------------------------------------------------------
SALDO
----------
DIRECCION
--------------------------------------------------------------------------------
3
Ariana
5
Mi casa
ID
----------
NOMBRE
--------------------------------------------------------------------------------
SALDO
----------
DIRECCION
--------------------------------------------------------------------------------
4
Ingrid
10
Queretaro
ID
----------
NOMBRE
--------------------------------------------------------------------------------
SALDO
----------
DIRECCION
--------------------------------------------------------------------------------
5
Juan
11
Hidalgo
ID
----------
NOMBRE
--------------------------------------------------------------------------------
SALDO
----------
DIRECCION
--------------------------------------------------------------------------------
6
Laura
5
Aldama
ID
----------
NOMBRE
--------------------------------------------------------------------------------
SALDO
----------
DIRECCION
--------------------------------------------------------------------------------
7
Carmen
5
Miguel hidalgo
ID
----------
NOMBRE
--------------------------------------------------------------------------------
SALDO
----------
DIRECCION
--------------------------------------------------------------------------------
8
Vanessa
5
Chabacano
8 rows selected.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
NOMBRE
--------------------------------------------------------------------------------
DIRECCION
--------------------------------------------------------------------------------
FECHA_VE CANTIDAD PRECIO
-------- ---------- ----------
Gustavo
Calle El hielo
10/06/17 15 200
Adhir
Ameyalco
17/06/17 15 150
NOMBRE
--------------------------------------------------------------------------------
DIRECCION
--------------------------------------------------------------------------------
FECHA_VE CANTIDAD PRECIO
-------- ---------- ----------
Adhir
Ameyalco
10/06/17 1 10
Adhir
Ameyalco
NOMBRE
--------------------------------------------------------------------------------
DIRECCION
--------------------------------------------------------------------------------
FECHA_VE CANTIDAD PRECIO
-------- ---------- ----------
10/05/17 10 100
Adhir
Ameyalco
10/05/17 3 20
Ariana
NOMBRE
--------------------------------------------------------------------------------
DIRECCION
--------------------------------------------------------------------------------
FECHA_VE CANTIDAD PRECIO
-------- ---------- ----------
Mi casa
19/06/17 5 150
Ariana
Mi casa
14/06/17 2 100
NOMBRE
--------------------------------------------------------------------------------
DIRECCION
--------------------------------------------------------------------------------
FECHA_VE CANTIDAD PRECIO
-------- ---------- ----------
Juan
Hidalgo
10/05/17 10 50
8 rows selected.
View created.
View created.
View created.
View created.
/
*/*/////////////////////////////////////////////***********************************
********************************************
SQL> create table cliente(id number, nombre varchar(30), saldo number, constraint
pk_cl primary key(id));
Table created.
SQL> create table venta(id number, fecha date, id_cliente number, cantidad number,
cantidad number, constraint pk_ven primary key(id), constraint fk_ven foreign
key(id_cliente) references cliente(id));
create table venta(id number, fecha date, id_cliente number, cantidad number,
cantidad number, constraint pk_ven primary key(id), constraint fk_ven foreign
key(id_cliente) references cliente(id))
*
ERROR at line 1:
ORA-00957: duplicate column name
SQL> create table venta(id number, fecha date, id_cliente number, cantidad number,
constraint pk_ven primary key(id), constraint fk_ven foreign key(id_cliente)
references cliente(id));
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
ID NOMBRE SALDO
---------- ------------------------------ ----------
1 Gustavo 10
2 Adhir 4
3 Ariana 5
1 row updated.
SQL> SELECT * FROM cliente;
ID NOMBRE SALDO
---------- ------------------------------ ----------
1 Ingrid 3
2 Adhir 4
3 Ariana 5
1 row updated.
1 row deleted.
ID NOMBRE SALDO
---------- ------------------------------ ----------
2 Adhir 4
3 Ariana 5
Table altered.
1 row updated.
1 row updated.
SQL> update cliente set nombre='Ariana', saldo=5, direccion='Mi casa' where id=3;
1 row updated.
ID NOMBRE SALDO
---------- ------------------------------ ----------
DIRECCION
--------------------------------------------------------------------------------
1 Gustavo 3
Calle El hielo
2 Adhir 4
Ameyalco
3 Ariana 5
Mi casa
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
ID NOMBRE SALDO
---------- ------------------------------ ----------
DIRECCION
--------------------------------------------------------------------------------
1 Gustavo 3
Calle El hielo
2 Adhir 4
Ameyalco
3 Ariana 5
Mi casa
ID NOMBRE SALDO
---------- ------------------------------ ----------
DIRECCION
--------------------------------------------------------------------------------
4 Ingrid 10
Queretaro
5 Juan 11
Hidalgo
6 Laura 5
Aldama
ID NOMBRE SALDO
---------- ------------------------------ ----------
DIRECCION
--------------------------------------------------------------------------------
7 Carmen 5
Miguel hidalgo
8 Vanessa 5
Chabacano
8 rows selected.
Table altered.
1 row updated.
1 row updated.
1 row updated.
Table altered.
Table altered.