CSE 2-2 JNTUH Syllabus
CSE 2-2 JNTUH Syllabus
CSE 2-2 JNTUH Syllabus
Objectives:
Tounderstandbasiccomponentsofcomputers.
ToexploretheI/Oorganizationsindepth.
Toexplorethememoryorganization.
Tounderstandthebasicchipdesignandorganizationof8086withassmblylanguage
programming.
UNITI
BasicComputerOrganizationFunctionsofCPU,I/OUnits,MemoryInstruction:InstructionFormats
Oneaddress,twoaddresses,zeroaddressesandthreeaddressesandcomparisonaddressingmodes
withmumericexamples:ProgramControlStatusbitconditions,conditionalbranchinstructions,
ProgramInterrupts:TypesofInterrupts.
UNITII
InputPutputOrganizationsI/OInterface,I/OBusandInterfacemodules:I/OVsmemoryBus,
IsolatedVsMemoryMappedI/O,AsynchronousdataTransferStorbeControl,HandShaking:
AsynchronousSerialtransferAsynchronousCommunicationinterface,Modesoftransferprogrammed
I/O,InterruptInitiatedI/O,DMADMAController,DMATransfer,IOPCPUIOPCommunication,Intel
*)*(IOP.
UNITIII
MemoryOrganizations
Memoryhierarchy,MainMemory,RAM,ROMChips,MemoryAddressMap,MemoryConnectionto
CPU,associatememory,CacheMemory,DataCache,Instructioncache,MissandHitratio,Access
timeassociative,setassociative,mapping,waitingintocache,Introductiontovirtualmemory.
UNITIV
8086CPUPinDiagramSpecialfunctionsofgeneralpurposeregisters.Segmentregister,conceptof
pipelining,8086Flagregister,Addressingmodesof8086.
UNITV
8086Instructionformats:assemblyLanguageProgramsinvolvingbranch&Callinstructions,sorting,
evaluationofarthmeticexpressions.
TEXTBOOKS:
1. ComputerSystemArchitecture:MorisMano(UNIT1,2,3).
2. AdvancedMicroProcessorandPeripheralsHall/AKRay(UNIT4,5).
REFERENCEBOOKS:
1. ComputerOrganizationandArchitectureWilliamStallingsSixthEdition,Pearson/PHI.
2. StructuredComputerOrganizationandDesignAndrewS.Tanenbaum,4thEdition
PHI/Pearson.
3. FundamentalsorComputerOrganizationandDesignSivaraamaDandamudiSpringerInt.
Edition.
4. ComputerArchitectureaquantitiveapproach,JhonL.HennessyandDavidA.Patterson,
FourthEditionElsevier.
5. ComputerArchitecture:FundamentalsandprinciplesofComputerDesign,JosephD.Dumas
II,BSPublication.
(A40507)DATABASEMANAGEMENTSYSTEMS
Objectives:
Tounderstandthebasicconceptsandtheapplicationsofdatabasesystems.
TomasterthebasicsofSQLandconstructqueriesusingSQL.
Tounderstandtherelationaldatabasedesignprinciples.
Tobecomefamiliarwiththebasicissuesoftransactionprocessingandconcurrencycontrol.
Tobecomefamiliarwithdatabasestoragestructuresandaccesstechniques.
UNITI
IntroductionDatabaseSystemApplications,PurposeofDatabaseSystems,ViewofDataData
Abstraction,InstancesandSchemas,DataModels,DatabaseLanguagesDDL,DML,Database
Architecture,DatabaseUsersandAdminnistrators,HistoryofDatabaseSystems.
IntroductiontoDatabasedesign,ERdiagrams,BeyondERDesign,Entities,AttributesndEntity
sets,RelationshipsandRelationshipsets,AdditionalfeaturesofERModel,ConceptualDesignwith
theERModel,ConceptualDesignforLargeenterprises.RelationalModel:Introductiontothe
RelationalModelIntegrityConstraintsoverRelations,EnforcingIntegrityconstraints,Querying
relationaldata,LogicaldatabaseDesign,IntroductiontoViewsDestroying/alteringTablesandViews.
UNITII
RelationalAlgebraandCalculus:RelationalAlgebraSelectionandProjection,Setoperations,
Renaming,Joins,Division,ExamplesofAlgebraQueries,RelationalcalculusTuplerelational
CalculusDomainrelationalcalculusExpressivePowerofAlgebraandcalculus.
FormofBasicSQLQueryExamplesofBasicSQLQueries,IntroductiontoNestedQueries,
CorrelatedNestedQueries,SetComparisonOperators,AggregateOperators,NULLvalues
ComparisonusingNullvaluesLogicalconnectivesAND,ORandNOTImpactonSQLConstructs,
OuterJoins,DisallowingNULLvalues,ComplexIntegrityConstraintsinSQLTriggersandActiveData
bases.
UNITIII
IntroductiontoSchemaRefinementProblemsCausedbyredundancy,DecompositionsProblem
relatedtodecomposition,FunctionalDependenciesReasoningaboutFDS,NormalFormsFIRST,
SECOND,THIRDNormalformsBCNFPropertiesofDecompositionsLosslessjoin
Decomposition,DependencypreservingDecomposition,SchemaRefinementinDatabaseDesign
MultivaluedDependenciesFOURTHNormalForm,JoinDependencies,FIFTHNormalform,
InclusionDependencies.
UNITIV
TransactionManagementTransactionConceptTransactionStateImplementationofAtomicityand
DurabilityConcurrentExecutionsSerializabilityRecoverabilityImplementationofIsolation
Testingforserializability.
ConcurrencyControlLockBasedProtocolsTimestampBasedProtocolsValidationBased
ProtocolsMultipleGranularity.
RecoverySystemFailureClassificationStorageStructureRecoveryandAtomicityLogBased
RecoveryRecoverywithConcurrentTransactionsBufferManagementFailurewithlossof
nonvolatilestorageAdvanceRecoverysystemsRemoteBackupsystems.
UNITV
OverviewofStorageandIndexing:DataonExternalStorage,FileOrganizationandIndexing
ClusteredIndexes,PrimaryandSecondaryIndexes,IndexdataStructuresHashBasedIndexing,
TreebasedIndexing,ComparisonofFileOrganizations.
TreeStructuredIndexing:Intuitionsfortreeindexes,IndexedSequentialAccessMethods(ISAM)B+
Trees:ADynamicIndexStructure,Search,Insert,Delete.
HashBasedIndexing:StaticHashing,Extendablehashing,LinearHashing,Extendiblevs.Linear
Hashing.
TEXTBOOKS:
1. DatabaseManagementSystems,RaghuramaKrishnan,JohannesGehrke,TATAMcGrawHill,
3rdEdition,2003.
2. DatabaseSystemConcepts,A.Silberschatz,H.F.Korth,S.Sudarshan,McGrawHill,VI
edition,2006.
REFERENCESBOOKS:
1. DatabaseSystems,6thedition,RamezElmasri,ShamkatB.Mavathe,PearsonEducation,
2013.
2. DatabasePrinciples,Programming,andPerformance,P.O'Neil,E.O'Neil,2nded.,ELSEVIER.
3. DatabaseSystems,APracticalapproachtoDesignimplementationandManagementFourth
edition,ThomasConnolly,carolynBegg,Pearsoneducation.
4. DatabaseSystemsConcepts,PeterRob&CarlosCoronel,CengageLearning,2008.
5. FundamentalsofrelationalDatabaseManagementSystems,S.Sumathi,S.Esakkirajan,
Springer.
6. DatabaseManagementSystemOracleSQLandPL/SQL,P.K.DasGupta,PHI.
7. IntroductiontoDatabaseManagement,M.L.Gillensonandothers,WileyStudentEdition.
8. DatabaseDevelopmentandManagement,LeeChao,Auerbachpublications,Taylor&Francis
Group.
9. IntroductiontoDatabaseSystems,C.J.Date,PearsonEducation.
10. DatabaseManagementSystems,G.K.Gupta,TMH.
(A40503)JAVAPROGRAMMING
Objectives:
Tounderstandobjectorientedprogrammingconcepts,andapplytheminproblemsolving.
TolearnthebasicsofjavaConsoleandGUIbasedprogramming.
UNITI
OOPconceptsDataabstraction,encapsulation,inheritance,benefitsofinheritance,polymorphism,
classesandobjects,Proceduralandobjectorientedprogrammingparadigms.
JavaprogrammingHistoryofJava,comments,datatypes,variables,constants,scopeandlifetime
ofvariables,operators,operatorhierarchy,expressions,typeconversionandcasting,enumerated
types,controlflowblockscope,conditionalstatements,loops,breakandcontinuestatements,simple
javastandaloneprograms,arrays,consoleinputandoutput,formattingoutput,constructors,methods,
parameterpassing,staticfieldsandmethods,accesscontrol,thisreference,overloadingmethodsand
constructors,recursion,garbagecollection,buildingstrings,exploringstringclass.
UNITII
InheritanceInheritancehierarchies,superandsubclasses,Memberaccessrules,superkeyword,
preventinginheritance:finalclassesandmethods,theObjectclassanditsmethods.
Polymorphismdynamicbinding,methodoverriding,abstractclassesandmethods.
InterfacesInterfacesvs.Abstractclasses,defininganinterface,implementinginterfaces,accessing
implementationsthroughinterfacereferences,extendinginterfaces.
Innerclassesusesofinnerclassses,localinnerclasses,anonymousinnerclasses,staticinner
classes,examples.
PackagesDefining,CreatingandAccessingaPackage,UnderstandingCLASSPATH,importing
packages.
UNITIII
ExceptionhandlingDealingwitherrors,benefitsofexecutionhandling,theclassificationof
exceptionsexceptionhierarchy,checkedexceptionsanduncheckedexceptions,usageoftry,catch,
throw,throwsandfinally,rethrowingexceptions,exceptionspecification,builtinexceptions,creating
ownexceptionsubclasses.
MultithreadingDifferencebetweenmultipleprocessesandmultiplethreads,threadstates,creating
threads,interruptingthreads,threadpriorities,synchronizingthreads,interthreadcommunication,
procedureconsumerpattern.
UNITIV
CollectionFrameworkinJavaIntroductiontoJavaCollections,OverviewofJavaCollectionframe
work,Generics,CommonlyusedCollectionclassesArrayList,Vector,Hashtable,Stack,
Enumeration,Iterator,StringTokenizer,Random,Scanner,calenderandProperties
Filesstreamsbytestreams,characterstreams,textinput/output,binaryinput/output,random
accessfileoperations,FilemanagamentusingFileclass.
ConnectingtoDatabaseJDBCType1to4drives,connectingtoadatabase,queryingadatabase
andprocessingtheresults,updatingdatawithJDBC.
UNITV
GUIProgrammingwithJavaTheAWTclasshierarchy,IntroductiontoSwing,Swingvs,AWT,
HierarchyforSwingcomponents,ContainersJFrame,JApplet,JDialog,JPanel,Overviewofsome
swingcomponentsJbutton,JLabel,JTextField,JTextArea,simpleswingapplications,Layout
managementLayoutmanagertypesborder,gridandflow
EventhandlingEvents,Eventsources,Eventclasses,EventListeners,RelationshipbetweenEvent
sourcesandListerners,Delegationeventmodel,Examples:handlingabuttongclick,handlingmouse
events,Adapterclasses.
AppletsInheritancehierarchyforapplets,differencesbetweenappletsandapplications,lifecycleof
anapplet,passingparameterstoapplets,appletsecurityissues.
TEXTBOOKS:
1. JavaFundamentalsAcomprehensiveIntroduction,HerbetSchidtandDaleSrien,TMH.
REFERENCESBOOKS:
1. JavaforProgrammers,P.J.DeitelandH.M.Deitel,Pearsoneducation(OR)Java:Howto
ProgramP.J.DeitelandH.M.Deitel,PHI.
2. ObjectOrientdProgrammingthroughJava,P.RadhaKrishna,UniversitiesPress.
3. ThinkinginJava,BruceEckel,PearsonEducation
4. ProgramminginJava,BruceEckel,PearsonEducation
5. ProgramminginJava,S.MalhotraandS.Choudhary,OxfordUniv.Press.
(
A40009)
ENVIRONMENTALSTUDIES
Objectives:
1. Understandingtheimportanceofecologicalbalanceforsustainabledevelopment.
2. Understandingtheimpactsofdevelopmentalactivitiesandmitigationmeasures.
3. Understandingtheenvironmentalpoliciesandregulations.
UNITI
Ecosystems:Definition,ScopeandImportanceecosystem.Classification,Structureandfunctionof
anecosystem,Foodchains,foodwebsandecologicalpyramids.Energyflowintheecosystem,
Biogeochemicalcycles,Bioaccumulation,ecosystemvalue,dervicesandcarryingcapacity,Field
visits.
UNITII
NaturalResources:ClassificationofResources:LivingandNonLivingresources,waterrsources:
useandoverutilizationofsurfaceandgroundwater,floodsanddroughts,Dams:benefitsandproblem,
Mineralresources:useandexploitation,environmentaleffectsofextractingandusingmineral
resouces,Landresources:Forestresources,Energyresources:growingenergyneeds,renewable
energysource,casestudies.
UNITIII
Biodiversityanditsconservation:IntroductionDefinition:genetic,speciesandecosystemdiversity.
BiogeographicalclassificationofIndiaValueofbiodiversity:consumptiveuse,productiveuse,social,
ethical,aestheticandoptionvalues.Biodiversityatglobal,Nationalandlocallevels..Indiaasa
megadiversitynationHotsportsofbiodiversityThreatstobiodiversity:habitatloss,poachingof
wildlife,manwildlifeconflictsConservationofbiodiversity:InsituandExsituconservation.National
biodiversityact.
UNITIV
EnvironmentalPollutionandControlTechnologies:EnvironmentalPollution&Control:Classificationof
pollution,AirPollution:Primaryandsecondarypollutants,Automobileandindustrialpollition,Ambient
airqualitystandards.Waterpollution:Sourcesandtypes,Impactsofmodernagriculture,degradationof
soil.NoisePollution:SourcesandHealthhazards,standards,SolidWastemanagementcomposition
andcharacteristicsofeWasteanditsmanagement.Pollutioncontroltechnologies:Wastewater
Treatmentmethods:Primary,SecondaryandTertiary.
Overviewofairpollutioncontroltechnologiew,Conceptofbioremediation.GlobalEnvironmental
ProblemsandGlobalEfforts:Climatechangeandimpactsonhumanenvironment.Ozonedepletionand
Ozonedepletingsubstances(ODS).Deforestationanddesertification.Internationalconventions/
Protocols:Earthsummit,KyotoprotocolandMentrealProtocol.
UNITV
EnvironmentalPolicy,Legislation&EIA:EnvironmentalProtectionact,LegalaspectsAirAct1981,
WaterAct,ForestAct,Municipalsolidwastemanagementandhandlingrules,biomedicalwaste
managementandhandlingrules,hazardouswastemanagementandhandlingrules.EIA:EIAstructure,
methodsofbaselinedataacquistion.OverviewonImpactsofair,water,biologicalandSocio
economicalaspects.Strategiesforriskassessment,ConceptsofEnvironmentalManagement
Plan(EMP).TowardsSustainableFuture:ConceptofSustainableDevelopment,Populationandits
explosion,CrazyConsumerism,EnviromentalEducation,UrbanSprawlHumanHealth,
EnvironamentalEthics,ConceptofGreenBuilding,Ecologicalfootprint,LifeCycleAssessment(LCA),
Lowcarbonlifestyel.
TEXTBOOK:
1.TextbookofEnvironmentalStudiesforUndergraduateCoursesbyErachBharuchaforUniversity
GrantsCommission.
2.EnvironmentalStudiesbyR.Rajagopalan,OxfordUniversityPress.
REFERENCE:
1. TextbookofEnvironmentalSciencesandTechnologybyM.AnjiReddy,BSPublication.
2. EnviromentalScience:towardsasustainablefuturebyRichardT.Wright.2008PHLLearning
PrivateLtd.NewDelhi.
3. EnvironmentalEngineeringandsciencebyGilbertM.MastersandWendellP.Ela.2008PHI
LearningPvtLtd.
4. EnvironmentalSciencebyDanielB.Botkin&EdwardsA.Keller,WileyINDIAedition.
5. EnviromentalStudiesbyAnubhaKaushik,4thEdition,Newageinternationalpublishers.
(A40509)FORMALLANGUAGESANDAUTOMATATHEORY
Objectives:
Thepurposeofthiscourseistoacquaintthestudentwithanoverviewofthetheoreticalfoundationsof
computersciencefromtheperspectiveofformallanguages.
Classifymachinesbytheirpowertorecognizelanguages.
Employfinitestatemachinestosolveproblemsincomputing.
Explaindeterministicandnondeterministicmachines.
Comprehendthehierarchyofproblemsarisinginthecomputersciences.
UNITI:
Fundamentals:Strings,Alphabet,Language,Operations,Finitestatemachine,definitions,finite
automatonmodel,acceptanceofstrings,andlanguages,deterministicfiniteautomatonandnon
deterministicfiniteautomaton,transitiondiagramsandLanguagerecognizers.
FiniteAutomata:NFAwithtransitionsSignificance,acceptanceoflanguages.Conversionsand
Equivalence:EquivalencebetweenNFAwithandwithouttransitions,NFAtoDFAconversion,
minimisationofFSM,equivalencebetweentwoFSMs,FiniteAutomatawithoutputMooreandMelay
machines.
UNITII:
RegularLanguages:Regularsets,regularexpressions,identityrules,ConstructingfiniteAutomatafor
agivenregularexpressions,ConversionofFiniteAutomatatoRegularexpressions.Pumpinglemmaof
regularsets,closurepropertiesofregularsets(proofsnotrequired).
GrammarFormalism:Regulargrammarsrightlinearandleftlineargrammars,equivalencebetween
regularlineargrammarandFA,interconversion,Contextfreegrammar,derivationtrees,sentential
forms.Rightmostandleftmostderivationofstrings.
UNITIII:
ContextFreeGrammars:Ambiguityincontextfreegrammars.MinimisationofContextFree
Grammars.Chomskynormalform,Greibacknormalform,PumpingLemmaforContextFree
Languages.EnumerationofpropertiesofCFL(proofsomitted).
PushDownAutomata:Pushdownautomata,definition,model,acceptanceofCFL,Acceptanceby
finalstateandacceptancebyemptystateanditsequivalence.EquivalenceofCFLandPDA,
interconversion.(Proofsnotrequired).IntroductiontoDCFLandDPDA.
UNITIV:
TuringMachine:TuringMachine,definition,model,designofTM,Computablefunctions,recursively
enumerablelanguages.Churchshypothesis,countermachine,typesofTuringmachines(proofsnot
required).linearboundedautomataandcontextsensitivelanguage.
UNITV:
ComputabilityTheory:Chomskyhierarchyoflanguages,linearboundedautomataandcontext
sensitivelanguage,LR(0)grammar,decidabilityof,problems,UniversalTuringMachine,undecidability
ofposts.Correspondenceproblem,Turingreducibility,DefinitionofPandNPproblems,NPcomplete
andNPhardproblems.
TEXTBOOKS:
1. IntroductiontoAutomataTheoryLanguagesandComputation.HopcroftH.E.andUllmanJ.
D.PearsonEducation
2. IntroductiontoTheoryofComputationSipser2ndeditionThomson
REFERENCESBOOKS:
1. IntroductiontoFormllanguagesAutomataTheoryandComputationKamalaKrithivasanRama
R.
2. IntroductiontoComputerTheory,DanielI.A.Cohen,JohnWiley.
3. TheoryOfComputation:AProblemSolvingApproach,KaviMahesh,WileyIndiaPvt.Ltd.
4. ElementsofTheoryofComputation,LewisH.P.&PapadimitionC.H.Pearson/PHI.
5. TheoryofComputerScienceAutomatalanguagesandcomputationMishraand
Chandrashekaran,2ndedition,PHI.
(
A40508)
DESIGNANDANALYSISOFALGORITHMS
Objectives:
Toanalyzeperformanceofalgorithms.
Tochoosetheappropriatedatastructureandalgorithmdesignmethodforaspecified
application.
Tounderstandhowthechoiceofdatastructuresandalgorithmdesignmethodsimpactsthe
performanceofprograms.
Tosolveproblemsusingalgorithmdesignmethodssuchasthegreedymethod,divideand
conquer,dynamicprogramming,backtrackingandbranchandbound.
Prerequisites(Subjects)Datastructures,Mathematicalfoundationsofcomputerscience.
UNITI:
Introduction:Algorithm,Psuedocodeforexpressingalgorithms,PerformanceAnalysisSpace
complexity,Timecomplexity,AsymptoticNotationBigohnotation,Omeganotation,Thetanotation
andLittleohnotation,Probabilisticanalysis,Amortizedanalysis.
Divideandconquer:Generalmethod,applicationsBinarysearch,Quicksort,Mergesort,Strassens
matrixmultiplication.
UNITII:
SearchingandTraversalTechniques:Efficientnonrecursivebinarytreetraversalalgorithm,Disjoint
setoperations,unionandfindalgorithms,Spanningtrees,GraphtraversalsBreadthfirstsearchand
Depthfirstsearch,AND/ORgraphs,gametrees,ConnectedComponents,Biconnected
components.DisjointSetsdisjointsetoperations,unionandfindalgorithms,spanningtrees,
connectedcomponentsandbiconnectedcomponents.
UNITIII:
Greedymethod:Generalmethod,applicationsJobsequencingwithdeadlines,0/1knapsackproblem,
Minimumcostspanningtrees,Singlesourceshortestpathproblem.
DynamicProgramming:Generalmethod,applicationsMatrixchainmultiplication,Optimalbinarysearch
trees,0/1knapsackproblem,Allpairsshortestpathproblem,Travellingsalespersonproblem,
Reliabilitydesign.
UNITIV:
Backtracking:Generalmethod,applicationsnqueenproblem,sumofsubsetsproblem,graphcoloring,
Hamiltoniancycles.
BranchandBound:Generalmethod,applicationsTravellingsalespersonproblem,0/1knapsack
problemLCBranchandBoundsolution,FIFOBranchandBoundsolution.
UNITV:
NPHardandNPCompleteproblems:Basicconcepts,nondeterministicalgorithms,NPHardand
NPCompleteclasses,Cookstheorem.
TEXTBOOKS:
1. FundamentalsofComputerAlgorithms,EllisHorowitz,SatrajSahniand
Rajasekharam,Galgotiapublicationspvt.Ltd.
2. FoundationsofAlgorithm,4thedition,R.NeapolitanandK.Naimipour,JonesandBartlett
Learning.
3. DesignandAnalysisofAlgorithms,P.H.Dave,H.B.Dave,PearsonEducation,2008.
REFERENCES:
1. ComputerAlgorithms,IntroductiontoDesignandAnalysis,3rdEdition,SaraBaase,Allen,
Van,Gelder,PearsonEducation.
2. AlgorithmDesign:Foundations,AnalysisandInternetexamples,M.T.GoodrichandR.
Tomassia,JohnWileyandsons.
3. FundamentalsofSequentialandParallelAlgorithm,K.A.BermanandJ.L.Paul,Cengage
Learning.
4. IntroducationtotheDesignandAnalysisofAlgorithms,A.Levitin,PearsonEducation.
5. IntroducationtoAlgorithms,3rdEdition,T.H.Cormen,C.E.Leiserson,R.L.Rivest,andC.
Stein,PHIPvt.Ltd.
6. DesignandAnalysisofalgorithm,Aho,UllmanandHopcroft,PearsonEducation,2004.
(A40585)JAVAPROGRAMMINGLAB
Objectives:
Tointroducejavacompilerandeclipseplatform.
Toimparthandonexperiencewithjavaprogramming.
Note:
i.
UseLinuxandMySQLfortheLabExperiments.Thoughnotmandatory,encouragetheuseof
Eclipseplatform.
ii.
Thelistsuggeststheminimumprogramset.Hence,theconcernedstaffisrequestedtoadd
moreproblemstothelistasneeded.
1. UseEclipseorNetbeanplatformandacquaintwiththevariousmenus.Createatestproject,
addatestclassandrunit.Seehowyoucanuseautosuggestions,autofill.Trycodeformatter
andcoderefactoringlikerenamingvariables,methodsandclasses.Trydebugstepbystep
withasmallprogramofabout10to15lineswhichcontainsatleastoneifelseconditionanda
forloop.
2. WriteaJavaprogramthatworksasasimplecalculator.Useagridlayouttoarrangebuttons
forthedigitsandforthe+,,*,%operations.Addatextfieldtodisplaytheresult.Handleany
possibleexceptionslikedividedbyzero.
3.
a. DevelopanappletinJavathatdisplaysasimplemessage.
b. DevelopanappletinJavathatreceivesanintegerinonetextfield,andcomputesits
factorialValueandreturnsitinanothertextfield,whenthebuttonnamed"Compute"is
clicked.
4. WriteaJavaprogramthatcreatesauserinterfacetoperformintegerdivisions.Theuserenters
twonumbersinthetextfields,Num1andNum2.ThedivisionofNum1andNum2isdisplayed
intheResultfieldwhentheDividebuttonisclicked.IfNum1orNum2werenotaninteger,the
programwouldthrowaNumberFormatException.IfNum2wereZero,theprogramwould
throwanArithmeticException.Displaytheexceptioninamessagedialogbox.
5. WriteaJavaprogramthatimplementsamultithreadapplicationthathasthreethreads.First
threadgeneratesrandomintegerevery1secondandifthevalueiseven,secondthread
computesthesquareofthenumberandprints.Ifthevalueisodd,thethirdthreadwillprintthe
valueofcubeofthenumber.
6. WriteaJavaprogramthatconnectstoadatabaseusingJDBCanddoesadd,delete,modify
andretrieveoperations.
7. WriteaJavaprogramthatsimulatesatrafficlight.Theprogramletstheuserselectoneof
threelights:red,yellow,orgreenwithradiobuttons.Onselectingabutton,anappropriate
messagewith"Stop"or"Ready"or"Go"shouldappearabovethebuttonsinselectedcolr.
Initiallythereisnomessageshown.
8. WriteaJavaprogramtocreateanabstractclassnamedShapethatcontainstwointegersand
anemptymethodnamedprintArea().ProvidethreeclassesnamedRectangle,Triangleand
CirclesuchthateachoneoftheclassesextendstheclassShape.Eachoneoftheclasses
containsonlythemethodprintArea()thatprintstheareaofthegivenshape.
9. SupposethatatablenamedTable.txtisstoredinatextfile.Thefirstlineinthefileisthe
header,andtheremaininglinescorrespondtorowsinthetable.Theelementsareseperatedby
commas.WriteajavaprogramtodisplaythetableusingLabelsinGridLayout.
10. WriteaJavaprogramthathandlesallmouseeventsandshowstheeventnameatthecenter
ofthewindowwhenamouseeventisfired(UseAdapterclasses).
11. WriteaJavaprogramthatloadsnamesandphonenumbersfromatextfilewherethedatais
organizedasonelineperrecordandeachfieldinarecordareseperatedbyatab().Ittakesa
nameorphonenumberasinputandprintsthecorrespondingothervaluefromthehashtable
(hint:usehashtables).
12. Implementtheaboveprogramwithdatabaseinsteadofatextfile.
13. WriteaJavaprogramthattakestabseperateddata(onerecordperline)fromatextfileand
insertsthemintoadatabase.
14. Writeajavaprogramthatprintsthemetadataofagiventable.
TEXTBOOK:
1. JavaFundamentalsAcomprehensiveIntroduction,HerbertSchildtanddaleskrien,TMH.
REFERENCEBOOKS:
1. JavaforProgrammers,P.J.DeitelandH.M.Deitel,Pearsoneducation(OR)Java:Howto
ProgramP.J.DeitelandH.M.Deitel,PHI.
2. ObjectOrientsProgrammingthroughJava,P.RadhaKrishna,UniversitiesPress.
3. ThinkinginJava,BruceEckel,PearsonEducation.
4. ProgramminginJava,S.MalhotraandS.Choudhary,OxfordUniv.Press.
(A40584)DATABASEMANAGEMENTSYSTEMSLAB
Objectives:
ThislabenablesthestudentstopracticetheconceptlearntinthesubjectDBMSbydeveloping
adatabaseforanexamplecompanynamed"RoadwayTravels"whosedescriptionisas
follows.Thestudentisexpectedtopracticethedesigning,developingandqueryingadatabase
inthecontextofexampledatabase"Roadwaytravels".Studentsareexpectedtouse"Mysql"
database.
RoadwayTravels
"RoadwayTravels"isinbusinesssince1997withseveralbusesconnectingdifferentplacesinindia.
ItsmainofficeislocatedinHydearabd.
Thecompanywantstocomputerizeitsoperationsinthefollowingareas:
ReservationandTicketing
Cancellations
Reservation&Cancellation:
Reservationsaredirectlyhandledbybookingoffice.Reservationscanbemade30daysinadvance
andticketsissuedtopassenger.OnePassenger/personcanbookmanytickets(tohis/herfamily).
Cancellationsarealsodirectlyhandedatthebokkingoffice.
IntheprocessofcomputerizationofRoadwayTravelsyouhavetodesignanddevelopaDatabase
whichconsiststhedataofBuses,Passengers,Tickets,andReservationandcancellationdetails.You
shouldalsodevelopquery'susinfSQLtoretrievethedatafromdatabase.
Theaboveprocessinvolvesmanystepslike1.AnalyzingtheproblemandidentifyingtheEntitiesand
Relationships,2.ERModel3.RelationalModel4.Normalization5.Creatingthedatabase6.Querying.
Studentsaresuppossedtoworkonthesestepsweekwiseandfinallycreateacomplete"Database
System"toRoadwayTravels.Examplesaregivenateveryexperimentforguidancetostudents.
Experiment1:ERModel
Analyzethecarefullyandcomeupwiththeentitiesinit.Identitfywhatdatahastobepersistedinthe
database.Thiscontainstheentities,attributesetc.
Identifytheprimarykeysforalltheentities.Identifytheotherskeyslikecandidatekeys,partialkeys,if
any.
Example:Entities:
1. BUS
2. Ticket
3. Passenger
Relationships:
1. Reservation
2. Cancellation
PRIMARYKEYATTRIBUTES:
1. TicketID(TicketEntity)
2. PassportID(PassengerEntity)
3. Bus_No(BusEntity)
Apartfromtheabovementionedentitiesyoucanidentifymore.Theabovementionedarefew.
Note:ThestudentisrequiredtosubmitadocumentbywritingtheEntitiesandkeystothelabteacher.
Experiment2:ConceptdesignwithERModel
Relatetheentitiesappropriately.Applycardnalitiesforeachrelationship.Identifystrongentitiesand
weakentities(ifany).Indicatethetypeofrelationships(total/partial).Trytoincorporategeneralization,
aggregation,specializationetcwhereverrequired.
Example:ERdiagramforbus
Note:ThestudentisrequiredtosubmitadocumentbydrawingtheERDiagramtothelabteacher.
Experiment3:RelationalModel
Representalltheentities(Strong,Weak)intabularfashion.Representrealtionshipsinatabular
fashion.Therearedifferentwaysofrepresentingrelationshipsastablesbasedontherequirement.
Differenttypesofattributes(Composite,Multivalued,andDerived)havedifferentwayof
representation.
Example:Thepassengertableslookasbelow.Thisisanexample.Youcanaddmoreattributesbased
onERmodel.Thisisnotanormalizedtable.
Passenger
Name
Age
Sex
Address
Ticket_id
PassportID
Note:ThestudentisrequiredtosubmitadocumentbyRepresentrelationshipsinatabularfashionto
thelabteacher.
Experiment4:Normalization
Databasenormalizationisatechniquefordesigningrealtionaldatabasetablestominimizeduplication
ofinformationand,insodoing,tosafegaurdthedatabaseagainstcertaintypesoflogicalorstructural
problems,namelydataanormalies.Forexample,whenmultipleinstancesofagivenpieceof
informationoccurinatable,thepossibilityexiststhattheseinstanceswillnotbekeptconsistentwhen
thedatawithinthatableisupdated,leadingtoaloassofdataintegrity.Atablethatissufficiently
normalizedislessvulnerabletoproblemsofthiskind,becauseitsstructurereflectsthebasic
assumptionsforwhenmultipleinstancesofthesameinformationshouldberepresentedbyasingle
instanceonly.
FortheabovetableintheFirstnormalizationwecanremovethemultiplevaluedattributeTicket_idand
placeitinanothertablealongwiththeprimarykeyofpassenger.
FirstNormalForm:Theabovetablecandividedintotwotablesasshownbelow.
Passenger
Name
Age
Sex
Address
PassportID
PassportID
Ticket_id
Youcandothesecondandthirdnormalformsifrequired.AnyhowNormalizedtablesaregivenatthe
end.
Experiment5:InstallationofMySQLandpracticeDDLcommands
InstallationofMySQL.InthisweekyouwilllearnCreatingdatabases,Howtocreatetables,altering
thedatabase,dropingtablesanddatabasesifnotrequired.Youwillalsotrytruncate,rename
commandsetc.
Exampleforcreationofanormalized"Passenger"table.
CREATE
TABLE
Passenger(
Passport_id
INTEGER
PRIMARY
KEY
,
Name
VARCHAR
(50)
NOT
NULL
,
Age
INTEGER
NOT
NULL
,
Sex
CHAR
,
Address
VARCHAR
(50)
NOT
NULL
)
Similarlycreateallothertables.
Note:Detailedcreationoftablesisgivenattheend.
Experiment6:PracticingDMLcommands
DMLcommandsareusedformanagingdatawithinschemaobjects.Someexamples:
SELECTretrievedatafromthedatabase
INSERTinsertdataintoatable
UPDATEupdatesexisitngdatawithinatable
DELETEdeletesallrecordsfromatable,thespacefortherecordsremain
insertvaluesinto"Bus"table:
insert
into
Bus
values
(1234,
'hyderabad'
,
'tirupathi'
)
insert
into
Bus
values
(2345,
'hyderabad'
,
'banglore'
)
insert
into
Bus
values
(23,
'hyderabad'
,
'kolkata'
)
insert
into
Bus
values
(45,
'tirupathi'
,
'bangalore'
)
insert
into
Bus
values
(34,
'hyderabad'
,
'chennai'
)
insertvaluesinto"Passenger"table:
insert
into
Passenger
values
(1,45,
'ramesh'
,45,
'M'
,
'abc123'
)
insert
into
Passenger
values
(2,78,
'geetha'
,36,
'F'
,
'abc124'
)
insert
into
Passenger
values
(45,90,
'ram'
,30,
'M'
,
'abc12'
)
insert
into
Passenger
values
(67,89,
'ravi'
,50,
'M'
,
'abc14'
)
insert
into
Passenger
values
(56,22,
'seetha'
,32,
'F'
,
'abc55'
)
FewmoreExamplesofDMLcommands:
SELECT
*
FROM
Bus(selects
all
theattributes
and
displays)
UPDATE
Bus
SET
Bus_No=1
WHERE
Bus_No=2
Experiment7:Querying
Inthisweekyouaregoingtopracticequeries(alongwithsubqueries)usingANY,ALL,IN,EXISTS,
NOTEXIST,UNION,INTERSECT,Constraintsetc.
PracticethefollowingQueries:
1. DispalyuniquePNR_Noofallpassengers.
2. Displayallthenamesofmalepassengers.
3. Displaytheticketnumbersandnamesofallthepassengers.
4. Findtheticketnumbersofthepassengerswhosenamestartwith'r'andendswith'h'.
5. Findthenamesofpassengerswhoseageisbetween30and45.
6. Displayallthepassengersnamesbeginningwith'A'
7. Displaythesortedlistofpassengersnames.
Experiment8andExperiment9:Querying(continued...)
YouaregoingtopracticequeriesusingAggregatefunctions(COUNT,SUM,AVG,MAX,andMIN),
GROUPBY,HAVINGandCreationanddropingofVIEWS.
1. WriteaQuerytodisplaytheinformationpresentinthePassengerandcancellationtables.Hint:
UseUNIONOperator.
2. Displaythenumberofdaysinaweekonwhichthe9W01busisavailable.
3. FindnumberofticketsbookedforeachPNR_NousingGROUPBYCLAUSE.Hint:Use
GROUPBYonPNR_No.
4. FindthedistinctPNRnumbersthatarepresent.
5. Findthenumberofticketsbookedbyapassengerwherethenumberofseatsisgreaterthan1.
Hint:UseGROUPBY,WHEREandHAVINGCLAUSES.
6. Findthetotalnumberofcancelledsetas.
Experiment10:Triggers
InthisweekyouaregoingtoworkonTriggers.Creationofinserttrigger,deletetrigger,updatetrigger.
Practicetriggersusingtheabovedatabase.
E.g:
CREATE
TRIGGER
updatecheck
BEFORE
UPDATE
ON
passenger
FOR
EACH
ROW
BEGIN
IF
NEW
.TickentNO>60
THEN
SET
New
.TickentNO=TicketNo
ELSE
SET
New
.TicketNo=0
END
IF
END
Experiment11Procedures
InthissessionyouaregoingtolearnCreationofstoredprocedure,Executionofprocedureand
modificationofprocedure.Practiceproceduresusingthedatabase.
E.g:
CREATE
PROCEDURE
myproc()
BEGIN
SELECT
COUNT
(Tickets)
FROM
Ticket
WHERE
age>=40
END
Experiment12:Cursors
Inthisweekyouneedtodothefollowing:Declareacursorthatdefinesaresultset.
Openthecursortoestablishtheresultset.Fetchthedataintolocalvariablesasneededfromthe
cursor,onerowatatime.Closethecursorwhendone
CREATE
PROCEDURE
myproc(in_customer_id
INT
)
BEGIN
DECLARE
v_id
INT
DECLARE
v_name
VARCHAR
(30)
DECLARE
c1
CURSOR
FOR
SELECT
stdid,stdFirstname
FROM
students
WHERE
stdidin_customer_id
OPEN
c1
FETCH
c1
INTO
v_id,v_name
CLOSE
c1
END
Tables:
BUS
BusNo:VARCAHR:PK(primarykey)
Source:VARCHAR
Destination:VARCHAR
Passenger
PPNO:VARCHAR(15):PK
Name:VARCHAR(15)
Age:INT(4)
Sex:CHAR(10):Male/Female
Address:VARCHAR(20)
Passenger_Tickets
PPNO:VARCHAR(15):PK
Ticket_No:NUMERIC(9)
Reservation
PNR_No:NUMERIC(9):FK
Journey_date:DATETIME(8)
No_of_seats:INT(8)
Address:VARCHRA(50)
Contact_No:NUMERIC(9)>Shouldnotlessthan9andShouldnotacceptanyothercharacterother
thaninterger
STATUS:CHAR(2):Yes/No
Cancellation
PNR_No:NUMERIC(9):FK
Journey_date:DATETIME(8)
No_of_seats:INT(8)
Address:VARCHRA(50)
Contact_No:NUMERIC(9)>Shouldnotlessthan9andShouldnotacceptanyothercharacterother
thaninterger
STATUS:CHAR(2):Yes/No
Ticket
Ticket_No:NUMERIC(9):FK
Journey_date:DATETIME(8)
Age:INT(4)
Sex:CHAR(10):Male/Female
Source:VARCHAR
Destination:VARCHAR
Dep_time:VARCHAR
RFERENCEBOOKS:
1. IntroductiontoSQL,RickF.vanderLans,Pearsoneducation.
2. OraclePL/SQL,B.RosenzweigandE.Silvestrova,Pearsoneducation.
3. OraclePL/SQLProgramming,StevenFeuerstein,SPD.
4. SQL&PL/SQLforOracle10g,BlackBook,Dr.P.S.Deshpande,DreamTech.
5. OracleDatabase11gPL/SQLProgramming,M.McLaughlin,TMH.
6. SQLFundamentals,J.J.Patrick,PearsonEducation.