Create Table Salesman
Create Table Salesman
varchar2(20),primary key(salesman_id));
Table created.
ERROR at line 1:
ERROR at line 1:
Table created.
NAME VARCHAR2(20)
CITY VARCHAR2(20)
COMMISSION VARCHAR2(20)
CUST_NAME VARCHAR2(20)
CITY VARCHAR2(20)
GRADE NUMBER(3)
SALESMAN_ID NUMBER(4)
PURCHASE_AMT NUMBER(10,2)
ORD_DATE DATE
CUSTOMER_ID NUMBER(4)
SALESMAN_ID NUMBER(4)
ERROR at line 1:
ERROR:
1 row created.
1 row created.
1 row created.
ERROR:
1 row created.
1 row created.
1 row created.
1 row created.
ERROR:
1 row created.
1 row created.
SQL> insert into order values(50,5000,'04-may-17',10,1000);
ERROR at line 1:
ERROR at line 1:
1 row created.
1 row created.
1 row created.
1 row created.
SQL> insert into orders values(54,550,'09-mar-17',12,2000);
1 row created.
SQL> select grade,count(distinct costomer_id)from customer group by grade having grade having
grade>(select avg(grade) from customer where city='banglore');
ERROR at line 1:
SQL> select grade,count(distinct customer_id)from customer group by grade having grade having
grade>(select avg(grade) from customer where city='banglore');
ERROR at line 1:
GRADE COUNT(DISTINCTCUSTOMER_ID)
---------- --------------------------
300 1
400 2
SQL> select salesman_id,name from salesman A where 1<(select count(*) from customer where
salesman_id=A.salesman_id);
SALESMAN_ID NAME
----------- --------------------
1000 john
2000 ravi
SQL> committe
SQL>