Unit1_Introduction to database.pdf
Document Details
Tags
Full Transcript
Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1...
Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1 UNIT No 1 Unit Name : Introduction to Database Topics: IntroductiontoDatabase,DBMS,ApplicationsofDBMS PurposeofDBMS,DataIndependence Types of Database System Architecture (1- tier,2- tier, 3-tier) DatabaseSystemlevels(External,Conceptual,Internal),Mappings Database,UsersandDBA. IntroductiontotypesofDataModels. Hierarchicaldatamodel,NetworkDataModel, RelationalDataModel,E-RDataModel ❖ Introduction to Database Data Facts that can be recorded or stored. E.g. Person Name, Age, Gender and Weight etc. Information When data is processed, organized, structured or presented in a given context so as to make it useful, it is called information. Database A Database is a collection of inter-related (logically-related) data. E.g. Books Database in Library, Student Database in University etc. DBMS (Database Management System) A database management system is a collection of inter-related data and set of programs to manipulate those data. DBMS = Database + Set of programs E.g. MS SQL Server, Oracle, My SQL, SQLite, MongoDB etc. Metadata Metadata is data about data. Data such as table name, column name, data type, authorized user and user access privileges for any table is called metadata for that table. Page | 1 Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1 Data dictionary Data dictionary is an information repository which contains metadata. It is usually a part of the system catalog. Data warehouse Data warehouse is an information repository which stored data. It is design to facilitate reporting and analysis. Field A field is a character or group of characters that have a specific meaning. It is also called a data item. It is represented in the database by a value. For Example customer id, name, society and city are all fields for customer Data. Record A record is a collection of logically related fields. For examples, collection of fields (id, name, address & city) forms a record for customer. Applications of DBMS In so many fields, we will use a database management system. Let’s see some of the applications where database management system uses − RailwayReservationSystem −Therailwayreservationsystemdatabaseplaysavery important role by keeping record of ticket booking, train’s departure time and arrival status and also gives information regarding train late to people through the database. LibraryManagementSystem −Now-a-daysit’sbecomeeasyintheLibrarytotrack each book and maintain it because of the database. This happens because there are thousands of books in the library. It is very difficult to keep a record of all books in a copy or register. Now DBMS used to maintain all the information related to book issue dates, name of the book, author and availability of the book. Banking −Bankingisoneofthemainapplicationsofdatabases.Weallknowtherewill be a thousand transactions through banks daily and we are doing this without going to Page | 2 Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1 the bank. This transactions is all possible just because of DBMS that manages all Universitiesandcolleges −Now-a-daysexaminationsaredoneonline.So,the universities and colleges are maintaining DBMS to store Student’s registrations details, results, courses and grade all the information in the database. For example, telecommunications. Without DBMS there is no telecommunication company. DBMS is most useful to these companies to store the call details and monthly postpaid bills. Creditcardtransactions −Thepurchaseofitemsandtransactionsofcreditcardsare made possible only by DBMS. A credit card holder has to know the importance of their information that all are secured through DBMS. SocialMediaSites −Byfillingtherequireddetailsweareabletoaccesssocialmedia platforms. Many users sign up daily on social websites such as Facebook, Pinterest and Instagram. All the information related to the users are stored and maintained with the help of DBMS. Finance −Now-a-daystherearelotsofthingstodowithfinancelikestoringsales, holding information and finance statement management etc. these all can be done with database systems. Military −InmilitaryareastheDBMSisplayingavitalrole.Militarykeepsrecordsof soldiers and it has so many files that should be kept secure and safe. DBMS provides a high security to military information. OnlineShopping −Now-a-dayswealldoOnlineshoppingwithoutwastingthetime by going shopping with the help of DBMS. The products are added and sold only with the help of DBMS like Purchase information, invoice bills and payment. HumanResourceManagement −themanagementkeepsrecordsofeachemployee’s salary, tax and work through DBMS. Manufacturing −Manufacturingcompaniesmakeproductsandsellthemonadaily basis. To keep records of all those details DBMS is used. AirlineReservationsystem −Justliketherailwayreservationsystem,airlinesalso need DBMS to keep records of flights arrival, departure and delay status. Purpose of DBMS The purpose of database systems is to manage the following insecurities: ▪ dataredundancyandinconsistency, Page | 3 Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1 ▪ difficulty in accessing data, ▪ dataisolation, ▪ atomicity of updates, ▪ concurrent access, ▪ security problems, and ▪ Supports multiple views of data. Data Independence Data independency is the ability to modify a schema definition in one level without affecting a schema definition in the next higher level. Types of data independence Physical data independence Logical data independence Physical data independence Physical data independence allows changing in physical storage devices or organization of file without change in the conceptual view or external view. Modifications at the internal level are occasionally necessary to improve performance. Physical data independence separates conceptual level from the internal level. It is easy to achieve physical data independence. Logical data independence Logical data independence is the ability to modify the conceptual schema without requiring any change in application programs. Conceptual schema can be changed without affecting the existing external schema. Modifications at the logical level are necessary whenever the logical structure of the database is altered. Logical data independence separates external level from the conceptual view. It is difficult to achieve logical data independence. Page | 4 Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1 Types of Data base System Architecture (1- tier, 2- tier, 3-tier) Most widely used architecture is 3-tier architecture. user application client network application server database system 3-tier architecture separates it tier from each other on basis of users. client Page | 5 Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1 server 1) Database (Data) Tier At this tier, only database resides. Database along with its query processing languages sits in layer-3 of 3-tier architecture. It also contains all relations and their constraints. 2) Application(Middle)Tier At this tier, the application server and program, which access database, resides. For a user this application tier works as abstracted view of database. Users are unaware of any existence of database beyond application. For database-tier, application tier is the user of it. Database tier is not aware of any other user beyond application tier. This tier works as mediator between the two. 3) User(Presentation)Tier An end user sits on this tier. From a user’s aspect, this tier is everything. He/she doesn't know about any existence or form of database beyond this layer. At this layer multiple views of database can be provided by the application. All views which are generated by an application, resides in application tier. Database System levels (External, Conceptual, Internal) Mapping The process of transforming requests and results between the three levels is called mapping. Types of Mapping Conceptual/Internal Mapping External/Conceptual Mapping Page | 6 Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1 Conceptual/Internal Mapping It relates conceptual schema with internal schema. It defines correspondence between the conceptual schema and the database stored in physical devices. It specifies how conceptual records and fields are presented at the internal level. If the structure of stored database is changed, then conceptual/internal mapping must be changed accordingly and conceptual schema can remain invariant. There could be one mapping between conceptual and internal levels. External/Conceptual Mapping It relates each external schema with conceptual schema. It defines correspondence between a particular external view and conceptual schema. If the structure of conceptual schema is changed, then external/conceptual mapping must be changed accordingly and external schema can remain invariant. There could be several mappings between external and conceptual levels. Database Users and DBA There are four different database users. Application programmers These users are computer professionals who write application programs using some tools. E.g. Software developers Sophisticated users These users interact with system without writing program. They form their request in a database query language. E.g. Analyst. Specialized users These users write specialized database applications that do not fit into the traditional data processing framework. E.g. Database Administrator. Naive users These users are unsophisticated users who have very less knowledge of database system. These users interact with the system by using one of the application programs that Page | 7 Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1 have been written previously. Examples, e.g. Clerk in bank DBA The database administrator is a person in the organization who controls the design and the Use of the database. DBA provides necessary technical support for implementing a database. DBA is involved more in the design, development, testing and operational phases. DBA is a technical person having knowledge of database technology. DBA does not need to be a business person, but any kind of knowledge about a functionality of an organization can be more beneficiary. DBA is a technically focused person, but, he/she should understand more about the ❖ business to administer the databases effectively. Introduction to types of Data Models A database model is a type of data model that defines the logical structure of a database. It determines how data can be stored, accessed and updated in a database management system The most popular example of a database model is the relational model, which uses a table-based format. Type of Database Models are: 1. HierarchicalModel 2. NetworkModel 3. Entity-relationshipModel 4. RelationalModel 5. Object-orienteddatabasemodel 1) Hierarchical Model The hierarchical model organizes data into a tree-like structure, where each record has a single parent or root. The hierarchy starts from the Root data, and expands like a tree, adding child nodes to the parent nodes. In hierarchical model, data is organized into tree-like structure with one-to-many relationship between two different types of data, for example, one department can have many professors and many students. Page | 8 Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1 2) Network Model This is an extension of the hierarchical model, allowing many-to-many relationships in a tree-like structure that allows multiple parents. 3) Entity-relationship Model In this database model, relationships are created by dividing object of interest into entity and its characteristics into attributes. Page | 9 Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1 4) Relational Model In this model, data is organized in two-dimensional tables and the relationship is maintained by storing a common attribute. SubjectID SubjectName Teacher 12 DBMS Patel Rno DS Shah 12 StudentName Age Raj 2 Meet 1 2 2 Rno SubjectID Marks Page | 10 Course Code: 4040233101 Course Name: Database Management System SEMESTER: 1 1 1 9 1 2 8 2 1 9 2 2 5 9 5 9 0 5) Object-oriented database model This data model is another method of representing real world objects. It considers each object in the world as objects and isolates it from each other. It groups its related functionalities together and allows inheriting its functionality to other related sub-groups. Page | 11