You are on page 1of 9

SQL> connect dsi21

Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied

SQL> connect dsi21g2


Enter password:
Connected.
SQL> select codc from facture ;

no rows selected

SQL> select codp from pc


2
SQL> select
2
SQL> insert into client(codc,nomc,creditc,adressec,ca,credmax)
values(1250,'mohamed',50,'tunis');
insert into client(codc,nomc,creditc,adressec,ca,credmax)
values(1250,'mohamed',50,'tunis')
*
ERROR at line 1:
ORA-00947: not enough values

SQL> insert into client(codc,nomc,creditc,adresses)


values(1250,'mohamed',50,'tunis');
insert into client(codc,nomc,creditc,adresses) values(1250,'mohamed',50,'tunis')
*
ERROR at line 1:
ORA-00904: "ADRESSES": invalid identifier

SQL> insert into client(codc,nomc,creditc,adressec)


values(1250,'mohamed',50,'tunis');

1 row created.

SQL> insert into client(codc,nomc,creditc,adressec)


values(1360,'amine',20,'tunis');

1 row created.

SQL> insert into client(codc,nomc,creditc,adressec)


values(1580,'sana',50,'sousse');

1 row created.

SQL> insert into client(codc,nomc,creditc,adressec)


values(1210,'manel',250,'kef');

1 row created.

SQL> insert into client(codc,nomc,creditc,adressec)


values(1000,'mejd',150,'tunis');

1 row created.
SQL> insert into client(codc,nomc,creditc,adressec)
values(1200,'rakia',400,'bizerte');

1 row created.

SQL> insert into client(codc,nomc,creditc,adressec)


values(1400,'fedia',100,'sfax');

1 row created.

SQL> commit;

Commit complete.

SQL> select distinct codc from facture;

no rows selected

SQL> select distinct codc from client;

CODC
----------
1000
1200
1210
1250
1360
1400
1580

7 rows selected.

SQL> select(codc||nomc)from client;

(CODC||NOMC)
------------------------------------------------------------
1250mohamed
1360amine
1580sana
1210manel
1000mejd
1200rakia
1400fedia

7 rows selected.

SQL> select(codc||' ' nomc)from client;


select(codc||' ' nomc)from client
*
ERROR at line 1:
ORA-00907: missing right parenthesis

SQL> select(codc || nomc)from client;

(CODC||NOMC)
------------------------------------------------------------
1250mohamed
1360amine
1580sana
1210manel
1000mejd
1200rakia
1400fedia

7 rows selected.

SQL> select(codc | | nomc)from client;

(CODC||NOMC)
------------------------------------------------------------
1250mohamed
1360amine
1580sana
1210manel
1000mejd
1200rakia
1400fedia

7 rows selected.

SQL> select(codc| |nomc)from client;

(CODC||NOMC)
------------------------------------------------------------
1250mohamed
1360amine
1580sana
1210manel
1000mejd
1200rakia
1400fedia

7 rows selected.

SQL> select(codc||' '||nomc)from client;

(CODC||''||NOMC)
-------------------------------------------------------------
1250 mohamed
1360 amine
1580 sana
1210 manel
1000 mejd
1200 rakia
1400 fedia

7 rows selected.

SQL> select(codc||' '||nomc) as alias from client ;

ALIAS
-------------------------------------------------------------
1250 mohamed
1360 amine
1580 sana
1210 manel
1000 mejd
1200 rakia
1400 fedia

7 rows selected.

SQL> select(codc||' '||nomc) as "code et nom" from client ;

code et nom
-------------------------------------------------------------
1250 mohamed
1360 amine
1580 sana
1210 manel
1000 mejd
1200 rakia
1400 fedia

7 rows selected.

SQL> select(codc||' '||nomc) "code et nom" from client ;

code et nom
-------------------------------------------------------------
1250 mohamed
1360 amine
1580 sana
1210 manel
1000 mejd
1200 rakia
1400 fedia

7 rows selected.

SQL> select(nomc||' habite a '||adressec) "localisation" from client ;

localisation
--------------------------------------------------------------------------------
mohamed habite a tunis
amine habite a tunis
sana habite a sousse
manel habite a kef
mejd habite a tunis
rakia habite a bizerte
fedia habite a sfax

7 rows selected.

SQL> select(nomc||' habite a '||adressec) from client ;

(NOMC||'HABITEA'||ADRESSEC)
--------------------------------------------------------------------------------
mohamed habite a tunis
amine habite a tunis
sana habite a sousse
manel habite a kef
mejd habite a tunis
rakia habite a bizerte
fedia habite a sfax
7 rows selected.

SQL> select(nomc||' habite a '||adressec) "localisation" from client ;

localisation
--------------------------------------------------------------------------------
mohamed habite a tunis
amine habite a tunis
sana habite a sousse
manel habite a kef
mejd habite a tunis
rakia habite a bizerte
fedia habite a sfax

7 rows selected.

SQL> select(nomc||' habite a '||adressec) " nom localisation" from client ;

