Relational Database 157a (1) Flashcards
(42 cards)
What is Data?
- data refers to raw facts, observations, or information that can be collected, stored, and analyzed.
- it can take various forms, including numbers, text,images, audio, and more
- It is the foundation of knwoledge
What are the types of data?
Structured,Unstuctured, and Semi-Structured
What is Structured Data?
- can be described according to a formal logical data model
- ability to express integrity rules and enforce correctness of data also facilitates searching, processing and analyzing the data
- ex. number, name, address, email of a student
What is Unstructured Data?
- No finer grained components in a file or series of characters that can be interpreted in a meanigful way by a DBMS or application
- Ex. invoices, audio, records, emails, audio, weather data, sensor data
- total volume of unstrucutred data surpasses that of structured data
What is semi structured data?
Semi-structured data
○ data which does have a certain structure, but the structure may be very irregular or highly
volatile
○ E.g., individual users’ webpages on a social media platform, or resume documents in a human
resources database
Where do we store data?
●SSDs
● HDDs
● PC registers
● Files
These are all considered databases
What is a database?
● A collection of files storing related data.
● A Database is a large, organized collection of related data
● A Database Management System(DBMS) is the software designed to store, manage,
and facilitate access to large collections of related data
● The combination of a DBMS and a database is often called a database system
examples:
Accounts database;
Payroll database
Amazon’s products database
Airline reservation database
What is DBMS?
- A big program that allows us to manage efficiently a large database and allows it
to persist over long periods of time.
Examples of DBMSs
– Oracle, IBM DB2, Microsoft SQL Server, Vertica, Teradata
– Open source: MySQL (Sun/Oracle), PostgreSQL, AsterixDB
– Open source library: SQLite
What are some DBMS features?
Supports massive amounts of data
–Giga/tera/peta bytes
–Far too big for main memory
Persistent storage
–Programs update, query, manipulate data.
–Data continues to live long after program finishes.
Efficient and convenient access
–Efficient: do not search entire database to answer a query.
–Convenient: allow users to query the data as easily as possible.
What is a database model?
●A database model is comprised of different data models, each describing the
data from different perspectives
● A data model provides a clear and unambiguous description of the data items,
their relationships and various data constraints from a particular perspective
● Database model or database schema provides the description of the database
data at different levels of detail and specifies the various data items, their
characteristics and relationships, constraints, storage details, etc.
○ specified during database design and not expected to change too frequently
○ stored in the catalog
ex.
Student (number, name, address, email)
Course (number, name)
Building (number, address)
What is Database State?
Database state represents the data in the database at a particular moment
○ also called the current set of instance\
○ typically changes on an ongoing basis
What are the three famous layers of architecture?
- External
- Conceptual/Logical
- Internal
Changes in one layer should have no to minimal impact on the others
○ Physical data independence
○ Logical data independence
What is the External Layer?
● External layer (View level)
○ External data model which includes views
○ Used to control data access and enforce security
Changes in one layer should have no to minimal impact on the others
○ Physical data independence
○ Logical data independence
What is the conceptual logical layer?
Conceptual\logical layer (Logical level)Contains the conceptual and logical
data models
○ E.g.,tables
Changes in one layer should have no to minimal impact on the others
○ Physical data independence
○ Logical data independence
What is the internal layer?
Internal layer (Physical level)
○ Includes the internal data model
○ E.g., Index
Changes in one layer should have no to minimal impact on the others
○ Physical data independence
○ Logical data independence
Who are some of the different database users?
- Information architect designs the conceptual data model–closely interacts
with the business user
● Database designer translates the conceptual data model into a logical and
internal data model
● Database administrator(DBA) is responsible for the implementation and
monitoring of the database
● Application developer develops database applications in a programming
language such as Java or Python
● Business user will run these applications to perform specific database
operations
Advantages of DB Systems and DB Management?
Data Independence
● Database Modelling
● Managing Structured, Semi-Structured and Unstructured Data
● Managing Data Redundancy
● Specifying Integrity Rules
● Concurrency Control
● Backup and Recovery Facilities
● Data Security
● Performance Utilities
What are the different types of databases?
- Centralized
- Distributed
- NoSql
- Cloud
- Relational
- Network
- Object oriented
- hierarchical
Hierarchical DBMS?
● Data in this type of database is structured hierarchically.
● One-to-one and a one-to-many relationship between two/more types of data.
● Can access the records by navigating down through the data structure using pointers.
● The “root” in the structure is a single table in the database and other tables act as the branches
flowing from the root.
● A relationship in this database model is represented by the term parent/child.
● The windows registry used in Windows XP is an example of a hierarchical database.
Drawbacks:
● Storing a record in a child table without a related parent
entry poses difficulties, requiring users to record an
additional entry in the parent table.
● This database lacks support for complex
relationships and faces redundancy issues,
leading to inaccurate information from
inconsistent data recording across multiple sites.
Network DBMS?
● Supports many-to-many relations.
● Fast data access
● There are two fundamental concepts of a network model:
1. Records contain fields that need hierarchical organization.
2. Sets are used to define one-to-many relationships between records that contain one
owner, many members.
Drawbacks:
● A user must be very familiar with the structure of the
database to work through the set structures.
● Updating inside this database is a tedious task.
Changing a set structure impacts application
programs relying on it. Modifications to the
structure require corresponding updates in
programreferences
Object Oriented DBMS?
● Represents information in the form of objects as used in object-oriented programming.
● Capable of handling a large variety of data types
● Improved performance
● Enriched modelling capabilities
● Some POPULAR EXAMPLES of OODBMs are TORNADO, Gemstone, ObjectStore, GBase,
VBase, InterSystems Cache, Versant Object Database, ODABA, ZODB, Poet. JADE, and
Informix.
Drawbacks:
● An object-oriented database is more expensive to develop.
● Most organizations are unwilling to abandon and convert
from those databases.
Relational DBMS?
● Based on the relational model introduced by E.F. Codd.
● Standard relational databases enable users to manage predefined data relationships across
multiple databases.
● Relational databases use key fields in each table to uniquely identify rows and establish
connections between different tables.
● Simplicity
● Ease of Data Retrieval
● Data Integrity
● Flexibility
Database system that stores and retrieves data in a tabular format.
● Organized in the form of rows and columns.
● Capability to handle larger magnitudes of data
● Relational Database Management Systems.
● Based on the relational model introduced by E.F. Codd
● A program that allows us to create, delete, and update a relational database.
● RDBMS languages are Oracle SQL, MySQL, etc.
● Maintains data integrity
What is DDL?
○ It is used to define database structure or pattern.
○ It is used to create schema, tables, indexes, constraints, etc. in the database.
○ Using the DDL statements, you can create the skeleton of the database.
○ Stores the information of metadata like the number of tables and schemas, their names, indexes, columns
in each table, constraints, etc.
Some tasks that come under DDL:
○ Create: It is used to create objects in the database.
○ Alter: It is used to alter the structure of the database.
○ Drop: It is used to delete objects from the database.
TIidlldfb
t is
What is DML(Data Manipulation Language)?
○ It is used for accessing and manipulating data in a database.
○ It handles user requests.
Some tasks that come under DML:
○ Select: It is used to retrieve data from a database.
○ Insert: It is used to insert data into a table.
○ Update: It is used to update existing data within a table.
○ Delete: It is used to delete all records from a table.
○ Merge: It performs UPSERT operation, i.e., insert or update operations.
○ Call: It is used to call a structured query language or a Java subprogram.