




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to database concepts and Oracle9i. It covers topics such as entity, data, attributes, entity set, relationship, and different types of relationships. It also discusses the functions of RDBMS and the components of a database system. information on data modeling, normalization, and working with tables in Oracle9i. It also covers SQL, SQL*Plus environment, and built-in functions. a useful resource for students studying database management systems and Oracle9i.
Typology: Study notes
1 / 186
This page cannot be seen from the preview
Don't miss anything!





























































































A database is an organized collection of data. The data are typically organized to modelrelevantaspectsofrealityinawaythatsupportsprocessesrequiringthisinformation.Itisanelectronicsto rageof data. It storesinformation andrelationshipamongdifferentthings. Basictermstoexaminethestructureof aDatabase Thetermsareentity,data,attributes,entitysetandrelationship. Entity: Aperson,place,eventoritemiscalledanentity.Example:Customer,Transaction,Employee,Library, etc., Data: The facts describing an entity are known as data. Example: For a Customer, custno, custname,address…,etc.,aremaintainedinaregister whichdescribesthecharacteristicsoftheentityCustomer. Attributes: Eachentitycanbedescribedbyitscharacteristics,whichareknownasattributes.Example: Fora Student, name, regno, class,address etc…. Entity Set: All the related entities are collected together to form an entity set. An entity set is given asingular noun. Example: The student entity set contains data about student only. All related entity inthe STUDENT entity set is student. Similarly a company keeps track all of its employees is an entitysetcalledEMPLOYEES.TheEMPLOYEEentitysetdoesnotcontainaboutthecompany’scustomers,b ecauseitwould notmake anysense. Database: A database is a collection of entity sets. Example: A college database may include entitiessuchasstudent,faculty,course,term,office,building,exametc.,theentitiesinadatabasearelikelytoint eractwith otherentities. Relationship: The interactions between the entity sets are called relationship. Example: A facultymember teachesina building,sotherelationshipbetween FACULTYandBUILDINGisteaches.
Theinteractions betweenthe entitysetsarecalledrelationship. Example: A faculty member teaches in a building, so the relationship between FACULTY andBUILDINGisteaches.
▪ Software- OperatingSystemandaNetworkoperatingsystem. ▪ Userdevelopedandimplementeddtaabase(s)– Tables,DataDictionary,Recordsandotherdatabaseobjcts. ▪ CustomApplication suchasdataentryform,reports,queries,blocksandprograms. ▪ Personnel – ADatabase Administrator(DBA),DatabaseDesigner, Analyst,ProgrammerandEnd User. The database system is utilized as a decision-making system and is also refered to as aninformation system. A DBMS based on a relational model is also known as a Relational DataBaseManagement System(RDBMS).
Dataaretherawmaterials.Informationisprocessedmanipulated,collectedororganizeddata.AnRDBMS notonlymanagesdatabutisalsoresponsibleforother importantfunctions. ▪ Itmanagesthedataandrelationsstoredinthedatabase. ▪ It creates a data dictionary which is a system structure that stores metadata. A metadata is dataaboutdata.It icludestablenames,attributes,datatypes,physical space,relatinshipandsoon. ▪ Itmanagesallday-to-daytransactions. ▪ It allowsuserstospecifyvalidationruleswhich avoidincorrect datavalues. ▪ It performsbookkeepingduties. ▪ Ittransformslogical datarequesttomatchphysicaldatastructure. ▪ ItSecuresaccessthroughPassword,Encryptionandrestircteduserrights. ▪ Itprovidesbackupandrecoveryprocedurefor physicalsecurityof data. ▪ It allowsusertosave datawith datalockingcapabilities ▪ Itprovidesimportandexportutilitiestousedatacreatedindatabasetootherdatabaseorspreadsheetsof tware ortouse datain othersoftwares. ▪ Itreducesdataredundancy
Because of its simplicity in design and ease in retrieval of data, the relational database modelhas been very popular, especially in the personal computer environment. E.F code developed therelationaldatabasemodel in1970. Themodelisbasedonmathematicalsettheory and itusesarelationas the buildingblockofthe database.
Table: Atableisamatrixofrowsandcolumnsinwhicheachrowrepresentanentityandeachcolumnrepresenta n attribute. Tuple: Inrelational terminologyarowisreferedasatuple. Degree: Thenumberofcolumnsinatableiscalledthedegree.Example:Atablehasfourcolumnsthenthe degree ofthe tableis 4. Domain: Thesetofallpossiblevaluesthatacolumnmayhaveiscalledthedomainofthatcolumn.Twodomainsar e same onlyiftheyhave the same meaninganduse.
Relationalterminology Filesystem terminology Entity set (or) Table (or)Relation File Entity(or)Row(or)Tuple Record Attribute(or) Column Field A key isaminimalsetofcolumnsusedtouniquelydefineanyrowinatable.A uniquekey or primarykey is a keythatuniquelydefinesthecharacteristics ofeach row. PrimaryKey Whenasinglecolumnis usedasauniqueidentifier,itisknown asprimarykey.
The union of two tables result in retrieval of all the rows that are inboth tables. The duplicaterowsare eliminatedfromthe resultingtable. Basicrequirementtoperformunionoperations ontwotables: (i) Bothtablesmust havethesamedegree. (ii) The domains of the corresponding columns in two tables must be same.Suchtablesaresaid to beunioncompatible. ConsideranexampleoftwotablesnamedWIPROandTCSwhichcontainsthenamesofthestudentspl acedinthose companies. TABLE_A=WIPRO TCS TABLE_A REGNO NAME COURSE 72 GOPI CS 82 JEEVA CS 62 PRIYA CS 73 KAVIN CS 62 PRIYA CS 72 GOPI CS
2. Intersection The insertionoftwotables producesatablewith rows thatare inbothtables. Thetwotablesmusthavebe union compatible to performanintersection on them. TABLE_B =WIPRO ∩ TCS TABLE_B REGNO NAME COURSE 82 JEEVA CS 62 PRIYA CS 3. Difference Thedifferenceoftwotablesproceduresatablewithrowsthatarepresentinthefirsttablebutnotinthe secondtable.Thedifferencecan beperformed onunion-compatible tablesonly. TABLE_C=WIPRO- TCS TABLE_C REGNO NAME COURSE 82 JEEVA CS 4. Projection Theprojectionoperationallowscreatingtablebasedondescribablecolumnsfrom allexistingcolumnsina table.The projection operationreturnsthe “verticalslices”ofa table. ▪ Theprojectionisindicatedbyincludingthetablename andalist of described columns PARTS PARTNO PARTDESC VENDOR COST 11 NUT RICHARDS 20. 22 BOLT BLACK 5. 33 WASHER ALBERT 55.
▪ Thisoperationcreatesanewtablefromexistingtables. ▪ Assignment(=)givesanabilitytonamenewtablesthatarebasedonothertablesassignmentisnotanora cle term. TABLE_D=TCS- WIPRO TABLE_D REGNO NAME COURSE 73 KAVIN CS
8. Join ▪ The join is one of the most important operations because of it’s ability to get related data froma numberoftables. ▪ Thejoin isbased oncommonsetof values, whichdoesnot havethesamenameinboth tablesbut does haveto have the same domain in bothtables. ▪ Whenajoin basedon qualityofvaluesitis known as anaturaljoin.
TABLE_H =join(EMP,DEPT: DNO=DNO) TABLE_H ENO ENAME DNO DNAME 100 CARTER 10 PRODUCTION 200 ALBERT 20 SUPPLIES 300 BEENS 30 MARKETING
9. Division ▪ Thedivisionoperationsarethemost difficult operationtocomprehend. ▪ Itisnot assimpleasdivisioninmathematics. ▪ Inrelationalalgebra,itidentifiersrowsinonetablethathaveacertain relationshiptoallrowsinanothertable. PROJ PROJPARTS TABLE_I = PROJPARTS / PROJTABLE_I PNO 1 3 2
Relationalcalculusisnonprocedural.Ithasthesameexpressivepowerasrelationalalgebra, i.e. it isrelationally complete.Itisa formallanguagebasedupona branchof mathematical logiccalled"predicatecalculus".Therearetwoapproaches:TuplerelationalcalculusandDomainrelationalca lculus.Theyarepartoftherelationalmodelfordatabasesandprovideadeclarativewaytospecifydatabase queries.
In this example, we're only looking for the name, and that's B. F = C is a requirement, becauseweneedtofindEnterprisecrewmembersANDtheyare intheStellarCartographyDepartment. Someabbreviationsforlogic
The Relational model uses relation (table) to represent both entities and relationships amongentities. A relation may be visualized as a table. However table is just one of the way, among many, torepresent arelation.
Flat Model: This may not strictly qualify as a data model. The flat (or table) model consists of asingle, two-dimensional array of data elements, where all members of a given column are assumed tobesimilarvalues,and allmembersofaroware assumed toberelatedtoone another. Fig:Flat Model Hierarchical Model: In this model data is organized into a tree-like structure, implying a singleupward link in each record to describe the nesting, and a sort field to keep the records in a particularorder ineach same-levellist.
Fig:Object-RelationalModel Relational Model: This is a database model based on first-order predicate logic. Its core idea is todescribe a database as a collection of predicates over a finite set of predicate variables, describingconstraintsonthepossiblevalues and combinations ofvalues. Fig:RelationalModel
Entity–RelationshipModel A model is a simplified version of real-life, complex objects. An Entity is a distinct in theorganization that is to be represents in the database. The entity relationship (E-R) model is a verypopular modelingtoolamong manysuch tools availabletoday. TheE-Rmodelprovides1.Anexcellentcommunicationtool2.Asimplegraphicalrepresentation of data. The E-R model uses E-R diagrams (ERD) for graphial representation of thedatabasecomponents. Entity: ▪ Anentityrepresentedbyarectangle.Thenameoftheentitywrittenwithintherectangleandblockletter s.