Database Management Systems
Database Management Systems
Database Management Systems
• Relational DBMS
– Represent data as two-dimensional tables
– Each table contains data on entity and attributes
• Table: grid of columns and rows
– Rows (tuples): Records for different entities
– Fields (columns): Represents attribute for entity
– Key field: Field used to uniquely identify each record
– Primary key: Field in table used for key fields
– Foreign key: Primary key used in second table as look-up field to
identify records from original table
DBMS and RDBMS
• Data is organised
• Normalisation ( avoid redundancy and data inconsistencies)
– Different forms(1NF,2NF,3NF etc.)
• Primary key(unique field in that table)
– Emp_Id,Customer_Id etc.
• Foreign Keys(look up field in other table where this is
primary key)
Conversion Process
Operational DB
Middleware
Data Warehouse
Updation Anomaly : To update address of a student who occurs twice or more than twice
in a table, we will have to update S_Address column in all the rows, else data will become
inconsistent.
Insertion Anomaly : Suppose for a new admission, we have a Student id(S_id), name and
address of a student but if student has not opted for any subjects yet then we have to
insert NULL there, leading to Insertion Anamoly.
Deletion Anomaly : If (S_id) 402 has only one subject and temporarily he drops it, when we
delete that row, entire student record will be deleted along with it.
As per First Normal Form, no two Rows of data must contain repeating group of
information i.e each set of column must have a unique value, such that multiple columns
cannot be used to fetch the same row. Each table should be organized into rows, and
each row should have a primary key that distinguishes it as unique.
The Primary key is usually a single column, but sometimes more than one column can
be combined to create a single primary key. For example consider a table which is not in
First normal form
Student Table :
In First Normal Form, any row must not have a column in which more than one value is
saved, like separated with commas. Rather than that, we must separate such data into
multiple rows.
N Siva Prasad
Topics
• Creating a database file(open,name,save,re-
open)
• Creating ( within that database)
– a table
– A form
– A query
– A report
Note: each can be given different names and all these
will appear in the left side column in the order as
decided( objectwise or table related or date created
etc.)
Views
• Each of these applications have different views
– Tables
• Design view
• Database view
• Pivot table view
• Pivot Chart view
– Forms
• Form View
• Layout view
• Design View
Views Cntd…
• Each of these applications have different views
– Queries
• Design view
• Database view
• Pivot table view
• Pivot Chart view
• SQL view
– Reports
• Layout view
• Design View
• Report view
• Print view
Design view
• Allows designing the application(table, form,
query or report)
• Need to save after modifications( will be
prompted)
• Data entries are saved automatically.
• Other views are used as applicable for each of
the above
Table
• Select “Create a table” and go to design view
• Primary key is indicated by a small key icon appearing to
the left side to the field name
• Primary key will be a field named ID by default
• The name can be changed
• Entries in other fields are allowed only after entering
value in Primary Key field
• Primary key field can be changed
• Each field to be named logically
• Some names are reserved and can not be used(Ex:
name). Access will prompt accordingly
• Each field has option of different data types
• Each data type has different options
Data Types
• Decide on primary key and accordingly set data
type for primary key( by default “ID”)
• Each field has different options( through
dropdown menu)
• One of them can be selected( Ex: text or number
or auto number etc.)
• Each option has default settings( field properties)
shown as a list under “General”. These settings
can be changed as per requirement
Creating the tables
• Decide on entities and corresponding
attributes with their field properties (
including relationship) and create tables
accordingly for each entity( give suitable
names)
• To build relationship between two tables the
primary key of one table has to be a field in
second table( called “foreign key”)
• The data type of these keys have to be same
Entering Data
• Use datasheet view to enter the data in the fields
created.( each row is called a record)
• Primary key indication will not be there in data sheet
view
• Fill at least five records through datasheet view
• A new field can be added in datasheet view also
• Try adding a field through data sheet view( default text
type)
• “Caption” is used to give meaningful name in Forms for
entering record values( default is field name)