SlideShare a Scribd company logo
App Design for Business 
Topic: Database 
Topic Number: 7
Key topics / learning outcomes 
of this lecture 
• Database use within an Android App; 
• Learn the concept of creating an 
SQLite Database; 
• A look at SQL (Structured Query 
Language); 
2
What is a database? 
B4004A L1 3
Different types of Database 
B4004A L1 4
Android Database 
The database used with Android is called 
SQLite. 
This database is a trimmed down 
version of MySQL, PostgreSQL and 
other similar databases. 
B4004A L1 5
SqLite Android Database 
• it is a relational database; 
• SQLite was originally designed for defence purposes; 
• it has no administrator; 
• it uses less data types than other typical relational 
databases: 
– int: a signed integer; 
– real: a floating-point number; 
– text: a text string; 
– blob: a ‘blob’ of data; 
• It is ‘shipped’ with Android: 
– Each APP has its own SQLite database. 
B4004A L1 6
Usual steps to design a database 
• Create a Data dictionary 
– List all the data terms, 
• example: name, address, postcode; 
– Allocate a data type to the field 
• example: the _id field has a data type of int; 
• Create an Input/Output list 
– identify all inputs and outputs, 
• example: input name, address, postcode 
• example: output list of all address in postcode W1. 
B4004A L1 7
Usual steps to design a database 
• Identify Entities 
– list relationships 
• one to one 
• one to many 
• many to many 
• List attributes 
– their data type; 
– their default value; 
• Normalize 
– reduce duplication of data storage 
• create new tables to reduce duplication of fields; 
• Add keys 
– primary key 
– foreign keys 
B4004A L1 8
Data Flow Diagrams 
• Once all the information gathering is complete, a 
database design is moved on to the drawing 
stage; 
• The first drawing will be very concise, almost like 
a ‘birds eye view’ of the database, usually named 
a Context drawing; 
• Each section of the Context drawing will be 
expanded level by level until the detail is 
exhausted, therefore no more detailed level may 
be reached. 
B4004A L1 9
Context Drawing 
B4004A L1 10
An Example of a Data Flow Diagram 
Source: http://conta11.my3gb.com/examlpe-of-data-flow-diagram.html 
B4004A L1 11
An example of database tables 
together with their relationships 
Source: http://carlibrary.org/CarDatabases.htm 
B4004A L1 12
Databases comprise of … 
• Tables 
– Usually a database will contain more than one 
table: 
– example PERSON, PERSON_ADDRESS. 
• Fields 
– Fields are ‘table columns’ with a heading and 
column content 
• Records 
– are ‘table rows’ with an ‘id’ and row content 
B4004A L1 13
… a closer look at databases … 
B4004A L1 14
A table within a Database 
_id Name Password 
1 Pearson 123 
2 John abcd 
3 Viz 5678 
This table will 
have a name, 
for example: 
PERSON 
B4004A L1 15 
This database 
will have a 
name, for 
example: 
ADDRESS_BOOK
Relational Tables 
address_id Address _id 
1 1 Smith Street 2 
2 80 Strand 1 
3 6 Jones Square 3 
_id Name Password 
1 Pearson 123 
2 John abcd 
3 Viz 5678 
This table will 
have a name, 
for example: 
PERSON 
B4004A L1 16 
This table will 
have a name, for 
example: 
PERSON_ADDRESS
Relational Tables 
addres 
s_id 
Address Address_Type _id 
1 1 Smith Street Halls of Residence 2 
2 80 Strand Office 1 
3 6 Jones Square Private Rented 3 
4 2 The Farmhouse Home 2 
_id Name Password 
1 Pearson 123 
2 John abcd 
3 Viz 5678 
This table will 
have a name, 
for example: 
PERSON 
B4004A L1 17 
This table will 
have a name, for 
example: 
PERSON_ADDRESS
Relational Tables 
addres 
s_id 
Address Address_Type _id 
1 1 Smith Street Halls of Residence 2 
2 80 Strand Office 1 
3 6 Jones Square Private Rented 3 
4 2 The Farmhouse Home 2 
_id Name Password 
1 Pearson 123 
2 John abcd 
3 Viz 5678 
Foreign 
Key 
B4004A L1 18 
Primary 
Key 
Fields 
(Columns) 
Records 
(Rows)
Use SQL to access data, for example 
SQL Syntax 
SELECT * FROM PERSON INNER JOIN PERSON_ADDRESS ON PERSON._id = 
PERSON_ADDRESS._id WHERE PERSON.Name=John; 
B4004A L1 19 
SELECT column_name(s) 
FROM table1 
INNER JOIN table2 
ON table1.column_name=table2.column_name 
WHERE table1.column_name= ? ; 
Actual SQL derived from the syntax
More SQL (Structured Query 
Language) Resources 
• SQL is a standard database protocol: 
– adopted by most ‘relational’ databases; 
• Provides syntax for interaction with databases; 
• For more info, visit W3schools for their 
tutorial on SQL: 
– here you will find all the SQL syntax needed to 
interact with your database. 
http://www.w3schools.com/sql 
B4004A L1 20
Seminar 
• In the seminar for this lecture, you will be 
copying and pasting code into IntelliJ and 
running a database. 
• You will be making some changes to the fields 
and tables to learn how you may tailor the 
database to suit a different application. 
B4004A L1 21
Workshop 
• In the workshop for this lecture, you will be 
viewing a series of tutorials explaining more 
about SQLite. 
B4004A L1 22
Essential work for next week 
• Please consult the OLE for details of: 
– Essential readings* 
– Seminar/workshop preparation work* 
– Recommended further readings 
– Any additional learning 
* Essential readings and preparation work must always be completed in time 
for the next session 
23
End of presentation 
© Pearson College 2013
Lecture 7 database

