aws Flashcards
DataBase
It’s an organized collection of structured data that can be stored, accessed and modified electronically
DBMS
The software which is used to manage database is called Database Management System (DBMS). * It is the software that interacts with end users, applications, and the database itself to capture and analyze the data. * DBMS provides an interface to perform various operations like database creation, storing data in it, updating data, creating a table in the database etc. * MySQL, Oracle etc. are popular commercial DBMS used in different applications.
CHARACTERISTICS OF DBMS
Stores any kind of data
Concurrent use of the database
Supports ACID properties
Back up and recovery
Data integrity
Multiple Views
Security
Represents Complex Relationship Between Data
Query Language
Cost
DATABASE USERS
Database users are those people whose jobs require access to the database. They are categorized
based up on their interaction with the database.
Casual Users / Temporary Users :Casual Users are the users who occasionally use/access the database, but each time when they access the data base they require new information
Naive / Parametric End Users: Parametric End Users are unsophisticated who don’t have any DBMS knowledge but they frequently use the data base applications in their daily life to get the desired results.
Sophisticated Users : Sophisticated users can be engineers, scientists, business analyst, who are familiar with the database
Database Administrator (DBA): * Database Administrator is a person/team who defines the schema and also controls the 3 levels of database.
* DBA will then create a new account id and password for the user if he/she need to access the data base.
* DBA is also responsible for providing security to the data base and he allows only the authorized users to access/modify the data base.
Data Base Designers: Data Base Designers are the users who design the structure of data base which includes
tables, indexes, views, constraints, triggers, stored procedures.
.Application Program :Application Program are the back end programmers who writes the code for the application
programs.
System Analyst :* System Analyst is a user who analyzes the requirements of parametric end users.
* They check whether all the requirements of end users are satisfied.
ADVANTAGES OF DBMS
Better Data Transferring:
Database management creates a place where users have an advantage of more and better managed
data. Thus making it possible for end-users to have a quick look and to respond fast to any changes
made in their environment
2.Better Data Security
As number of users increases data transferring or data sharing rate also increases thus increasing the risk of data security. DBMS provide a better platform for data privacy and security policies thus, improves Data Security.
- Better data integration:
Due to DBMS, we have an access to well managed and synchronized form of data, thus it makes data handling very easy and gives integrated view of how a particular organization is working and also helps to keep a track on how one segment of the company affects other segment - Minimized Data Inconsistency:
Data inconsistency occurs between files when different versions of the same data appear
in different places.
So if a database is properly designed, then Data inconsistency can be greatly reduced
hence minimizing data inconsistency. - Faster data Access:
DBMS helps to produce quick answers to database queries thus making data accessing faster and
more accurate. - Better decision making:
Due to DBMS now we have Better managed data and Improved data accessing because of which we can generate better quality information. Hence, on this basis, better decisions can be made. Better Data quality improves accuracy, validity and time it takes to read data.\ - Increased end-user productivity:
The data which is available with the help of combination of tools which transform data into useful information, helps end user to make quick, informative and better decisions that can make difference between success and failure in the global economy. - Simple:
DBMS gives simple and clear logical view of data. Many operations like insertion, deletion or creation of file or data are easy to implement
DATA MODELS
Data models in Database Management Systems (DBMS) are conceptual tools that help summarize the description of the database. They provide a transparent picture of the data, making it easier to create an actual database. Data models show how the data is designed and implemented, from the conceptual level to the physical level.
There are 3 types of data models
Conceptual Data Model:
The conceptual data model describes the database at a very high level and is useful to understand the needs or requirements of the database. It is this model, that is used in the requirement-gathering process eg: ER model
Logical Data Model
This type of data model is used to represent only the logical part of the database and does not represent the physical structure of the database. The representational data model allows us to focus primarily, on the design part of the database.
Physical Data Model
The physical Data Model is used to practically implement Relational Data Model. Ultimately, all data in a database is stored physically on a secondary storage device such as discs and tapes. This is stored in the form of files, records, and certain other data structures. It has all the information on the format in which the files are present and the structure of the databases,
DATABASE SCHEMA
DB Schema is the overall description of the DB.It is the skeleton structure that represents the logical view of the entire database. It defines how the data is organized and how the relations among them are associated. It formulates all the constraints that are to be applied on the data
It contains a descriptive detail of the database, which can be depicted by means of schema diagrams.
- Physical Database Schema − It describes the database designed at physical level.This schema focusses on 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 − It describes the database designed at logical level. This schema defines all the logical constraints that need to be applied on the data stored. It defines tables, views, and integrity constraints.
- View schema – Defines the design of database at view level
DATABASE INSTANCE
The content of database at a point of time is called instance.The instances can be changed by certain
operations as like addition, deletion ,updation of data. It may be noted that any search query will not
make any kind of changes in the instances.
DATABASE LANGUAGE
- A DBMS has appropriate languages and interfaces to express database queries and updates.
- Database languages can be used to read, store and update the data in the database.
a). DDL (Data Definition Language) : Deals with schemas and descriptions, of how the data
should reside in the database.
b).DML (Data Manipulation Language): Deals with data manipulation and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE, etc. It is used to store, modify, retrieve, delete and update data in a database
c).DCL (Data control Language) : used to control access to data stored in a database
* GRANT: It is used to give user access privileges to a database.
* REVOKE: It is used to take back permissions from the user.
d).TCL (Transaction Control Language) :TCL is used to run the changes made by the DML statement.
* COMMIT: It is used to save the transaction on the database.
* ROLLBACK: It is used to restore the database to original since the last Commit.
DATABASE STATES :
ONLINE OFFLINE RESTORING RECOVERING RECOVERY PENDING SUSPECT EMERGENCY
THREE SCHEMA ARCHITECTURE
The three schema architecture is also called ANSI/SPARC architecture or three-level architecture.
* This framework is used to describe the structure of a specific database system.
* The three schema architecture is also used to separate the user applications and physical database.
* The three schema architecture contains three-levels. It breaks the database system down into three different categories.
Internal Schema
Conceptual Schema
External Schema
- Mapping is used to transform the request and response between various database levels of
architecture.
- Internal Level
* The internal level has an internal schema which describes the physical storage structure of the database.
* The internal schema is also known as a physical schema.
* It uses the physical data model. It is used to define that how the data will be stored in a block. - Conceptual Level
The conceptual schema describes the design of a database at the conceptual level. Conceptual level
is also known as logical level.
* The conceptual schema describes the structure of the whole database.
* The conceptual level describes what data are to be stored in the database and also describes
what relationship exists among those data - External Level
At the external level, a database contains several schemas that sometimes called as subschema. The
subschema is used to describe the different view of the database.
* An external schema is also known as view schema.
* Each view schema describes the database part that a particular user group is interested and
hides the remaining database from that user group.
Objectives of Three schema Architecture :
The main objective of three level architecture is to enable multiple users to access the same data
with a personalized view while storing the underlying data only once
Thus it separates the user’s view from the physical structure of the database.
This separation is desirable for the following
reasons:
- Different users need different views of the same data.
- The approach in which a particular user needs to see the data may change over time
- All users should be able to access the same data according to their requirements.
Mapping between Views(Three tier schema)
There must be mapping between the three levels . DBMS is responsible for the mapping.
There are basically two types of mapping in the database architecture:
1). Conceptual/ Internal Mapping :
The Conceptual/ Internal Mapping lies between the conceptual level and the internal level. Its role
is to define the correspondence between the records and fields of the conceptual level and files and
data structures of the internal level.
2). External/ Conceptual Mapping :
The external/Conceptual Mapping lies between the external level and the Conceptual level. Its role
is to define the correspondence between a particular external and the conceptual view.
Data Independence(3 tier schema)
1). Physical data independence :
It is the capacity to change the internal schema without having to change the conceptual schema. Hence, the external schemas need not be changed as well. Changes to the internal schema may be needed because some physical files were reorganized
2).Logical data independence :
It is the capacity to change the conceptual schema without having to change external schemas or application programs. We may change the conceptual schema to expand the database by adding a record type or data item), to change constraints, or to reduce the database .
DATABASE INTERFACES
Menu-Based Interfaces for Web Clients or Browsing – Forms-Based Interfaces –. Graphical User Interface –Natural language Interfaces –Speech Input and Output –
Interfaces for DBA –
ER MODEL(ENTITY RELATIONSHIP MODEL)
- It is a high-level data model that is used to define the data elements and relationship for a specified system.
- It develops a conceptual design for the database. It also develops a very simple and easy to design view of data.
- In ER modeling, the database structure is portrayed as a diagram called an entity relationship diagram.
- Entity:An entity may be any object, class, person or place. In the ER diagram, an entity can be represented
as rectangles - Attribute: The attribute is used to describe the property of an entity. Eclipse is used to represent an attribute.
a. Key Attribute
The key attribute is used to represent the main characteristics of an entity. It represents a primary
key. The key attribute is represented by an ellipse with the text underlined.
b. Composite Attribute
An attribute that composed of many other attributes is known as a composite attribute. The
composite attribute is represented by an ellipse, and those ellipses are connected with an ellipse
c. Multivalued Attribute
An attribute can have more than one value. These attributes are known as a multivalued attribute.
The double oval is used to represent multivalued attribute.
d. Derived Attribute
An attribute that can be derived from other attribute is known as a derived attribute. It can be
represented by a dashed ellipse.
Weak entity
An entity that depends on another entity called a weak entity. The weak entity doesn’t
contain any key attribute of its own. The weak entity is represented by a double rectangle
Relationship
A relationship is used to describe the relation between entities. Diamond or rhombus is used to
represent the relationship.
CARDINALITY : It is expressed as the number of entities to which another entity can be
associated via a relationship set.
a. One-to-One Relationship
b. One-to-many relationship
c). Many-to-one relationship
d). Many-to-many relationship
DEGREE OF A RELATIONSHIP
The number of entity types which take part in the entity relationship is called the degree of relationships.
1).Unary relationship
It is the relationship between the instances of a single entity type. It is also called a recursive relationship.
2).Binary relationship It is the relationship between the instances of two different entity types.
3).Ternary relationship : A simultaneous relationship between the instances of three entity types with unique attributes
4).N-ary relationship
PARTICIPATION CONSTRAINTS
Participation of an entity can be either total or partial.
a).Total Participation − Each entity is involved in the relationship. Total participation is
represented by double lines.
b). Partial participation − Not all entities are involved in the relationship. Partial participation is
represented by single lines..
TYPES OF KEYS
- Primary Key :
2.Candidate key :The candidate keys refer to those attributes that identify rows uniquely in a table. In a table, we select the primary key from a candidate key.
- Alternate Key: keys that did not mkae it to be primary keys
- Super Key
A super key refers to the set of all those keys that help us uniquely identify all the rows present in a
table - Foreign Key
We use a foreign key to establish relationships between two available tables. Foreign keys are the
column of a table used to point to the primary key of another table
NAMING CONVENTIONS
- Use an easily understandable and readable name.
- Pick comprehension over length.short names are not always better.
- Choose singular names for entity types, rather than plural ones, because the entity type name
applies to each individual entity belonging to that entity type. - Entity type and relationship type names are uppercase letters.
- Attribute names have their initial letter capitalized.
Relational Model(table)
Relational Model represents how data is stored in Relational Databases. A relational database stores
data in the form of relations (tables).