Skip to content

Commit 30f3d1a

Browse files
committed
select name from client_master c,
sales_order so, sales_order_details sod, product_master p where c.client_no = so.client_no and so.s_order_no = sod.s_order_no and sod.product_no = p.product_no and p.description = 'CD DRIVE';
1 parent 14f16ff commit 30f3d1a

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

1.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,17 @@
66

77
accept
88
# world string
9+
# run plsql using Python.
10+
11+
import cx_Oracle
12+
import pandas as pd
13+
14+
# connect to Oracle
15+
conn = cx_Oracle.connect('user/password@host:port/sid')
16+
17+
# create a cursor
18+
cur = conn.cursor()
19+
20+
# execute a statement
21+
cur.execute('select * from table')
22+

dbms/10.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
-- 1. WAP in PL/SQL for addition of two numbers.
2-
sql
32
DECLARE a INT := 10;
43
b INT := 20;
54
c INT;
65
BEGIN c := a + b;
76
DBMS_OUTPUT.PUT_LINE(c);
87
END;
98
-- 2. WAP in PL/SQL for addition of 1 to 100 numbers.
10-
sql
119
DECLARE a INT := 100;
1210
b INT := 1;
1311
c INT;
@@ -19,7 +17,6 @@ WHEN b > a;
1917
END LOOP;
2018
END;
2119
-- 3. WAP in PL/SQL to check the given number is even or odd.
22-
sql
2320
DECLARE a INT := 2;
2421
b INT := 1;
2522
c INT;
@@ -29,7 +26,6 @@ ELSE DBMS_OUTPUT.PUT_LINE('Odd');
2926
END IF;
3027
END;
3128
-- 4. WAP in PL/SQL to inverse a number, eg. Number 5639 when inverted must be display output 9365.
32-
sql
3329
DECLARE a INT := 5639;
3430
b INT := 0;
3531
c INT;
@@ -42,7 +38,6 @@ WHEN a = 0;
4238
END LOOP;
4339
END;
4440
-- 5. WAP in PL/SQL for changing the price of product ‘P00001’ to 4000 if the price is less than 4000 in product_master table. The change is recorded in the old_price_table along with product_no and the date on which the price was changed last.
45-
sql
4641
DECLARE a INT := 4000;
4742
b INT;
4843
c INT;

dbms/7.sql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ where p.product_no = sod.product_no
3131
and so.s_order_no = sod.s_order_no
3232
and c.name = 'Ivan Sayross';
3333
-- Q5.- Find the names of clients who have ‘CD Drive’.
34-
select name
35-
from client_master c,
34+
select name from client_master c,
3635
sales_order so,
37-
sales_order_details sod
36+
sales_order_details sod,
37+
product_master p
3838
where c.client_no = so.client_no
3939
and so.s_order_no = sod.s_order_no
40-
and sod.product_no = 'P00001';
40+
and sod.product_no = p.product_no
41+
and p.description = 'CD DRIVE';
4142
-- Q6.- Find the products and their quantities for the orders placed by ‘Vandana’ and ‘Ivan’.
4243
select product_no,
4344
qty_order

dbms/all.sql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,14 @@ where p.product_no = sod.product_no
571571
and so.s_order_no = sod.s_order_no
572572
and c.name = 'Ivan Sayross';
573573
-- Q5.- Find the names of clients who have ‘CD Drive’.
574-
select name
575-
from client_master c,
574+
select name from client_master c,
576575
sales_order so,
577-
sales_order_details sod
576+
sales_order_details sod,
577+
product_master p
578578
where c.client_no = so.client_no
579579
and so.s_order_no = sod.s_order_no
580-
and sod.product_no = 'P00001';
580+
and sod.product_no = p.product_no
581+
and p.description = 'CD DRIVE';
581582
-- Q6.- Find the products and their quantities for the orders placed by ‘Vandana’ and ‘Ivan’.
582583
select product_no,
583584
qty_order

0 commit comments

Comments
 (0)