More Related Content

What's hot

Normalization: A Workshop for Everybody Pt. 2
Normalization: A Workshop for Everybody Pt. 2Normalization: A Workshop for Everybody Pt. 2
Normalization: A Workshop for Everybody Pt. 2
Command Prompt., Inc
 
Database: An Introduction
Database: An IntroductionDatabase: An Introduction
Database: An Introduction
Bro Shola Ajayi
 
Ms access
Ms accessMs access
Ms access
RoshanMaharjan13
 
Fa 4 cse g35-1 dbms
Fa 4 cse g35-1 dbmsFa 4 cse g35-1 dbms
Fa 4 cse g35-1 dbms
ArpitTyagi43
 
Cataloging Basics Webinar (NEKLS)
Cataloging Basics Webinar (NEKLS)Cataloging Basics Webinar (NEKLS)
Cataloging Basics Webinar (NEKLS)
Heather Braum
 
Cataloging basics
Cataloging basicsCataloging basics
Cataloging basics
robin fay
 
Normalization PRESENTATION
Normalization PRESENTATIONNormalization PRESENTATION
Normalization PRESENTATION
bit allahabad
 
Introduction to-dbms
Introduction to-dbmsIntroduction to-dbms
Introduction to-dbms
Ashish Kumar Agrawal
 
Normalization
NormalizationNormalization
Normalization
Salman Memon
 
Introduction to file systems
Introduction to file systemsIntroduction to file systems
Introduction to file systems
Abadala Ali
 
Library Boot Camp: Basic Cataloging, Part 1
Library Boot Camp: Basic Cataloging, Part 1Library Boot Camp: Basic Cataloging, Part 1
Library Boot Camp: Basic Cataloging, Part 1
Denise Garofalo
 
Free Cataloging Tools
Free Cataloging ToolsFree Cataloging Tools
Free Cataloging Tools
robin fay
 
NCompass Live: Cataloging with RDA
NCompass Live: Cataloging with RDANCompass Live: Cataloging with RDA
NCompass Live: Cataloging with RDA
Nebraska Library Commission
 
Initial proposal for DSpace statistics application
Initial proposal for DSpace statistics applicationInitial proposal for DSpace statistics application
Initial proposal for DSpace statistics application
Federico Paparoni
 
