The document provides information about a database course including:
1) An overview of the course content which covers database fundamentals, the relational model, normalization, conceptual modeling, query languages, and advanced SQL topics.
2) Details about the lecturer including their academic background and publications.
3) Assessment details for the course including exams, labs, and project work accounting for 100% of the grade.
Chapter 01 Fundamental of Database Management System (DBMS)Abdurehman Mahmud
This is an introduction to a fundamental database management system lecture Note. If it interests you please comment me and I will do it for the next chapters.... thanks a lot!!
Relational databases have pretty much ruled over the IT world for the last 30 years. However, Web 2.0 and the incipient Internet of Things (IoT) are some of the sources of a data explosion that has proved to exceed the limits of what modern relational databases can handle in a growing number of cases. As a result, new technologies had to be developed to handle these new use cases. We generally group these technologies under the umbrella of Big Data. In this two part presentation, we will start by understanding how relational databases have evolved to become the powerhouses they are today. In part 2 we will look at how non SQL databases are tackling the big data problem to scale beyond what relational databases can provide us today.
Chapter 01 Fundamental of Database Management System (DBMS)Abdurehman Mahmud
This is an introduction to a fundamental database management system lecture Note. If it interests you please comment me and I will do it for the next chapters.... thanks a lot!!
Relational databases have pretty much ruled over the IT world for the last 30 years. However, Web 2.0 and the incipient Internet of Things (IoT) are some of the sources of a data explosion that has proved to exceed the limits of what modern relational databases can handle in a growing number of cases. As a result, new technologies had to be developed to handle these new use cases. We generally group these technologies under the umbrella of Big Data. In this two part presentation, we will start by understanding how relational databases have evolved to become the powerhouses they are today. In part 2 we will look at how non SQL databases are tackling the big data problem to scale beyond what relational databases can provide us today.
Database Management Systems - Management Information SystemNijaz N
A DBMS is software that:Acts as an interface between application programs and the data files.Helps to reduce data redundancy and eliminate data inconsistency by allowing a central, shared data source
This is the Briefly introduction to Database system with the help of comparison with the previous technology file Base System. In this lecture reader will be able to understand the fundamental concept of the Database System and know about the all primer Concept of the Database system. This lecture will helpful for those, who are lack or less knowledge about the Database System.
This presentation discusses the following topics:
What is File Management System?
What is Database Management System?
File system vs Database Management System
Limitations of File Based System
Advantages of Database Management System
DBMS Environment
Examples of Database Applications
Limitation of Database Management System
In this PPT, you will learn:
• The difference between data and information
• What a database is, the various types of databases, and why they are valuable assets for
decision making
• The importance of database design
• How modern databases evolved from file systems
• About flaws in file system data management
• The main components of the database system
• The main functions of a database management system (DBMS)
Database Management Systems - Management Information SystemNijaz N
A DBMS is software that:Acts as an interface between application programs and the data files.Helps to reduce data redundancy and eliminate data inconsistency by allowing a central, shared data source
This is the Briefly introduction to Database system with the help of comparison with the previous technology file Base System. In this lecture reader will be able to understand the fundamental concept of the Database System and know about the all primer Concept of the Database system. This lecture will helpful for those, who are lack or less knowledge about the Database System.
This presentation discusses the following topics:
What is File Management System?
What is Database Management System?
File system vs Database Management System
Limitations of File Based System
Advantages of Database Management System
DBMS Environment
Examples of Database Applications
Limitation of Database Management System
In this PPT, you will learn:
• The difference between data and information
• What a database is, the various types of databases, and why they are valuable assets for
decision making
• The importance of database design
• How modern databases evolved from file systems
• About flaws in file system data management
• The main components of the database system
• The main functions of a database management system (DBMS)
Prerequisies of DBMS
Course Objectives of DBMS
Syllabus
What is the meaning of data and database
DBMS
History of DBMS
Different Databases available in Market
Storage areas
Why to Learn DBMS?
Peoples who work with Databases
Applications of DBMS
FellowBuddy.com is an innovative platform that brings students together to share notes, exam papers, study guides, project reports and presentation for upcoming exams.
We connect Students who have an understanding of course material with Students who need help.
Benefits:-
# Students can catch up on notes they missed because of an absence.
# Underachievers can find peer developed notes that break down lecture and study material in a way that they can understand
# Students can earn better grades, save time and study effectively
Our Vision & Mission – Simplifying Students Life
Our Belief – “The great breakthrough in your life comes when you realize it, that you can learn anything you need to learn; to accomplish any goal that you have set for yourself. This means there are no limits on what you can be, have or do.”
Like Us - https://www.facebook.com/FellowBuddycom
● Why Databases?
● Why Database Design is Important?
● The Database System Environment and Functions.
● Managing the Database System: A Shift in Focus.
Overview of Data Base Systems Concepts and ArchitectureRubal Sagwal
Data
Data Hierarchy
Introduction of Database
DBMS
Characteristics of database approach
Advantages of DBMS
Data models
Schemas, Three schema architecture:
-The external level
-The conceptual level and
-The internal level.
Data Independence
Database languages and Interfaces
Roles of Database Administrator
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Database part1-
1. Course code: ITI131
Course title : Database
PART: 1
Prof. Taymoor Mohamed Nazmy
Dept. of computer science, faculty of computer science, Ain Shams uni.
Ex-vice dean of post graduate studies and research Cairo, Egypt
1
3. About the lecturer
- Prof. of computer science since 2006,
- Director of Ain Shams information network,
- Vice dean of post graduate studies and research,
- Vice dean of environmental and social affairs,
- Member in editorial board of many Int. journals,
- Member in Scientific committee of many int. conferences
- Executive chair of int. conf. on information and intelligent systems,
- Published more than 60 scientific papers in int. journals and
conference,
Supervised more than 20 master and Ph. D thesis.
3
4. About the course
• The materials of this course were collected from many resources, include the
reference book, other books, online courses, presentations, and web sites.
• There are many details will be given to simplify topics in this course, however at the
end of the course the most important topics will be highlighted.
• The delivered materials through this presentation is your main resource,
• This presentation will be delivered to you.
• There will be term exams 40%
• Lab 20%
• The final exam 40%
• The exam will include subjective and objective questions,
• Through this course try to extends your knowledge by improving your self learning
capabilities.
4
6. Important
• Try to continues improve your language by
adding new vocabulary (word meaning),
• Read the lecture more than one time,
• You may got more details from references,
• There are think to remember , and others to
understand.
6
7. Understand a DBMS and define its components.
Understand the architecture of a DBMS and its levels.
Distinguish between different database models.
Understand the concept of relational database operations
on a relation.
Course objectives
Use Structured Query Language (SQL) to define simple
relations.
Use E/R diagram for modeling relations
7
8. Structure of complete Course
Database
Fundamentals
Relational
Model
Normalization
Conceptual
Modeling
Query
Languages
Advanced
SQL
Transaction
Management
Java DB
Applications –
JDBC
Data
Mining
0. Intro 1. Design 3. Applications 4. Advanced
Topics
Newbie Users ProfessionalsDesigners
Database course
2. Querying
Developers
8
10. Stages of Information System
Stage 0: Manual Information System
• Records
• Files
• Index Cards
Stage 1: Sequential Information Systems
• Tapes
• Files
• slow, non-interactive, redundancy,... .
Stage 2: File Based Information Systems
• Disk (direct access)
• application program has its own file
• data redundancy
Stage 3: DBMS based Information Systems
• Generalized data management software
• Transaction processing 10
11. Office automation system
• Refers to the varied computer machinery
and software used to digitally create, collect, store,
manipulate, and relay office information needed for
accomplishing basic tasks. Its objectives are:
• Paperless work environment
• Simplify operations and minimize computational errors
• Optimal utilization of resources
• Better information sharing and transparency
• Enhanced security and recovery of data
1111
12. Office automation system
It includes many applications such as:
document management
word processing
desktop publishing
electronic communications
electronic scheduling
data management
project management
12
13. Document Management System
A document management system (DMS) is a computer
system (or set of computer programs) used to track and
store electronic documents and/or images of paper
documents.
Document management is a process taken with
document within an organization, with respect to the
creation, distribution and deletion of documents
13
14. Document Management System
benefits
1. Improve staff productivity
2. Reduce costs associated with manual document
3. Promote sharing of knowledge and information
4. Enhance corporate transparency and governance
5. E-mail and fax files instantly
6. Access documents while traveling
7. Publish documents to CD, DVD or the web, as
appropriate
14
16. 16
Databases are a Rich Area for Computer Science
• Programming languages and software engineering,
• Data structures and algorithms,
• Logic, discrete maths, computation theory,
• It is a common course for students from different
department in computer and engineering science.
17. • Creation more databases has great
impact towards better environment of
the world, how?
17
18. Advantages of Using the
Database Approach
• More information from given data
• Ad hoc queries can be performed
• Redundancy can be reduced
• Inconsistency can be avoided
• Security restriction can be applied
18
19. Advantages of Using the Database
Approach - 2
• Sharing of data among multiple users.
• Providing backup and recovery services.
• Providing multiple interfaces to different
classes of users.
• Representing complex relationships among
data
19
20. What is a database?
Database
a collection of related records, organized into tables
Table
a set of data elements (values) organized by records (horizontal
rows) and fields (vertical columns)
Record (or row)
a single, structured data item in a table
Field (or column)
a set of data values of a particular simple type, one for each row
of the table
20
21. Slide 21
Database Tables: The Big Picture
To calculate the number of entries in a database--multiply the number of fields by the
number of records.
Ex. 5 fields(columns)*26 rows (records) = 130 entries in this database.
2. ENTRIES (cells)
4. RECORDS (rows)
3. FIELDS (columns)
1. Table
3. Field
2. Entries
4. Record
22. Comparison of Terminology
Formal (logical)relational term Informal (physical)equivalents
relation table
tuple row or record
cardinality number of rows
attribute column or field
degree
Primary key
number of columns
(unique) identifier
domain pool of legal values
22
23. 23
What is a Database?
• It contains data specific to part of the real
world, a miniworld.
• Construction: populating tables with data.
• Manipulation: queries, updates, deletes, etc.
• It is maintained for specific applications.
23
24. Why do businesses use databases?
• A database is a tool used by businesses to
manage the huge amount of data required to
run the business.
– For example, a business may use several databases
to keep track of employee information, customers,
products, and prices of products.
– All of the information can be easily and efficiently
managed and shared by database software.
Slide 24
25. Business Rules
• What
– Brief, precise, and unambiguous descriptions of operations in an
organization
• based on policies, procedures, or principles within a specific
organization
• Why
– Enhance understanding & facilitate communication
• Standardize company’s view of data
• Constitute a communications tool between users and designers
• How (sources)
– Interviews
• Company managers
• Policy makers
• Department managers
• End users
– Written documentation
• Procedures, Standards, Operations manuals
– Observation
• Business operations
2525
26. What is a database tasks?
• Database tasks:
– Retrieving
– Sorting
– Summarizing
– Inserting
– Updating
– Deleting
26
27. Types of Databases and Database
Applications
• Numeric and Textual Databases (e.g. IRS
CADE)
• Multimedia Databases (e.g. Cortina)
• Geographic Information Systems (GIS)
• Data Warehouses
• Real-time and Active Databases
27
28. Examples of Databases
• Web database:
• Online library card catalog
–Media Center information
–Encyclopedias
–Dictionaries
• eBay and other online
• businesses
–Inventory
–Keep track of customers,
products, vendors, pay pal
accounts
Slide 28
► Bank accounts
► Students records
► Hospital record
► Payroll
• Stock market
• Barcode scanner keeps
• Real estate listings
• Fingerprint database
29. Top 5 Largest Databases in the World
• Library of Congress: 130 million items
• The Central Intelligence Agency (CIA)
• Amazon: 59 million active customers
• YouTube: 100 million videos watched per day
• ChoicePoint: Information on 250 million people
29
31. Database Users
• End users
– Use the database system to
achieve some goal
• Application developers
– Write software to allow end
users to interface with the
database system
• Database Administrator
(DBA)
– Designs & manages the
database system
• Database systems
programmer
– Writes the database software
itself
31
35. File System: Weakness
• File system was an old system to handle data, it can be used on small scale
of data, but with larger data it become ineffective.
• Weakness
– “Islands of data” in scattered file systems.
• Problems
– Duplication
• same data may be stored in multiple files
– Inconsistency
• same data may be stored by different names in different format
– Rigidity
• requires customized programming to implement any changes
• cannot do ad-hoc queries
• Implications
– Waste of space
– Data inaccuracies
– High overhead of data manipulation and maintenance 3535
36. Evolution of Data Models
• A data model (or datamodel is an abstract model that organizes elements
of data and standardizes how they relate to one another and to properties of
the real world entities.
36
1960s 1970s 1980s 1990s 2000+
File-based
Hierarchical
Network
Relational
Object-oriented
Web-based
Entity-Relationship
36
40. Database design process
• Determine the purpose of the database - This helps
prepare for the remaining steps.
• Find and organize the information required - Gather all
of the types of information to record in the database, such as
product name and order number.
• Divide the information into tables - Divide information
items into major entities or subjects, such as Products or
Orders. Each subject then becomes a table.
• Turn information items into columns - Decide what
information needs to be stored in each table. Each item
becomes a field, and is displayed as a column in the table.
For example, an Employees table might include fields such
as Last Name and Hire Date.
40
41. • Specify primary keys - Choose each table’s primary key. The
primary key is a column, or a set of columns, that is used to
uniquely identify each row. An example might be Product ID or
Order ID.
• Set up the table relationships - Look at each table and decide how
the data in one table is related to the data in other tables. Add fields
to tables or create new tables to clarify the relationships, as
necessary.
• Refine the design - Analyze the design for errors. Create tables and
add a few records of sample data. Check if results come from the
tables as expected. Make adjustments to the design, as needed.
• Apply the normalization rules - Apply the data normalization rules
to see if tables are structured correctly. Make adjustments to the
tables, as needed.
41
42. Relational Data Structure
• Data is stored in relations (tables)
• Each relation has a scheme
(pattern) (heading)
• The scheme defines the relation’s
attributes (columns)
• Data takes the form of tuples
(rows)
Name Age
John 23
Mary 20
Mark 18
Jane 21
Attributes
Scheme
Tuples
42
43. Relational Data Structure
• More formally -
– A scheme is a set of
attributes
– A tuple assigns a value
to each attribute in its
scheme
– A relation is a set of
tuples with the same
scheme
{ { (Name, John), (Age, 23) },
{ (Name, Mary), (Age, 20) },
{ (Name, Mark), (Age, 18) },
{ (Name, Jane), (Age, 21) } }
Name Age
John 23
Mary 20
Mark 18
Jane 21
43
44. Relations
ID Name Salary Department
M139 John Smith 18,000 Marketing
M140 Mary Jones 22,000 Marketing
A368 Jane Brown 22,000 Accounts
P222 Mark Brown 24,000 Personnel
A367 David Jones 20,000 Accounts
Attributes are ID, Name, Salary, and Department Degree is 4
Cardinality is 5
Tuples, e.g.
{ (ID, A368),
(Name, Jane Brown),
(Salary, 22,000),
(Department, Accounts) }
Scheme is {ID, Name, Salary, Department}
44
47. A relational database management
system (RDBMS)
• A software system used to maintain relational databases is a relational
database management system (RDBMS). Virtually all relational database
systems use SQL (Structured Query Language) for querying and
maintaining the database.
• A relational database management system (RDBMS) is a database
management system (DBMS) that is based on the relational model as
invented by Edgar F.Codd, of IBM's San Jose Research Laboratory, in
1970s.
• In 2017, many of the databases in widespread use are based on
the relational database model.
• Each row in a table has its own unique key( primary key). Rows in a
table can be linked to rows in other tables by adding a column for the
unique key of the linked row
47
48.
49. DBMS components
Hardware –
the physical computer system that allows physical access to data.
Software –
the actual program that allows users to access, maintain, and update physical
data.
Data – stored physically on the storage devices
Users –
End users - Normal user and DBA (Database Administrator)
Application programs
Procedures –
a set of rules that should be clearly defined and followed by the users.
50. 50
DBMS Functions
• Data dictionary management
• Data storage management
• Data transformation and presentation
• Security management
• Multiuser access control
• Backup and recovery management
• Data integrity management
• Database language and
• application programming interfaces
• Database communication interfaces
53. The leading vendors (sellers) of RDBMS
• There 10s 0f RDBMS vendors the leading ones are:
**** RDBMS Vendors **** RDBMS Product ****
Computer Associates INGRES
IBM DB2
INFORMIX Software INFORMIX
Oracle Corporation Oracle
Microsoft Corporation MS Access
Microsoft Corporation SQL Server
MySQL AB MySQL
NCR Teradata
PostgreSQL Dvlp Grp PostgreSQL
Sybase Sybase 11
53
54. RDBMS vendor market share
54
In 2016 the revenue reached 35 billion dollars for the Oracle.
55. Which relational DBMS is best for your company?
• If you're a large organization with a mainframe and want
• For Unix and Linux installations, your primary choices are
Oracle and DB2.
• Oracle is the market leader on those platforms, though IBM
has a solid presence there, too.
• For Windows development, Microsoft is the clear leader on
its own OS. Also, , Microsoft has announced plans to
support SQL Server on Linux.
55
56. Database design
• Database design is the process of producing a
detailed data model of database.
• This data model contains all the needed logical
and physical design choices and physical storage
parameters needed to generate a design in a data
definition language, which can then be used to
create a database.
• A fully attributed data model contains detailed
attributes for each entity.
58. ER model -- Database Modeling
Database designs include ER (entity-relationship
model) diagrams. An ER diagram is a diagram that
helps to design databases in an efficient way.
The ER data model employs three basic concepts:
entity sets,
relationship sets,
attributes.
The ER model can express the overall logical structure
of a database graphically.
58
59. Basics of E-R Diagrams
• Entity
– represented by a rectangle
with its name in capital
letters.
• Relationships
– represented by an active or
passive verb inside the
diamond that connects the
related entities.
• Connectivities
– i.e., types of relationship
– written next to each entity
box. 5959
60. 60
Schemas
• Relation schema = relation name and attribute
list.
Optionally: types of attributes.
Example: Beers(name, manf) or Beers(name: string,
manf: string)
• Database = collection of relations.
• Database schema = set of all relation schemas in
the database.
60
63. Slide 63
Example of a Relation
STUDENT (Name, SSN, Home_phone, Addr, Office_phone, Age, GPA)
63
64. 64
Example: University Database using
E/R diagram
• Professors work for only one department
• Departments have many professors
• Each course is taught by only one professor
• Students make a plan or program of study
• A course could meet in several rooms/times
• Graduate students must have an advisor
• Cities are categorized as resident/BirthPlace
• Visiting prof. need an End/Start date
65. 65
E/R diagram of a University Database
BIRTH_PLACE
CITY
Name
State
PERSON
LastName
Age
PROFESSOR
TenureStatus
Title
STUDENT
DEPARTMENT
Name
Phone
Belongs_To
ENROLLED
Semester
Grade
PLANNED
Semester
GRADUATE_STUDENT ADVISED_BY
VISITING_
PROFESSOR
Start_Appointment
End_Appointment
COURSE
Title
Description
Credits
TAUGHT_BY
Semester
MEETS
ROOM
RoomNumber
Building
TIME
Day
Hour
RESIDENT
1 N
N
N
N
N
N
N
1
N N
N 1
1
N
N
1
66. Types of Data
1. User data
2. Metadata
3. Indexes
4. Application Metadata
66
67. 1. User Data
• A table of data is called a relation
• Columns are fields or attributes
• Rows are specific instances
• Relations must be structured properly
67
68. 2. Metadata or
Data Dictionary
“a description of the structure of the database”
System tables store metadata, including:
table names
field names
primary key fields
data types
field size
data constraints (e.g., input masks, and validation rules)
relationships between tables
68
71. 4. Application Metadata
Stores the structure and format of:
– forms
– reports
– Queries:a query is a form of questioning using query language
– other application components
71
72. Relations Keys
“In rational database the relations are connects through unique
identifier called key. It is a group of one or more attributes
that uniquely identifies a row”
73. Types of Keys
• A (primary) key is one (or more) columns
of a relation that is (are) used to identify a
row
• A composite key is a key that contains two
or more attributes
– For a key to be unique, it is sometimes necessary to use a
composite key
– Can also generate a set of unique values to serve as the
key (for example University ID numbers)
73
74.
75. A Foreign Key
• A table may be related to other tables (i.e., a
relationship)
• To create relationships, you may need to
create a foreign key
• A foreign key is a primary key from one table
placed into another table
• Referential integrity - every value of a foreign
key must match a value of an existing primary
key
75
77. Properties of a Relation (table)
1. There are no duplicate tuples (rows).
–The body of the relation is a
mathematical set (i.e., a set of tuples),
and sets in mathematics by definition do
not include duplicate elements.
–If a "relation" contains duplicate tuples,
then it is not a relation.
77
78. Properties of a Relation
2. Tuples (rows) are unordered (top to bottom).
– Sets in mathematics are not ordered. So,
even if a relation A's tuples are reversely
ordered, it is still the same relation.
– Thus, there is no such thing as "the 5th
tuple" or the last tuple. In other words,
there is no concept of positional
addressing.
78
79. Properties of a Relation
3. Attributes (columns) are unordered (left to right).
–The heading of a relation is also defined
as a set.
–There is no such thing as "5th attribute
(column)" or the last attribute.
79
80. Properties of a Relation
4. All attribute values are atomic.
– At every row-and-column position within
the table, there always exists precisely one
value, never a list of values. Or
equivalently, relations do not contain
repeating groups.
– A relation satisfying this condition is said to
be in First Normal Form.
80
81. Entity Integrity Rule
• Guarantees that each entity will have a unique
identity and ensures that foreign key values can
properly reference primary key values.
• Requirement
– No component of the primary key is allowed
to accept nulls.
– By "null" here, we mean that information is
missing for some reason.
81
82. Foreign Key
• An attribute in one table whose values must either match
the primary key in another table or be null.
• Attribute FK of base relation R2 is a foreign key if and
only if it satisfies the following two time-
• independent properties:
– Each value of FK is either wholly null or wholly non-
null.
– Each non-null value of FK is identical to the value of
PK in some tuple of R1.
82
83. Referential Integrity Enforcement
• Referential Integrity (RI) is a database concept used to ensure that the
relationships between your database tables remains synchronized during
data modifications, you may choose among those items:
• Restriction:
– does not allow any deletion
• Nullification:
– if value is deleted, reference value will set to be null.
• Cascading:
– if value is deleted, reference value will also be deleted.
– if value is updated, reference value will also be updated.
• Default value:
– if value is deleted, reference value will be have default value, which is
provided by the system.
83
84. Referential Integrity Enforcement
• Cascade Update Related Fields
– Change of PK values in primary table
automatic change of FK values
• Cascade Delete Related Fields
– Delete of a record in the primary table
automatic delete of all records in the related
table that have a matching FK value
84
87. Data Definition Language (DDL)
• : DDL is used for specifying the database schema. Let’s take
SQL for instance to categorize the statements that comes
under DDL.
• To create the database instance – CREATE
• To alter the structure of database – ALTER
• To drop database instances – DROP
• To delete tables in a database instance – TRUNCATE
• To rename database instances – RENAME
• All these commands specify or update the database schema
that’s why they come under Data Definition language.
87
88. Data Manipulation Language
(DML)
• DML is used for accessing and manipulating
data in a database
• To read records from table(s) – SELECT
• To insert record(s) into the table(s) – INSERT
• Update the data in table(s) – UPDATE
• Delete all the records from the table –
DELETE
88
89. Data Control language (DCL)
• DCL is used for granting and revoking user access
on a database –
• To grant access to user – GRANT
• To revoke access from user – REVOKE
• In practical data definition language, data
manipulation language and data control languages
are not separate language; rather they are the parts
of a single database language such as SQL.
89