You are on page 1of 53

INFORMATION SYSTEM

MANAGEMENT
ASSIGNMENT-1
Q-

Ans:-

1. Display all the fields of employee table.


INPUT
OUTPUT

INPUT
OUTPUT

INPUT
OUTPUT

INPUT
OUTPUT

INPUT
OUTPUT

INPUT
OUTPUT
INPUT

OUTPUT
INPUT

OUTPUT
2. Retrieve employee number and their salary…

INPUT

OUTPUT
3. Retrieve average salary of all employee…

INPUT

OUTPUT
4. Retrieve number of employees.

INPUT

OUTPUT
5. Retrieve district number of employees.

INPUT

OUTPUT
6. Retrieve total salary of employee group by
employee name and count similar names.

INPUT
OUTPUT

7. Retrieve total salary of employee which is


greater than > 120000.

INPUT
OUTPUT

8.Display name of employee in descending order.

INPUT
OUTPUT

9.Display details of employee whose name is


AMIT and salary greater than 50000;

INPUT
OUTPUT
Information System Management (LAB)
Assignment – 2

Q1 i) INPUT:
OUTPUT:

ii) INPUT:
OUTPUT:
Q2 INPUT:
OUTPUT:
Q3 INPUT:
OUTPUT:
Q3
i) Find out the names of all the clients.
INPUT:
OUTPUT:

ii) Retrieve the list of names and cities of all the


clients.
INPUT:

OUTPUT:
iii) List the various products available from the
product_master table.
INPUT:

OUTPUT:
iv) List all the clients who are located in
Bombay.
INPUT:
OUTPUT:

v) Display the information for client no 0001 and


0002.
INPUT:
OUTPUT:

vi) Find the products with description as ‘1.44


drive’ and ‘1.22 Drive’.
INPUT:
OUTPUT:

vii) Find all the products whose sell price is


greater than 5000.
INPUT:
OUTPUT:

viii) Find the list of all clients who stay in in city


‘Bombay’ or city ‘Delhi’ or ‘Madras’.
INPUT:

OUTPUT:
INPUT:

OUTPUT:

INPUT:

OUTPUT:
ix) Find the product whose selling price is
greater than 2000 and less than or equal to 5000.
INPUT:

OUTPUT:

INPUT:
OUTPUT:

INPUT:

OUTPUT:
ASSIGNMENT 3
(RESTRICTION ON TABLE )

CREATE THE FOLLOWING TABLE WITH  THE FOLLOWING RESTRICTION

Sales_master

SQL> create table sales_master


           (  salesman_no varchar2(6)CHECK(salesman_no LIKE 's%'),
           sal_names varchar2(20)NOT NULL,
           Address varchar2(20)NOT NULL,
            city varchar2(20),
            state varchar2(20),
            pincode varchar2(6),
            sal_amount number(8,2)NOT NULL,
            tgt_to_get number(6,2)NOT NULL,
            ytd_sales number(6,2)NOT NULL,
            remarks varchar2(30),
            PRIMARY KEY(salesman_no),
            CHECK(tgt_to_get !=0),
            CHECK(sal_amount !=0),
            CHECK(ytd_sales!=0 ));
     
SQL> desc sales_master11;

SQL> select*from sales_master011;


Saless_order

SQL> create table sales_order11(


           s_order_no varchar2(6)CHECK(s_order_no  LIKE 'o%'),
           s_order_date date,
           client_no varchar2(25),
           dely_add varchar2(6),
           salesman_no varchar2(6),
           dely_type char(1) default('f'),
           billed_yn char(1),
           dely_date date,
           order_status varchar2(10),
           CHECK(s_order_date>dely_date),
           CHECK(order_status IN('in process','fulfilled','back order','canceled')),
           PRIMARY KEY(s_order_no),
           FOREIGN KEY(salesman_no)REFERENCES sales_master11,
           CHECK(dely_type IN('p','f')));