Secrets of the Library Catalog (MARC, metadata, cataloging, RDA)
Secrets of the Library Catalog (MARC, metadata, cataloging, RDA)Secrets of the Library Catalog (MARC, metadata, cataloging, RDA)
Secrets of the Library Catalog (MARC, metadata, cataloging, RDA)
robin fay
 
File organization and introduction of DBMS
File organization and introduction of DBMSFile organization and introduction of DBMS
File organization and introduction of DBMS
VrushaliSolanke
 
File organization in database
File organization in databaseFile organization in database
File organization in database
Afrasiyab Haider
 

What's hot (20)

Normalization: A Workshop for Everybody Pt. 2
Normalization: A Workshop for Everybody Pt. 2Normalization: A Workshop for Everybody Pt. 2
Normalization: A Workshop for Everybody Pt. 2
 
Database: An Introduction
Database: An IntroductionDatabase: An Introduction
Database: An Introduction
 
Ms access
Ms accessMs access
Ms access
 
Fa 4 cse g35-1 dbms
Fa 4 cse g35-1 dbmsFa 4 cse g35-1 dbms
Fa 4 cse g35-1 dbms
 
TThompson_ITCO231_U1_IP
TThompson_ITCO231_U1_IPTThompson_ITCO231_U1_IP
TThompson_ITCO231_U1_IP
 
Cataloging Basics Webinar (NEKLS)
Cataloging Basics Webinar (NEKLS)Cataloging Basics Webinar (NEKLS)
Cataloging Basics Webinar (NEKLS)
 
Cataloging basics
Cataloging basicsCataloging basics
Cataloging basics
 
Normalization PRESENTATION
Normalization PRESENTATIONNormalization PRESENTATION
Normalization PRESENTATION
 
Introduction to-dbms
Introduction to-dbmsIntroduction to-dbms
Introduction to-dbms
 
Normalization
NormalizationNormalization
Normalization
 
Introduction to file systems
Introduction to file systemsIntroduction to file systems
Introduction to file systems
 
Abap dictionary 1
Abap dictionary 1Abap dictionary 1
Abap dictionary 1
 
Library Boot Camp: Basic Cataloging, Part 1
Library Boot Camp: Basic Cataloging, Part 1Library Boot Camp: Basic Cataloging, Part 1
Library Boot Camp: Basic Cataloging, Part 1
 
Free Cataloging Tools
Free Cataloging ToolsFree Cataloging Tools
Free Cataloging Tools
 
NCompass Live: Cataloging with RDA
NCompass Live: Cataloging with RDANCompass Live: Cataloging with RDA
NCompass Live: Cataloging with RDA
 
Initial proposal for DSpace statistics application
Initial proposal for DSpace statistics applicationInitial proposal for DSpace statistics application
Initial proposal for DSpace statistics application
 
MARC21
MARC21MARC21
MARC21
 
Secrets of the Library Catalog (MARC, metadata, cataloging, RDA)
Secrets of the Library Catalog (MARC, metadata, cataloging, RDA)Secrets of the Library Catalog (MARC, metadata, cataloging, RDA)
Secrets of the Library Catalog (MARC, metadata, cataloging, RDA)
 
File organization and introduction of DBMS
File organization and introduction of DBMSFile organization and introduction of DBMS
File organization and introduction of DBMS
 
File organization in database
File organization in databaseFile organization in database
File organization in database
 

Similar to Lecture 7 database

SQL
SQLSQL
Data_base.pptx
Data_base.pptxData_base.pptx
Data_base.pptx
Mohit89650
 
Advanced Database Systems - Presentation 1 with quiz.pptx
Advanced Database Systems - Presentation 1 with quiz.pptxAdvanced Database Systems - Presentation 1 with quiz.pptx
Advanced Database Systems - Presentation 1 with quiz.pptx
EllenGracePorras
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
Danish Mehraj
 
Database Part 2
Database Part 2Database Part 2
Database Part 2
Fizaril Amzari Omar
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introductionHasan Kata
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introductionsanjaychauhan689
 
Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
 
