Table created.
SQL> insert into student_master values('&name',&Reg_no,'&dept', &year);
Enter value for name: Navin
Enter value for reg_no: 001
Enter value for dept: BCA
Enter value for year: 1991
old 1: insert into student_master values('&name',&Reg_no,'&dept', &year)
new 1: insert into student_master values('Navin',001,'BCA', 1991)
1 row created.
SQL> /
Enter value for name: Neenu
Enter value for reg_no: 002
Enter value for dept: BCA
Enter value for year: 1989
old 1: insert into student_master values('&name',&Reg_no,'&dept', &year)
new 1: insert into student_master values('Neenu',002,'BCA', 1989)
1 row created.
SQL> /
Enter value for name: XXX
Enter value for reg_no: 003
Enter value for dept: BCA
Enter value for year: 1990
old 1: insert into student_master values('&name',&Reg_no,'&dept', &year)
new 1: insert into student_master values('XXX',003,'BCA', 1990)
1 row created.
SQL> SELECT * FROM STUDENT_MASTER;
NAME REG_NO DEPT YEAR
---------------- ---------- ---------------- ----------
Navin 1 BCA 1991
Neenu 2 BCA 1989
XXX 3 BCA 1990
SQL> SELECT NAME FROM STUDENT_MASTER;
NAME
--------------------
Navin
Neenu
XXX
SQL> SELECT DISTINCT (REG_NO),NAME,DEPT,YEAR FROM STUDENT_MASTER;
REG_NO NAME DEPT YEAR
----- ---------------- ----------------- ----------
1 Navin BCA 1991
2 Neenu BCA 1989
3 XXX BCA 1990
SQL> SELECT DISTINCT * FROM STUDENT_MASTER ORDER BY REG_NO DESC;
NAME REG_NO DEPT YEAR
-------------- ---------- -------- ----------
XXX 3 BCA 1990
Neenu 2 BCA 1989
Navin 1 BCA 1991
SQL> SELECT * FROM STUDENT_MASTER WHERE DEPT = 'BCA';
NAME REG_NO DEPT YEAR
-------------- ---------- -------- ----------
XXX 3 BCA 1990
Neenu 2 BCA 1989
Navin 1 BCA 1991