SQL> desc sales_order11

SQL> select*from sales_order011;

sales_order_details

SQL> create table sales_order_details11(


           s_order_no varchar2(6)PRIMARY KEY,
           product_no varchar2(6),
           qty_no number(8),
           qty_disp number(8),
           product_rate number(10,2),
           FOREIGN KEY(s_order_no )REFERENCES sales_order11);

SQL> desc sales_order_details11;

SQL> select* from sales_order_details011;


ASSIGNMENT 4
Q1 CREATE THE FOLLOWING TABLE WITH NAME CHALLAN HEADER

SQL> create table challanheader


          (challan_no varchar2(6) PRIMARY KEY,
           s_order_no varchar2(6),
           challan_date date NOT NULL,
           billed_yn char(1) default('f'),
           CHECK(billed_yn IN('y','n')),
           FOREIGN KEY(s_order_no)REFERENCES sales_order);
Q2 CREATE THE TABLE WITH NAME CHALLAN_DETAILS
SQL>create table challan_details
          (challan_no varchar2(6) PRIMARY KEY,
           product_no  varchar2(6),
           qty_displ number(4,2) NOT NULL)

PERFORM THE FOLLOWING


 Q1 MAKE THE PRIMARY KEY TO CLIENT_NO IN CLIENT_MASTER.
SQL> alter table
          client_master
          ADD PRIMARY KEY(client_no);
 Q2 ADD A NEW COLUMN PHONE_NO IN THE CLIENT_MASTER TABLE.
SQL> alter table
           product_master
           ADD(phone_no number(12));

 Q3 ADD THE NULL CONSTRAINT IN THE PRODUCT_MASTER  TABLE WITH THE COLUMN
DESCRIPTION, PROFIT PERCENT, SELL PRICE AND COST PRICE.
SQL> alter table
           product_master
           MODIFY(sellprice number(8) NOT NULL)
           MODIFY(costprice number(8) NOT NULL)
           MODIFY(profitpercent number(6) NOT NULL)
           MODIFY(description varchar2(15) NOT NULL);
 Q4 CHANGE THE SIZE OF THE CLIENT_NO FIELD IN THE CLIENT_MASTER TABLE.

SQL> alter table


           client_master
           MODIFY(client_no varchar2(20));

 Q5 SELECT PRODUCT_NO, DESCRIPTION WHERE PROFIT PERCENT IS BETWEEN 20 AND


30 BOTH INCLUSIVE

SQL> select product_no,description from product_master


           where profitpercent between 20 and 30;
ASSIGNMENT 5

IMPLEMENT THE CONCEPT OF JOINS

 FIND OUT THE PRODUCT WHICH HAS BEEN SOLD TO ‘IVAN


SAYROSS.’

Select  product_no,description
From product_master11 
Where Item_sold_to=’Ivan Sayross’;

 FIND OUT THE PRODUCT AND THEIR QUANTITIES THAT WILL HAVE
DO DELIVERED.

Select product_description,product_quantity
From product_master
Where status=’deliver’;

 FIND OUT THE NAMES OF CLIENTS WHO HAVE PURCHASED ‘CD


DRIVE’
Select c.name
From client_master11 c, product_master11 p
Where c.product_id=p.product_id
AND p.description =’Cd drive’;

 LIST THE PRODUCT_NO AND S_ORDER_NO OF CUSTOMERS HAAVING


QTY ORDERED LESS THAN 5 FROM THE ORDER DETAILS TABLE FOR THE
PRODUCT “1.44 FLOPPIES”.

Select p.product_no,p.s_orderno
From sales_order11 p,sales_order_detail s
Where p.product_no=s.product_no
And s.quantity<5 AND s.description =’1.44 floppies’;

 FIND THE PRODUCTS AND THEIR QUANTITIES FOR THE ORDERS


PLACED BY CLIENT_NO “ C00001” AND “C00002”