Python programming
Python programmingPython programming
Python programming
Swetha544947
 
Oracle SQL Part1
Oracle SQL Part1Oracle SQL Part1
Oracle SQL Part1
Gurpreet singh
 
Unit 3 rdbms study_materials-converted
Unit 3  rdbms study_materials-convertedUnit 3  rdbms study_materials-converted
Unit 3 rdbms study_materials-converted
gayaramesh
 
RDMS AND SQL
RDMS AND SQLRDMS AND SQL
RDMS AND SQL
milanmehta7
 
Data structures
Data structuresData structures
Data structures
MADHAVASAIYENDUVA
 
Data Never Lies Presentation for beginners in data field.pptx
Data Never Lies Presentation for beginners in data field.pptxData Never Lies Presentation for beginners in data field.pptx
Data Never Lies Presentation for beginners in data field.pptx
TusharAgarwal49094
 
unit-ii.pptx
unit-ii.pptxunit-ii.pptx
unit-ii.pptx
NilamHonmane
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
WrushabhShirsat3
 
Oracle Introduction
Oracle Introduction Oracle Introduction
Oracle Introduction
Mohana Rajendiran
 
Dbmsunit v
Dbmsunit vDbmsunit v
Dbmsunit v
Mohana Rajendiran
 
Sql a practical_introduction
Sql a practical_introductionSql a practical_introduction
Sql a practical_introduction
investnow
 

Similar to Lecture 7 database (20)

SQL
SQLSQL
SQL
 
Data_base.pptx
Data_base.pptxData_base.pptx
Data_base.pptx
 
Advanced Database Systems - Presentation 1 with quiz.pptx
Advanced Database Systems - Presentation 1 with quiz.pptxAdvanced Database Systems - Presentation 1 with quiz.pptx
Advanced Database Systems - Presentation 1 with quiz.pptx
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
Database Part 2
Database Part 2Database Part 2
Database Part 2
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introduction
 
Sql a practical introduction
Sql   a practical introductionSql   a practical introduction
Sql a practical introduction
 
Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)
 
Sql project ..
Sql project ..Sql project ..
Sql project ..
 
Python programming
Python programmingPython programming
Python programming
 
Oracle SQL Part1
Oracle SQL Part1Oracle SQL Part1
Oracle SQL Part1
 
Unit 3 rdbms study_materials-converted
Unit 3  rdbms study_materials-convertedUnit 3  rdbms study_materials-converted
Unit 3 rdbms study_materials-converted
 
RDMS AND SQL
RDMS AND SQLRDMS AND SQL
RDMS AND SQL
 
Data structures
Data structuresData structures
Data structures
 
Data Never Lies Presentation for beginners in data field.pptx
Data Never Lies Presentation for beginners in data field.pptxData Never Lies Presentation for beginners in data field.pptx
Data Never Lies Presentation for beginners in data field.pptx
 
unit-ii.pptx
unit-ii.pptxunit-ii.pptx
unit-ii.pptx
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
 
Oracle Introduction
Oracle Introduction Oracle Introduction
Oracle Introduction
 
Dbmsunit v
Dbmsunit vDbmsunit v
Dbmsunit v
 
Sql a practical_introduction
Sql a practical_introductionSql a practical_introduction
Sql a practical_introduction
 

More from moduledesign

Bm512 b525 t1_s_v002
Bm512 b525 t1_s_v002Bm512 b525 t1_s_v002
Bm512 b525 t1_s_v002
moduledesign
 
Bm512 b525 t5_l_v002
Bm512 b525 t5_l_v002Bm512 b525 t5_l_v002
Bm512 b525 t5_l_v002moduledesign
 
Bm509 b519 t1_l_v002
Bm509 b519 t1_l_v002Bm509 b519 t1_l_v002
Bm509 b519 t1_l_v002
moduledesign
 
Corporate reporting and finance lecture 1
Corporate reporting and finance lecture 1Corporate reporting and finance lecture 1
Corporate reporting and finance lecture 1
moduledesign
 
