Lecture 1
Lecture 1
• Database design:
1. Power designer, data architect, ERDplus.com, Toad data modeler, or MySQL Workbench:
Visual Database Design
2. Vertabelo: https://vertabelo.com/ Online
3. Navicat Data Modeler: https://navicat.com/en/products/navicat-data-modeler Online
4. Visual Paradigm: https://www.visual-paradigm.com/ Online
5. SQLDBM: https://sqldbm.com/Home/ Online
• Database programming:
1. Python programming language (MySQL python connector).
• Database application with GUI interface (python):
1. Desktop application using Tkinter, PyQT, Kivy, WxPython, Bottle, and PyGUI
2. Web application Flask, Django, CherryPy, Pyramid, Web2Py, Tornado, Bottle, BlueBream,
Quixote
Projects
Information Systems for different entities:
• SIS
• Pharmacy IS
• School IS
• Airport IS
• MIS
• LMS
• Inventory control management
• Electronic health record – Hospital management system
• Online retail application
• Railway management system
• Library management system
• Restaurant management system
• Hotel management system
• Salary management system
• Bank management system
• Electricity bill management system
• Telecommunication company management system
Student groups
• Groups of five students.
• Each group takes one project.
• Working on projects is from the first day.
• Project’s 25 marks are distributed while the semester.
Steps to create a database system
The database life cycle
• This is plus implementing the app
that will provide the business
logic.
Steps
Steps
Steps
https://medium.com/coderby
te/understanding-mysql-
logical-architecture-
526eaf72f66e
Database management system components
The Architecture of a Relational DBMS
Web Forms Application Front Ends SQL Interface
SQL Commands
Ted Codd
Turing Award 1981
CODD’S 12 RULES FOR RDBMS
• Rule 1 : The information rule. All information in the database should be represented in the same way, and stored in tables in the
form of rows and columns.
• Rule 2 : The guaranteed access rule. All data must be accessible logically using the table name, primary key (identifying the
row) and column (attribute value).
• Rule 3 : Systematic treatment of null values. The Null values in a database should be handled systematically and uniformly. No
math expression with Null. Null is Null.
• Rule 4 : Active online catalog. The structure of the entire database must be stored in an online catalog, as a data dictionary.
This data dictionary can be queried by users employing the same query language as used to query other tables in the database.
• Rule 5 : The comprehensive data sub language rule. The system must support at least one relational language that 1. Has a
linear syntax 2. Can be used both interactively and within application programs 3. Supports data definition operations, data
manipulation operations, security and integrity constraints, and transaction management operations. This rule necessitates a query
language like SQL.
• Rule 6 : The view updating rule. All views that can be updated theoretically, must be updated by the system.
• Rule 7 : High-level insert, update, and delete. The system must support insert, update, and delete operations on the database. It
should also support operators that manipulate a set of rows instead of just a single row.
• Rule 8 : Physical data independence. Data stored in the database should be independent of how it is being accessed by external
applications.
• Rule 9 : Logical data independence. Any changes in the logical data should not impact the applications using it.
• Rule 10 : Integrity independence. The database should be able to enforce its own integrity rather than using other programs. Key
and Check constraints, trigger etc, should be stored in Data Dictionary. This also make RDBMS independent of front-end.
• Rule 11 : Distribution independence. The distribution of data to different servers and locations should be hidden from the user.
The user should not get impacted by the distribution of data.
• Rule 12: The non-subversion rule. The database system access should never bypass a relational security or integrity constraint.
The Relational Model: An Example
▪ Let us consider the student entity in a university database
Students Schema
Students(sid: string, name: string, login: string, dob: string, gpa: real)
Columns
Rows
A Sample Relational Database
Example of a Database
(with a Conceptual Data Model)
• Mini-world for the example:
• Part of a UNIVERSITY environment.
• Some mini-world entities:
• STUDENTs
• COURSEs
• SECTIONs (of COURSEs)
• (academic) DEPARTMENTs
• INSTRUCTORs
Example of a Database
(with a Conceptual Data Model)
• Some mini-world relationships:
• SECTIONs are of specific COURSEs
• STUDENTs take SECTIONs
• COURSEs have prerequisite COURSEs
• INSTRUCTORs teach SECTIONs
• COURSEs are offered by DEPARTMENTs
• STUDENTs major in DEPARTMENTs
• Note: The above entities and relationships are typically expressed in a conceptual
data model, such as the ENTITY-RELATIONSHIP data model (see Chapters 3, 4)
Example of a simple database
Data Independence
▪ One of the most important benefits of using a DBMS is data
independence
▪ With data independence, application programs are insulated from how
data are structured and stored.
▪ Data independence entails two properties:
▪ Logical data independence: users are protected from changes in the conceptual
schema (e.g., add/drop a column in a table)
▪ Physical data independence: users are shielded from changes in the physical
schema (e.g., add index or change record order).
Levels of Abstraction
▪ The data in a DBMS is described at three levels of abstraction, the
conceptual (or logical), physical and external schemas
View 1 View 2 View 3
Physical Schema
▪ The physical schema specifies how data
described in the conceptual schema are
stored on secondary storage devices
Disk
▪ Records in a view are computed as needed and usually not stored in a DBMS
• Schema definition
• Storage structure and access-method definition
• Schema and physical-organization modification
• Granting of authorization for data access
• Routine maintenance
• Periodically backing up the database
• Ensuring that enough free disk space is available for normal operations, and upgrading disk space
as required
• Monitoring jobs running on the database
Advantages of Using the Database Approach
• Improved data sharing: Controlling redundancy in data storage and in development and
maintenance efforts.
• Sharing of data among multiple users.
• Improved data security: Restricting unauthorized access to data. Only the DBA staff uses
privileged commands and facilities.
• Providing Storage Structures (e.g. indexes) for efficient Query Processing.
• Better data integration: Wider access to well-managed data promotes an integrated view
of the organization’s operations and a clearer view of the big picture.
• Minimized data inconsistency.
• Improved data access: The DBMS makes it possible to produce quick answers to ad hoc
queries.
• Improved decision making: Better-managed data and improved data access make it
possible to generate better quality information, on which better decisions are based.
• Increased end-user productivity: The availability of data, combined with the tools that
transform data into usable information, empowers end users to make quick, informed
decisions.
Advantages of Using the Database Approach (Cont’d)
• First decade of the 21st century has seen tremendous growth in user generated data
and automatically collected data from applications and search engines.
• Social Media platforms such as Facebook and Twitter are generating millions of
transactions a day and businesses are interested to tap into this data to “understand”
the users
• Cloud storage, processing power, and backup are making unlimited amount of
storage available to users and applications with the ability to process these data,
maybe in real time.
Extending Database Capabilities (3)
• Emergence of Big Data Technologies and NOSQL databases
• New data storage, management and analysis technology was necessary to deal with
the onslaught of data in petabytes a day (10**15 bytes or 1000 terabytes) in some
applications – this started being commonly called as “Big Data”.
• Hadoop (which originated from Yahoo) and Mapreduce Programming approach to
distributed data processing (which originated from Google) as well as the Google
file system have given rise to Big Data technologies. Further enhancements are
taking place in the form of Spark based technology.
• NOSQL (Not Only SQL- where SQL is the de facto standard language for relational
DBMSs) systems have been designed for rapid search and retrieval from
documents, processing of huge graphs occurring on social networks, and other
forms of unstructured data with flexible models of transaction processing.
Thank you