Select p.product_no,p.quantities,p.description 
From sales_order p,client_master c
Where p.product_no=c.itemorder-id
And c.client_no=’C000001’ OR ’C000002’;

ASSIGNMENT 6

CONCEPT OF GROUPING OF DATA.

 Print the description and total quantity sold for


each product.

Select description,quantity_sold
From product_master11
Order by quantity sold ASC;

 Find the names of clients who have ‘CD Drive’.

Select name from client_master


Where item_bought =’CD DRIVE’
Group by name;

 Select product_no, product description and qty


ordered for each product.

Select product_no,quantity_ordered,description
From sales_order_details11 
Group by product_no;

ASSIGNMENT 7

Q.1 Find the product no. and description of non moving products
i.e. not being sold.
Ans:-
SQL> select sales_order_details.product_no,description from
sales_order_details,product_master where  qty_disp = 0 and
sales_order_details.product_no = product_master.product_no;
 
PRODUC          DESCRIPTION
-------------         --------------------
P00101              1.44 Floppies
 
Q.2 Find the customer name, address1,address2.city and pincode for
the client who has placed order no. ‘O19001’.
Ans:-
SQL> select name,address1,address2,city,pincode from
client_master,sales_order where order_no = 'O19001' and
sales_order.client_no = client_master.client_no;
 
NAME        ADDRESS1      ADDRESS2           CITY               PINCOD
E
-----------    ----------------   -------------------      ---------------       -----------
----
Ivan Bayross      Z/114              Worli                Bombay              400054
 

Q.3 Find the client name that has placed orders before the month of
May’09.
SQL> select name,order_date from client_master,sales_order where
order_date < '1-May-09' and sales_order.client_no =
client_master.client_no;
Ans:-  
NAME                 ORDER_DAT
----------------       ----------------
Vandana Saitwal   12-JAN-08
Pradama Jaguste   20-MAY-08
Basu Navindgi      25-JAN-08
Ivan Bayross         18-FEB-08
Ivan Bayross         03-APR-08
 
 
 Q.4 Find out if the product ‘1.44 Drive’ has been ordered by any
client and print the client_no, name to whom it was sold.
Ans:-
SQL> select
description,sales_order_details.order_no,client_master.client_no,name
from product_master, client_master,sales_order,sales_order_details
where description = '1.44 Drive' and product_master.product_no =
sales_order_details.product_no and sales_order_details.order_no =
sales_order.order_no and sales_order.client_no =
client_master.client_no;
 
DESCRIPTION          ORDER_           CLIENT             NAME
--------------------         -------------        ------------       --------------------
1.44 Drive                   O46899               C00014          Ajay Navindgi
 
Q.5 Find names of the clients who have placed orders worth Rs.
10000 or more.
SQL> select name,product_master.product_no,sell_price from
client_master,product_master,sales_order,
sales_order_details where sell_price >= 10000 and
product_master.product_no = sales_order_details.product_no and
sales_order_details.order_no = sales_order.order_no and
sales_order.client_no = client_master.client_no;
 Ans:-
NAME                 PRODUC                  SELL_PRICE
----------------       --------------               ------------------
Ivan Bayross           P03453                         13500
Q.7 Select the names of persons who are in Mr. Pradeep’s
department and who have also worked on an inventory control
system.
Code:
SELECT ClientName as 'Name'
FROM Client
WHERE Client.City  = 'Bombay'
UNION ALL SELECT `Salesmanname` as 'Name'
FROM SalesTable
WHERE SalesTable.City  = 'Bombay';

Output:

Q.10  Select the product_no, description, qty_on_hand,


cost_price of non-moving items in the product_master_table.
Code:
SELECT ProductNo, Description, `Qty_on-hand`,
CostPrice
FROM Product
WHERE Product.Description = 'Monitors' OR
Product.Description = 'Mouse'
OR Product.Description = 'Keyboards';

Output:

You might also like