Af502 b523 t1_l1_v002
Af502 b523 t1_l1_v002Af502 b523 t1_l1_v002
Af502 b523 t1_l1_v002
moduledesign
 
B515 lecture 1 edited_mr
B515 lecture 1 edited_mrB515 lecture 1 edited_mr
B515 lecture 1 edited_mr
moduledesign
 
B502 ethics lecture t005_rf
B502 ethics lecture t005_rfB502 ethics lecture t005_rf
B502 ethics lecture t005_rfmoduledesign
 
B526 ops pm lecture_t001b_with notes
B526 ops pm lecture_t001b_with notesB526 ops pm lecture_t001b_with notes
B526 ops pm lecture_t001b_with notes
moduledesign
 
B526 ops pm lecture_t009_rf
B526 ops pm lecture_t009_rfB526 ops pm lecture_t009_rf
B526 ops pm lecture_t009_rf
moduledesign
 
Pearson principles of business implementing strategy lecture 2
Pearson principles of business implementing strategy lecture 2Pearson principles of business implementing strategy lecture 2
Pearson principles of business implementing strategy lecture 2
moduledesign
 
Generic lecture 4 research design (1)
Generic lecture 4 research design (1)Generic lecture 4 research design (1)
Generic lecture 4 research design (1)
moduledesign
 
Generic lecture 3 literature review tutor
Generic lecture 3 literature review  tutorGeneric lecture 3 literature review  tutor
Generic lecture 3 literature review tutor
moduledesign
 
Generic lecture 2 research proposal student
Generic lecture 2 research proposal studentGeneric lecture 2 research proposal student
Generic lecture 2 research proposal student
moduledesign
 
Tutor version slides seminar 9 implementing knowledge management
Tutor version slides seminar 9 implementing knowledge managementTutor version slides seminar 9 implementing knowledge management
Tutor version slides seminar 9 implementing knowledge management
moduledesign
 
Tutor version slides eminar 2 the nature of knowing
Tutor version slides eminar 2 the nature of knowingTutor version slides eminar 2 the nature of knowing
Tutor version slides eminar 2 the nature of knowing
moduledesign
 
Tutor version slides seminar 10 assignment support
Tutor version slides seminar 10 assignment supportTutor version slides seminar 10 assignment support
Tutor version slides seminar 10 assignment support
moduledesign
 
Tutor version slides seminar 5 the learning organisation
Tutor version slides seminar 5 the learning organisationTutor version slides seminar 5 the learning organisation
Tutor version slides seminar 5 the learning organisation
moduledesign
 
Tutor version slides seminar 1 introduction to knowledge management
Tutor version slides seminar 1 introduction to knowledge managementTutor version slides seminar 1 introduction to knowledge management
Tutor version slides seminar 1 introduction to knowledge management
moduledesign
 
Tutor version slides seminar 4 organisational learning
Tutor version slides seminar 4 organisational learningTutor version slides seminar 4 organisational learning
Tutor version slides seminar 4 organisational learning
moduledesign
 
Tutor version slides seminar 7 digital knowledge managment
Tutor version slides seminar 7 digital knowledge managment Tutor version slides seminar 7 digital knowledge managment
Tutor version slides seminar 7 digital knowledge managment
moduledesign
 

More from moduledesign (20)

Bm512 b525 t1_s_v002
Bm512 b525 t1_s_v002Bm512 b525 t1_s_v002
Bm512 b525 t1_s_v002
 
Bm512 b525 t5_l_v002
Bm512 b525 t5_l_v002Bm512 b525 t5_l_v002
Bm512 b525 t5_l_v002
 
Bm509 b519 t1_l_v002
Bm509 b519 t1_l_v002Bm509 b519 t1_l_v002
Bm509 b519 t1_l_v002
 
Corporate reporting and finance lecture 1
Corporate reporting and finance lecture 1Corporate reporting and finance lecture 1
Corporate reporting and finance lecture 1
 
Af502 b523 t1_l1_v002
Af502 b523 t1_l1_v002Af502 b523 t1_l1_v002
Af502 b523 t1_l1_v002
 