nom localisation
--------------------------------------------------------------------------------
mohamed habite a tunis
amine habite a tunis
sana habite a sousse
manel habite a kef
mejd habite a tunis
rakia habite a bizerte
fedia habite a sfax

7 rows selected.

SQL> select(nomc||' habite a '||adressec) " nom localisation" from


client ;

nom localisation
--------------------------------------------------------------------------------
mohamed habite a tunis
amine habite a tunis
sana habite a sousse
manel habite a kef
mejd habite a tunis
rakia habite a bizerte
fedia habite a sfax

7 rows selected.

SQL> select(nomc||' habite a '||adressec) " nom localisation" from client


;

nom localisation
--------------------------------------------------------------------------------
mohamed habite a tunis
amine habite a tunis
sana habite a sousse
manel habite a kef
mejd habite a tunis
rakia habite a bizerte
fedia habite a sfax

7 rows selected.
SQL> select(nomc||' habite a '||adressec) " nom localisation" from client ;

nom localisation
--------------------------------------------------------------------------------
mohamed habite a tunis
amine habite a tunis
sana habite a sousse
manel habite a kef
mejd habite a tunis
rakia habite a bizerte
fedia habite a sfax

7 rows selected.

SQL> select nomc from client where( codc=1250);

NOMC
--------------------
mohamed

SQL> select( nomc,adressec) from client where( codc=1250 );


select( nomc,adressec) from client where( codc=1250 )
*
ERROR at line 1:
ORA-00907: missing right parenthesis

SQL> select( nomc,adressec ,codc) from client where( codc=1250 );


select( nomc,adressec ,codc) from client where( codc=1250 )
*
ERROR at line 1:
ORA-00907: missing right parenthesis

SQL> select nomc,adressec ,codc from client where codc=1250 ;

NOMC ADRESSEC
-------------------- --------------------------------------------------
CODC
----------
mohamed tunis
1250

SQL> select nomc , adressec from client where adressec='tunis' ;

NOMC ADRESSEC
-------------------- --------------------------------------------------
mohamed tunis
amine tunis
mejd tunis

SQL> select nomc from client where adressec='tunis' ;

NOMC
--------------------
mohamed
amine
mejd

SQL> select nomc , adressec from client where nomc='m %' ;

no rows selected

SQL> select nomc , adressec from client where nomc='m%' ;

no rows selected

SQL> select nomc , adressec from client where nomc LIKE 'm%' ;

NOMC ADRESSEC
-------------------- --------------------------------------------------
mohamed tunis
manel kef
mejd tunis

SQL> select nomc , adressec from client where adressec LIKE 'a%' ;

no rows selected

SQL> select nomc , adressec from client where adressec LIKE '%a%' ;

NOMC ADRESSEC
-------------------- --------------------------------------------------
fedia sfax

SQL> select nomc , adressec from client where creditc>50 and creditc <250 ;

NOMC ADRESSEC
-------------------- --------------------------------------------------
mejd tunis
fedia sfax

SQL> select nomc , adressec ,creditc from client where creditc>50 and creditc
<250 ;

NOMC ADRESSEC
-------------------- --------------------------------------------------
CREDITC
----------
mejd tunis
150

fedia sfax
100

SQL> select nomc ,creditc from client where creditc>50 and creditc <250 ;

NOMC CREDITC
-------------------- ----------
mejd 150
fedia 100

SQL> select nomc ,creditc,adressec from client where creditc>50 and creditc <250 ;

NOMC CREDITC
-------------------- ----------
ADRESSEC
--------------------------------------------------
mejd 150
tunis

fedia 100
sfax

SQL> select nomc ,creditc from client where creditc>50 and creditc <250 ;

NOMC CREDITC
-------------------- ----------
mejd 150
fedia 100

SQL> select nomc ,creditc from client where creditc between 50 and 250 ;

NOMC CREDITC
-------------------- ----------
mohamed 50
sana 50
manel 250
mejd 150
fedia 100

SQL> select nomc ,creditc from client where creditc in(150,100,250) ;

NOMC CREDITC
-------------------- ----------
manel 250
mejd 150
fedia 100

SQL> select nomc ,creditc from client where creditc=50 or creditc=150 or


creditc=250 ;

NOMC CREDITC
-------------------- ----------
mohamed 50
sana 50
manel 250
mejd 150

SQL> select nomc ,creditc from client where creditc>50 and creditc <25 ;

no rows selected

SQL> select nomc from client order by nomc asc


2 select nomc from client order by nomc asc;
select nomc from client order by nomc asc
*
ERROR at line 2:
ORA-00933: SQL command not properly ended

SQL> select nomc from client order by nomc asc;


NOMC
--------------------
amine
fedia
manel
mejd
mohamed
rakia
sana

7 rows selected.

SQL> select nomc from client order by nomc desc;

NOMC
--------------------
sana
rakia
mohamed
mejd
manel
fedia
amine

7 rows selected.

SQL> select nomc from client order by nomc ;

NOMC
--------------------
amine
fedia
manel
mejd
mohamed
rakia
sana

7 rows selected.

SQL>
SQL>

You might also like