0% found this document useful (0 votes)
4 views

Assignment I

Uploaded by

guptaasunny773
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Assignment I

Uploaded by

guptaasunny773
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Assignment-I

DATABASE MANAGEMENT SYSYTEM


[UBA23302T]

DONE BY: SUNNY GUPTA

REG NO. : RA2351001030093

BBA 3rd SEMESTER SECTION:-B

SUBMITTED TO: TRIPTI AG.

C:\Users\sonuk>sqlplus

SQL*Plus: Release 21.0.0.0.0 - Production on Mon Sep 30 21:14:15 2024

Version 21.3.0.0.0

Copyright (c) 1982, 2021, Oracle. All rights reserved.

Enter user-name: system

Enter password:

Last Successful login time: Mon Sep 30 2024 20:57:59 +05:30

Connected to:

Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production


Version 21.3.0.0.0

SQL> create table student(

2 no int,

3 name varchar(20),

4 age int,

5 dept varchar(20),

6 date_of_adm date,

7 fee int,

8 gender varchar(1));

Table created.

SQL> insert into student(no, name, age, dept, date_of_adm, fee, gender) values (1, 'pankaj',
24, 'computer', to_date('1997-01-10', 'yyyy-mm-dd'), 120, 'm');

1 row created.

SQL> insert into student(no, name, age, dept, date_of_adm, fee, gender) values (2, 'shalini',
21, 'history', to_date('1998-03-24', 'yyyy-mm-dd'), 200, 'f');

1 row created.

SQL> insert into student(no, name, age, dept, date_of_adm, fee, gender) values (3, 'sanjay',
22, 'hindi', to_date('1996-12-12', 'yyyy-mm-dd'), 300, 'm');

1 row created.

SQL> insert into student(no, name, age, dept, date_of_adm, fee, gender) values (4, 'sudha',
25, 'history', to_date('1999-07-01', 'yyyy-mm-dd'), 400, 'f');

1 row created.

SQL> insert into student(no, name, age, dept, date_of_adm, fee, gender) values (5, 'rakesh',
22, 'hindi', to_date('1999-09-05', 'yyyy-mm-dd'), 250, 'm');

1 row created.
SQL> insert into student(no, name, age, dept, date_of_adm, fee, gender) values (6, 'shakeel',
30, 'history', to_date('1998-06-27', 'yyyy-mm-dd'), 300, 'm');

1 row created.

SQL> insert into student(no, name, age, dept, date_of_adm, fee, gender) values (7, 'surya', 34,
'computer', to_date('1997-02-25', 'yyyy-mm-dd'), 210, 'm');

1 row created.

SQL> insert into student(no, name, age, dept, date_of_adm, fee, gender) values (7, 'surya', 34,
'computer', to_date('1997-02-25', 'yyyy-mm-dd'), 210, 'm');

1 row created.

SQL> insert into student(no, name, age, dept, date_of_adm, fee, gender) values (8, 'shikha',
23, 'hindi', to_date('1997-07-31', 'yyyy-mm-dd'), 200, 'f');

1 row created.

SQL> commit;

Commit complete.

SQL> select* from student;

NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

1 pankaj 24 computer 10-JAN-97

120 m

2 shalini 21 history 24-MAR-98

200 f
3 sanjay 22 hindi 12-DEC-96

300 m

NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

4 sudha 25 history 01-JUL-99

400 f

5 rakesh 22 hindi 05-SEP-99

250 m

6 shakeel 30 history 27-JUN-98

300 m

NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

7 surya 34 computer 25-FEB-97

210 m
7 surya 34 computer 25-FEB-97

210 m

8 shikha 23 hindi 31-JUL-97

200 f

9 rows selected.

SQL> select* from student order by name desc;

NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- --------- FEE G

---------- -

7 surya 34 computer 25-FEB-97

210 m

7 surya 34 computer 25-FEB-97

210 m

4 sudha 25 history 01-JUL-99

400 f

NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

8 shikha 23 hindi 31-JUL-97

200 f

2 shalini 21 history 24-MAR-98

200 f
6 shakeel 30 history 27-JUN-98

300 m

NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

3 sanjay 22 hindi 12-DEC-96

300 m

5 rakesh 22 hindi 05-SEP-99

250 m

1 pankaj 24 computer 10-JAN-97

120 m

9 rows selected.

SQL> select* from student order by name asc;

NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

1 pankaj 24 computer 10-JAN-97

120 m

5 rakesh 22 hindi 05-SEP-99

250 m

3 sanjay 22 hindi 12-DEC-96

300 m
NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

6 shakeel 30 history 27-JUN-98

300 m

2 shalini 21 history 24-MAR-98

200 f

8 shikha 23 hindi 31-JUL-97

200 f

NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

4 sudha 25 history 01-JUL-99

400 f

7 surya 34 computer 25-FEB-97

210 m

7 surya 34 computer 25-FEB-97

210 m

9 rows selected.

SQL> select* from student where dept='history';


NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

2 shalini 21 history 24-MAR-98

200 f

4 sudha 25 history 01-JUL-99

400 f

6 shakeel 30 history 27-JUN-98

300 m

SQL> select name from student where dept='hindi' and gender='f';

NAME

--------------------

shikha

SQL> select name from student order by date_of_adm asc;

NAME

--------------------

sanjay

pankaj

surya

surya

shikha

shalini

shakeel

sudha
rakesh

9 rows selected.

SQL> insert into student(no, name, age, dept, date_of_adm, fee, gender) values (9, 'zaheer',
36, 'computer', to_date('1997-01-10', 'yyyy-mm-dd'), 230, 'm');

1 row created.

SQL> select* from student;

NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

1 pankaj 24 computer 10-JAN-97

120 m

2 shalini 21 history 24-MAR-98

200 f

3 sanjay 22 hindi 12-DEC-96

300 m

NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

4 sudha 25 history 01-JUL-99

400 f

5 rakesh 22 hindi 05-SEP-99

250 m

6 shakeel 30 history 27-JUN-98

300 m
NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

7 surya 34 computer 25-FEB-97

210 m

7 surya 34 computer 25-FEB-97

210 m

8 shikha 23 hindi 31-JUL-97

200 f

NO NAME AGE DEPT DATE_OF_A

---------- -------------------- ---------- -------------------- ---------

FEE G

---------- -

9 zaheer 36 computer 10-JAN-97

230 m

10 rows selected.

SQL>

You might also like