B515 lecture 1 edited_mr
B515 lecture 1 edited_mrB515 lecture 1 edited_mr
B515 lecture 1 edited_mr
 
B502 ethics lecture t005_rf
B502 ethics lecture t005_rfB502 ethics lecture t005_rf
B502 ethics lecture t005_rf
 
B526 ops pm lecture_t001b_with notes
B526 ops pm lecture_t001b_with notesB526 ops pm lecture_t001b_with notes
B526 ops pm lecture_t001b_with notes
 
B526 ops pm lecture_t009_rf
B526 ops pm lecture_t009_rfB526 ops pm lecture_t009_rf
B526 ops pm lecture_t009_rf
 
Pearson principles of business implementing strategy lecture 2
Pearson principles of business implementing strategy lecture 2Pearson principles of business implementing strategy lecture 2
Pearson principles of business implementing strategy lecture 2
 
Generic lecture 4 research design (1)
Generic lecture 4 research design (1)Generic lecture 4 research design (1)
Generic lecture 4 research design (1)
 
Generic lecture 3 literature review tutor
Generic lecture 3 literature review  tutorGeneric lecture 3 literature review  tutor
Generic lecture 3 literature review tutor
 
Generic lecture 2 research proposal student
Generic lecture 2 research proposal studentGeneric lecture 2 research proposal student
Generic lecture 2 research proposal student
 
Tutor version slides seminar 9 implementing knowledge management
Tutor version slides seminar 9 implementing knowledge managementTutor version slides seminar 9 implementing knowledge management
Tutor version slides seminar 9 implementing knowledge management
 
Tutor version slides eminar 2 the nature of knowing
Tutor version slides eminar 2 the nature of knowingTutor version slides eminar 2 the nature of knowing
Tutor version slides eminar 2 the nature of knowing
 
Tutor version slides seminar 10 assignment support
Tutor version slides seminar 10 assignment supportTutor version slides seminar 10 assignment support
Tutor version slides seminar 10 assignment support
 
Tutor version slides seminar 5 the learning organisation
Tutor version slides seminar 5 the learning organisationTutor version slides seminar 5 the learning organisation
Tutor version slides seminar 5 the learning organisation
 
Tutor version slides seminar 1 introduction to knowledge management
Tutor version slides seminar 1 introduction to knowledge managementTutor version slides seminar 1 introduction to knowledge management
Tutor version slides seminar 1 introduction to knowledge management
 
Tutor version slides seminar 4 organisational learning
Tutor version slides seminar 4 organisational learningTutor version slides seminar 4 organisational learning
Tutor version slides seminar 4 organisational learning
 
Tutor version slides seminar 7 digital knowledge managment
Tutor version slides seminar 7 digital knowledge managment Tutor version slides seminar 7 digital knowledge managment
Tutor version slides seminar 7 digital knowledge managment
 

Recently uploaded

Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 

Recently uploaded (20)

Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 

