Pratical Program
Pratical Program
Pratical Program
End Sub
CALCULATOR
End Sub
End Sub
NOTEPAD
STUDENT DETAILS
End If
End Sub
End Sub
End Sub
End While
odareader.Close()
cn.Close()
End Sub
End Sub
MsgBox("Record deleted")
End Sub
End Class
FACULTY
FACULTY
`````````
7 rows selected.
1 row created.
8 rows selected.
LENGTH(F_NAME)
--------------
4
4
3
7
4
3
6
5
8 rows selected.
8 rows selected.
SUB
---
BAL
SIV
ASH
KIS
SIB
RAM
KAR
aad
8 rows selected.
SQL> select replace(dept,'I','C') FROM FACULTY;
REPLACE(DE
----------
CT
CT
CS
CT
CT
CT
CS
CT
8 rows selected.
CONCAT(F_ID,F_NAME)
-------------------------------------------------------
1BALZ
2SIVA
3ASH
4KISHORE
5SIBI
6RAM
7KARTHI
8aadhi
8 rows selected.
SQL>
SUM(SALARY)
-----------
225000
SQL>
SQL> SELECT AVG(SALARY) FROM FACULTY;
AVG(SALARY)
-----------
28125
MAX(SALARY)
-----------
60000
MIN(SALARY)
-----------
10000
SQL> SELECT DISTINCT DEPT,COUNT(DEPT) FROM FACULTY GROUP BY
DEPT;
DEPT COUNT(DEPT)
---------- -----------
IT 3
CS 2
CT 3
SQL>
STUDENT TABLE
STUDENT TABLE
```````````````
SQL> /
Enter value for num: 102
Enter value for name: PETER
Enter value for class: III IT
Enter value for dept: IT
Enter value for college: KASC
Enter value for mark: 78
old 1: insert into student618 values(&num,'&name','&class','&dept','&college',&mark)
new 1: insert into student618 values(102,'PETER','III IT','IT','KASC',78)
1 row created.
SQL> /
Enter value for num: 103
Enter value for name: DAVID
Enter value for class: II CS
Enter value for dept: CS
Enter value for college: KASC
Enter value for mark: 85
old 1: insert into student618 values(&num,'&name','&class','&dept','&college',&mark)
new 1: insert into student618 values(103,'DAVID','II CS','CS','KASC',85)
1 row created.
SQL> /
Enter value for num: 104
Enter value for name: JAMES
Enter value for class: I CT
Enter value for dept: CT
Enter value for college: KASC
Enter value for mark: 85
old 1: insert into student618 values(&num,'&name','&class','&dept','&college',&mark)
new 1: insert into student618 values(104,'JAMES','I CT','CT','KASC',85)
1 row created.
SQL> /
Enter value for num: 105
Enter value for name: CHARLES
Enter value for class: I IT
Enter value for dept: IT
Enter value for college: KASC
Enter value for mark: 82
old 1: insert into student618 values(&num,'&name','&class','&dept','&college',&mark)
new 1: insert into student618 values(105,'CHARLES','I IT','IT','KASC',82)
1 row created.
no rows selected
JOIN OPERATIONS
``````````````````
(i) EQUIJOIN
SQL> SELECT * FROM EMPLOYEE E, DEPARTMENT D WHERE
E.EMP_ID=D.EMP_ID;
(ii) NONEQUIJOIN
SQL> SELECT * FROM EMPLOYEE E, DEPARTMENT D WHERE E.SALARY
BETWEEN 25000 AND 30000;
EMP_ID EMP_NAME PHONE SALARY DEPT_ID DEPT_NAME EMP_ID
DESIGNATION
---------- -------------------------------------------------- ---------- ---------- ---------- ----------
---------- ---------------
101 AAA 3546787858 25000 1 PRODUCTION 101
MANAGER
101 AAA 3546787858 25000 1 PRODUCTION 102
SUPERVISOR
101 AAA 3546787858 25000 2 SALES 103 MANAGER
101 AAA 3546787858 25000 3 SERVICE 104 SUPERVISOR
101 AAA 3546787858 25000 4 PURCHASE 105
EXECUTIVE
105 EEE 6389726410 28000 1 PRODUCTION 101 MANAGER
105 EEE 6389726410 28000 1 PRODUCTION 102
SUPERVISOR
105 EEE 6389726410 28000 2 SALES 103 MANAGER
105 EEE 6389726410 28000 3 SERVICE 104 SUPERVISOR
105 EEE 6389726410 28000 4 PURCHASE 105 EXECUTIVE
10 rows selected.
(iii) SELF-JOIN
SQL> SELECT * FROM EMPLOYEE E, EMPLOYEE F WHERE E.EMP_ID=104;
EMP_ID EMP_NAME PHONE SALARY EMP_ID EMP_NAME
PHONE SALARY
---------- -------------------------------------------- ---------- ---------- ---------- --------------------
---------- ----------
104 DDD 9870642514 32000 101 AAA 3546787858
25000
104 DDD 9870642514 32000 102 BBB 8765432109
32000
104 DDD 9870642514 32000 103 CCC 7654328901
20000
104 DDD 9870642514 32000 104 DDD 9870642514
32000
104 DDD 9870642514 32000 105 EEE 6389726410
28000
5 rows selected.