Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

MaulanaAbulKalamAzadUniversityofTechnology,WestBengal

Assignment-2

Stream :ComputerScience&Engineering/SoftwareEngineering
Subject :AdvancedDatabaseManagementSystem
SubjectCode:PGCSE201/PGSE201

1.Createthefolowingtable:STUDENTanddisplaystructure

ColumnName DataType Size Constraints


RegNo Varchar2 6 Notnul
RolNo Number 6 Notnul
Name Varchar2 10 Notnul
Address Varchar2 15 Notnul
PhoneNo Number 10
YearOfAdm Number 4 Notnul
DeptCode Varchar2 4 Notnul
Year Number 1 Notnul
BirthDate Date Notnul

2.Insertthefolowingdatainthestudenttable.

RegNo RolNo Name Address PhoneN YearOfAd DeptCod Yea BirthDate


o m e r
01230 12300 Jit Jadavp 2476189 2018 CSE 2 11-Jun-91
1 1 ur 2
01231 12301 Emilie Kasba 2442498 2018 SE 2 9-Sep-91
5 5 7
01242 12402 Monisha Kaikhali 2573960 2017 CSE 2 5-Aug-92
4 4 8
01225 12205 Abhishe Hooghly 3671969 2016 SE 1 4-Dec-90
0 0 k 5
01234 12304 Bilash Howrah nul 2016 IT 1 13-Jan-92
4 4
01235 12305 Atanu Barasat 2542674 2016 IT 1 5-Jul-91
7 7 2
01241 12401 Tanusre Garia 2475565 2017 CSE 2 7-Oct-92
9 9 e 5
01242 12402 Sima Garia 2475330 2017 IT 2 2-Mar-93
7 7 6
01223 12203 Akashjit Jaguli nul 2018 SE 1 11-Dec-90
6 6
01234 12304 Golapsa Kasba 2442868 2018 SE 1 5-Apr-91
9 9 2

1.WriteSQLcommandtoaddprimarykeytothetableSTUDENTwithRegNoas
PrimaryKey
MaulanaAbulKalamAzadUniversityofTechnology,WestBengal

2.Displayalstudentrecords

3.Displayname,addressandyearofadmissionofeachstudent

4.ListthenameandyearofstudentswhoareinComputerScience.

5.Listthenamesanddepartmentsofstudentsbelongingto1styear.

6.Displaynamesofstudentswith‘a’asthesecondleterintheirnames.

7.Displaynamesofstudentsindescendingalphabeticalorder.

8.Displaynamesandaddressesofstudentswhotookadmissionintheyear
2004.

9.Listthenamesofstudentswhodoesnothaveaphonenumber.

10.Listnamesofstudentandtheirdepartmentswhosedateofbirthisafter1st
June1991.

11.CreateaCHECKconstraintonthistableforthefieldYearsuchthatYear
shouldbebetween1&2.

12.Update2ndyearstudentstomakeYear=3.Observeandnotethemessage.

You might also like