Lecture 7 database

  • 1. App Design for Business Topic: Database Topic Number: 7
  • 2. Key topics / learning outcomes of this lecture • Database use within an Android App; • Learn the concept of creating an SQLite Database; • A look at SQL (Structured Query Language); 2
  • 3. What is a database? B4004A L1 3
  • 4. Different types of Database B4004A L1 4
  • 5. Android Database The database used with Android is called SQLite. This database is a trimmed down version of MySQL, PostgreSQL and other similar databases. B4004A L1 5
  • 6. SqLite Android Database • it is a relational database; • SQLite was originally designed for defence purposes; • it has no administrator; • it uses less data types than other typical relational databases: – int: a signed integer; – real: a floating-point number; – text: a text string; – blob: a ‘blob’ of data; • It is ‘shipped’ with Android: – Each APP has its own SQLite database. B4004A L1 6
  • 7. Usual steps to design a database • Create a Data dictionary – List all the data terms, • example: name, address, postcode; – Allocate a data type to the field • example: the _id field has a data type of int; • Create an Input/Output list – identify all inputs and outputs, • example: input name, address, postcode • example: output list of all address in postcode W1. B4004A L1 7
  • 8. Usual steps to design a database • Identify Entities – list relationships • one to one • one to many • many to many • List attributes – their data type; – their default value; • Normalize – reduce duplication of data storage • create new tables to reduce duplication of fields; • Add keys – primary key – foreign keys B4004A L1 8
  • 9. Data Flow Diagrams • Once all the information gathering is complete, a database design is moved on to the drawing stage; • The first drawing will be very concise, almost like a ‘birds eye view’ of the database, usually named a Context drawing; • Each section of the Context drawing will be expanded level by level until the detail is exhausted, therefore no more detailed level may be reached. B4004A L1 9
  • 11. An Example of a Data Flow Diagram Source: http://conta11.my3gb.com/examlpe-of-data-flow-diagram.html B4004A L1 11
  • 12. An example of database tables together with their relationships Source: http://carlibrary.org/CarDatabases.htm B4004A L1 12
  • 13. Databases comprise of … • Tables – Usually a database will contain more than one table: – example PERSON, PERSON_ADDRESS. • Fields – Fields are ‘table columns’ with a heading and column content • Records – are ‘table rows’ with an ‘id’ and row content B4004A L1 13
  • 14. … a closer look at databases … B4004A L1 14
  • 15. A table within a Database _id Name Password 1 Pearson 123 2 John abcd 3 Viz 5678 This table will have a name, for example: PERSON B4004A L1 15 This database will have a name, for example: ADDRESS_BOOK
  • 16. Relational Tables address_id Address _id 1 1 Smith Street 2 2 80 Strand 1 3 6 Jones Square 3 _id Name Password 1 Pearson 123 2 John abcd 3 Viz 5678 This table will have a name, for example: PERSON B4004A L1 16 This table will have a name, for example: PERSON_ADDRESS
  • 17. Relational Tables addres s_id Address Address_Type _id 1 1 Smith Street Halls of Residence 2 2 80 Strand Office 1 3 6 Jones Square Private Rented 3 4 2 The Farmhouse Home 2 _id Name Password 1 Pearson 123 2 John abcd 3 Viz 5678 This table will have a name, for example: PERSON B4004A L1 17 This table will have a name, for example: PERSON_ADDRESS
  • 18. Relational Tables addres s_id Address Address_Type _id 1 1 Smith Street Halls of Residence 2 2 80 Strand Office 1 3 6 Jones Square Private Rented 3 4 2 The Farmhouse Home 2 _id Name Password 1 Pearson 123 2 John abcd 3 Viz 5678 Foreign Key B4004A L1 18 Primary Key Fields (Columns) Records (Rows)
  • 19. Use SQL to access data, for example SQL Syntax SELECT * FROM PERSON INNER JOIN PERSON_ADDRESS ON PERSON._id = PERSON_ADDRESS._id WHERE PERSON.Name=John; B4004A L1 19 SELECT column_name(s) FROM table1 INNER JOIN table2 ON table1.column_name=table2.column_name WHERE table1.column_name= ? ; Actual SQL derived from the syntax
  • 20. More SQL (Structured Query Language) Resources • SQL is a standard database protocol: – adopted by most ‘relational’ databases; • Provides syntax for interaction with databases; • For more info, visit W3schools for their tutorial on SQL: – here you will find all the SQL syntax needed to interact with your database. http://www.w3schools.com/sql B4004A L1 20
  • 21. Seminar • In the seminar for this lecture, you will be copying and pasting code into IntelliJ and running a database. • You will be making some changes to the fields and tables to learn how you may tailor the database to suit a different application. B4004A L1 21
  • 22. Workshop • In the workshop for this lecture, you will be viewing a series of tutorials explaining more about SQLite. B4004A L1 22
  • 23. Essential work for next week • Please consult the OLE for details of: – Essential readings* – Seminar/workshop preparation work* – Recommended further readings – Any additional learning * Essential readings and preparation work must always be completed in time for the next session 23
  • 24. End of presentation © Pearson College 2013