Full Transcript

Databases Lecture 1 Dr. Mohammed M Abozahhd Electrical Engineering Department 1 2 What is database ? Data: is a collection of facts and figures that can be processed to produce information...

Databases Lecture 1 Dr. Mohammed M Abozahhd Electrical Engineering Department 1 2 What is database ? Data: is a collection of facts and figures that can be processed to produce information. Database (DB): is an organized collection of structured information, or data, typically stored electronically in a computer system. A database is usually controlled by a database management system (DBMS). Together, the data and the DBMS, along with the applications that are associated with them, are referred to as a database system, often shortened to just database. Database Management System (DBMS): stores data in such a way that it becomes easier to retrieve, manipulate, and produce information. 3 DBMS Characteristics A modern DBMS has the following characteristics Real-world entity: A modern DBMS is more realistic and uses real-world entities to design its architecture. It uses the behavior and attributes too. For example, a school database may use students as an entity and their age as an attribute. Relation-based tables: DBMS allows entities and relations among them to form tables. A user can understand the architecture of a database just by looking at the table names. 4 DBMS Characteristics Isolation of data and application: A database system is entirely different than its data. A database is an active entity, whereas data is said to be passive, on which the database works and organizes. DBMS also stores metadata, which is data about data, to ease its own process. Less redundancy: DBMS follows the rules of normalization, which splits a relation when any of its attributes is having redundancy in values. Normalization is a mathematically rich and scientific process that reduces data redundancy. 5 DBMS Characteristics Consistency: Consistency is a state where every relation in a database remains consistent. There exist methods and techniques, which can detect attempt of leaving database in inconsistent state. A DBMS can provide greater consistency as compared to earlier forms of data storing applications like file-processing systems. Query Language − DBMS is equipped with query language, which makes it more efficient to retrieve and manipulate data. A user can apply as many and as different filtering options as required to retrieve a set of data. Traditionally it was not possible where file-processing system was used. 6 DBMS Characteristics ACID Properties: DBMS follows the concepts of Atomicity, Consistency, Isolation, and Durability (normally shortened as ACID). These concepts are applied on transactions, which manipulate data in a database. ACID properties help the database stay healthy in multi-transactional environments and in case of failure. 7 DBMS Characteristics Multiuser and Concurrent Access: DBMS supports multi-user environment and allows them to access and manipulate data in parallel. Though there are restrictions on transactions when users attempt to handle the same data item, but users are always unaware of them. Multiple views: DBMS offers multiple views for different users. A user who is in the Sales department will have a different view of database than a person working in the Production department. This feature enables the users to have a concentrate view of the database according to their requirements. 8 DBMS Characteristics Security: Features like multiple views offer security to some extent where users are unable to access data of other users and departments. DBMS offers methods to impose constraints while entering data into the database and retrieving the same at a later stage. DBMS offers many different levels of security features, which enables multiple users to have different views with different features. Example: a user in the Sales department cannot see the data that belongs to the Purchase department. Additionally, it can also be managed how much data of the Sales department should be displayed to the user. Since a DBMS is not saved on the disk as traditional file systems, it is very hard for miscreants to break the code. 9 DBMS Users A typical DBMS has users with different rights and permissions who use it for different purposes. Some users retrieve data and some back it up. The users of a DBMS can be broadly categorized as follows: 10 Entity-Relationship Model Entity-Relationship (ER) Model: is based on the notion of real-world entities and relationships among them. While formulating real-world scenario into the database model, the ER Model creates entity set, relationship set, general attributes and constraints. ER Model is based on: 1. Entities (Tables) and their attributes. 2. Relationships among entities. 11 Entity-Relationship Model - Entity: An entity in an ER Model is a real-world entity having properties called attributes. Every attribute is defined by its set of values called domain. For example, in a school database, a student is considered as an entity. Student has various attributes like name, age, class, etc. - Relationship: The logical association among entities is called relationship. Relationships are mapped with entities in various ways. Mapping cardinalities define the number of association between two entities. - Types of Relationships: 1. one to one 2. one to many 3. many to one 4. many to many 12 Entity-Relationship Model Each column in a relation contains values from a same domain. 13 Entity-Relationship Model Relationship: Relationships are represented by diamond- shaped box. Name of the relationship is written inside the diamond-box. All the entities (rectangles) participating in a relationship, are connected to it by a line. 14 Entity-Relationship Model 15 Entity-Relationship Model 16 Entity-Relationship Model 17 Participation Constraints 18 Database Schema Database schema: defines its entities and the relationship among them. - It contains a descriptive detail of the database, which can be depicted by means of schema diagrams. - It’s the database designers who design the schema to help programmers understand the database and make it useful. Physical Database Schema: This schema pertains to the actual storage of data and its form of storage like files, indices, etc. It defines how the data will be stored in a secondary storage. Logical Database Schema: This schema defines all the logical constraints that need to be applied on the data stored. It defines tables, views, and integrity constraints. 19 MS Access vs MS SQL Server 1. Business Size: MS Access is mostly used in-home or small business applications, as it can only handle small numbers of users and data requests. In contrast, SQL Server is designed for enterprise applications and handles several hundred or even thousands of users at any time. 2. Interface MS Access has a friendly graphical user interface, making it an ideal choice for people unfamiliar with complex database interaction. It has drag-and-drop capabilities and a variety of templates to help users create and manipulate data. Access also includes wizards that walk users through the process of doing something new. In contrast, MS SQL Server has a more technical graphical user interface requiring specialized training and knowledge. 20 MS Access vs MS SQL Server 3. Queries Complexity: SQL Server supports more complex queries and number of objects than what is available in MS Access. 4. Concurrent Sessions: MS Access supports just few users to work simultaneously while MS SQL Server supports millions of transactions to be executed in the same time. 5. Integrations: MS SQL Server is more robust. 6. Security: MS Access is a less secure database system when compared to MS SQL Server. 7. Price: MS Access is part of Microsoft Office and a single license costs about $200. MS SQL Server is more expensive, with a single license costing anywhere from $899 to $13,748. 21 What is Structured Query Language (SQL)? SQL: is a programming language used by nearly all relational databases to query, manipulate, and define data, and to provide access control. - SQL was first developed at IBM in the 1970s with Oracle as a major contributor, which led to implementation of the SQL ANSI standard, - SQL has spurred many extensions from companies such as IBM, Oracle, and Microsoft. Microsoft’s implementation is Transact-SQL (T-SQL) 22 Most popular database management systems

Use Quizgecko on...
Browser
Browser