SlideShare a Scribd company logo
1 of 5
Introduction:
Databases:
Databasesare an organized collectionof logicallyrelated data, whichcanbe easilyaccessedand
manipulatedusingadatabase systemmanager.There existseveral modelsof databases,most
notablyrelational databases.
Relational databases:
Relational databasesare databasesbasedonrelational model.Virtuallyall relational database
systemsuse SQL(StructuredQueryLanguage) formaintainingdatabases.
Relational model:
Relational model organisesdataintoa one or more tables,a table ismade of columnsand rows.
Each row is calledarecord andis identifiedbyaunique key.Columnsare calledattributes.Inmost
cases,a table representsone entitytype,forexample:Client,whererowsare the instancesof that
type for example:Ali.
DBMS (Database management system):
DBMS iscomputersoftware thatinteractswithend-users(anenduserissomeone whousesa
productor intendsto,opposite tothose whomaintainorsupportit.) Theyare basedondatabase
modelsbutall of themsupportrelational databases since1980. There existmanyDBMS but the most
popularsystemsare Oracle,MySQL,MicrosoftSQL server.
SQL (Structured Query Language):
SQL is domain-specificlanguage (alanguage that’susedinaspecificapplication,contrarytoa
general-purpose programminglanguages) usedinprogrammingandin relational databases
managementsystems.
SQL was originallybasedonrelationalalgebraand tuple relational calculus.SQLis divided intothree
mainelements(some people classifythemassublanguages)
Data Query Language (DQL): isusedto make queriesindatabase.
Data DefinitionLanguage (DDL): isusedto create and delete ormodifydatabasesandtables
Data control language (DCL): isusedto control access(permissions) todatastoredindatabases.
Data manipulationlanguage (DML):Is usedto insert,deleteandmodifying(updating) dataina
database
MySQL:
MySQL is an opensource Relational Database ManagementSystem,itwasownedandsponsoredby
MySQL AB, and nowisownedbyOracle.Several paid versionsexistwhich offeradditional
functionalities. ItiswidelyusedinmanybigwebsitessuchasGoogle,Facebook,Twitterand
YouTube.
MySQL supported types:
 TINYINT.
 SMALLINT.
 MEDIUMINT.
 INT or INTEGER.
 BIGINT.
 FLOAT.
 DOUBLE, DOUBLE PRECISION,REAL: DECIMAL, NUMERIC.
 DATE.
 DATETIME.
 TIMESTAMP.
 TIME.
 YEAR.
 CHAR.
 VARCHAR.
 TINYBLOB,TINYTEXT.
 BLOB, TEXT.
 MEDIUMBLOB, MEDIUMTEXT.
 LONGBLOB,LONGTEXT.
 ENUM.
 SET.
Advantages of MySQL:
 Easy to workwith:
o MySQL can be installedveryeasily.
 Feature rich:
o MySQL supportsa lot of SQL functionalities
 Data security:
o It isknownto be most secure andreliable database managementsystem.
 Scalability:
o MySQL can handle alotof data efficiently.
 Speed:
o MySQL is knownforitsspeedandefficientwork.
Disadvantage of MySQL:
 MySQL lack some featuresthatsome applicationmayrequire( itwasnot intendedtodo
everything)
 Stagnateddevelopment: MySQLisstill anopen-source,buthasnotmuch improvedsince its
acquisition.
When touse MYSQL:
Highsecurity: whenyouneedhighsecuritytoprotectyourdata bases,mysql can offeravery
reliable protectionfordata-accessinasimple way.
When not to use MySQL:
Concurrency: AlthoughMySQLperformreallywell withreadoperations,concurrentread-write
operationscanbe problematic.
Lack of features: Since MySQL doesn’timplementfullSQLstandards,itlackssome feature thatyour
applicationmayneed.
SQLite:
A verypowerful embedded Relational DatabasesManagementSystem.ContrarytootherRDBMS,
SQLite isnot a client-serverDatabase engine. Butisinstead,embeddedintothe endapplication.
SQLite isverypopularchoice as an embedded-database adatabase whichisintegrateddirectlyinto
an applicationthatrequiresaccesstostoreddata,and ishiddenfromthe applicationuser) for
embedded systemssuchasmobile phones,SQLite isknowntobe efficientandfastdue to its
integrationdirectlyinthe application,itoffersavaried setof toolstohandle all sortof data with
much lessconstraints andease comparedtohosted,serverbaseddatabases.
SQLite supportedtypes:
 NULL.
 INTEGER.
 REAL.
 TEXT.
 BLOB.
Advantage of SQLite:
File based:the data consistsof one single file storedonthe disk,whichmakesitextremelyportable
and easyto use.
Lightweight: SQLite isverylightweightdatabase whichcanusedinembeddedsystemslike Mobile
phones,TV,cameras .
Better performance: readingandwritingdata isveryfast inSQLite. Itonlyloadsdata it needsrather
than loadingthe whole file inmemory. Onlypartsthatare changedwill be overwritten.
No installationneeded: youjustneedtodownloadthe libraryandyouare readyto go.
Reliable: itcontinuouslyupdatescontent,notmuchworkislostdue to powerfailure orcrash.
Portable: it’sportable acrossall OS,and differentplatforms. Itcanalsobe usedwith many
programminglanguage withoutanycomputabilityissues.
Accessible: SQLite isaccessible throughwide varietyof thirdpartytools.
Reduce cost and complexity:Contentcanbe accessedand updatedeasily usingSQLqueries. Itcan
be easilyextendedjustbyaddingacolumn or two,andalso preserve backwardcompatibility
SQLite disadvantage:
 Most databasesare limitedto2GB.
 Cannothandle highhttptraffic.
When touse SQLite?
Embeddedapplications: all applicationsthat needportability,anddonotrequire extensionlike
mobile applications
Disk access replacement:applicationsthatwrite/readfilesinto/fromdiskdirectlycanswitchto
SQLite andbenefice fromthe functionalitiesandsimplicitythatSQLoffers.
Testing.
When not to use SQLite?
Workingan applicationwhere manyusersaccessto the same database at the same time,
Applicationsrequiringhighwriting volume:SQLite doesallow onlyone singlewrite operationatthe
same time (file locking).
Case study: Inserting username and password into
database.
Describingthe scheme of table “Login”:
private static final String createTable= "Create table if not exists
"+Clients.TABLE_NAME+" ( "+ Clients.ID + " integer PRIMARY KEY
AUTOINCREMENT,"+Clients.USER_COLUMN+ " text,"
+ Clients.PASS_COLUMN+ " text)";
Usingof static class DataBaseHelper to which is a subclass of SQLiteOpenHelpertohelpus manage
database (creating and upgrading database),then usingan objectof this subclassto insert, delete
and other operations.
private static class DataBaseHelper extends SQLiteOpenHelper{
Context context;
public DataBaseHelper(Context context){
super(context, DBName, null, DBVersion);
this.context = context;
}
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
sqLiteDatabase.execSQL(createTable);
}
We useda helperclass calledDBManger to manage all SQL queries: UsingmyDataBaseHelper
Object(instance ofDataBaseHelper) to create a WritableDatabase.
public DBManager(Context context){
myDataBaseHelper = new DataBaseHelper(context);
SQLdb = myDataBaseHelper.getWritableDatabase();
}
Performinginsertquery on the database.
public long insert(ContentValues values){
return SQLdb.insert(Clients.TABLE_NAME, "", values);
}
Insert iscalled from the mainActivity :
ContentValues values = new ContentValues();
values.put(DBManager.Clients.USER_COLUMN, usernameString);
values.put(DBManager.Clients.PASS_COLUMN, passwordString);
id = myDBManager.insert(values);

More Related Content

What's hot

WEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETWEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETDhruvVekariya3
 
Comparative study of no sql document, column store databases and evaluation o...
Comparative study of no sql document, column store databases and evaluation o...Comparative study of no sql document, column store databases and evaluation o...
Comparative study of no sql document, column store databases and evaluation o...ijdms
 
Advantage & Disadvantage of MySQL
Advantage & Disadvantage of MySQLAdvantage & Disadvantage of MySQL
Advantage & Disadvantage of MySQLKentAnderson43
 
Heterogeneous databases
Heterogeneous databasesHeterogeneous databases
Heterogeneous databasesravikamma26
 
A Comparison between Relational Databases and NoSQL Databases
A Comparison between Relational Databases and NoSQL DatabasesA Comparison between Relational Databases and NoSQL Databases
A Comparison between Relational Databases and NoSQL Databasesijtsrd
 
Introduction to database with ms access.hetvii
Introduction to database with ms access.hetviiIntroduction to database with ms access.hetvii
Introduction to database with ms access.hetvii07HetviBhagat
 
Introduction4 SQLite
Introduction4 SQLiteIntroduction4 SQLite
Introduction4 SQLiteStanley Huang
 
NoSQL-Database-Concepts
NoSQL-Database-ConceptsNoSQL-Database-Concepts
NoSQL-Database-ConceptsBhaskar Gunda
 
Brief introduction to NoSQL by fas mosleh
Brief introduction to NoSQL by fas moslehBrief introduction to NoSQL by fas mosleh
Brief introduction to NoSQL by fas moslehFas (Feisal) Mosleh
 
11g architecture
11g architecture11g architecture
11g architectureManohar Jha
 
Asp.net interview questions
Asp.net interview questionsAsp.net interview questions
Asp.net interview questionsAkhil Mittal
 
History of database processing module 1 (2)
History of database processing module 1 (2)History of database processing module 1 (2)
History of database processing module 1 (2)chottu89
 
Kaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions PresentationKaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions Presentationkaashiv1
 

What's hot (19)

WEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NETWEB PROGRAMMING USING ASP.NET
WEB PROGRAMMING USING ASP.NET
 
DBMS Practical File
DBMS Practical FileDBMS Practical File
DBMS Practical File
 
Comparative study of no sql document, column store databases and evaluation o...
Comparative study of no sql document, column store databases and evaluation o...Comparative study of no sql document, column store databases and evaluation o...
Comparative study of no sql document, column store databases and evaluation o...
 
Mysql
MysqlMysql
Mysql
 
Advantage & Disadvantage of MySQL
Advantage & Disadvantage of MySQLAdvantage & Disadvantage of MySQL
Advantage & Disadvantage of MySQL
 
SQLite - Overview
SQLite - OverviewSQLite - Overview
SQLite - Overview
 
Heterogeneous databases
Heterogeneous databasesHeterogeneous databases
Heterogeneous databases
 
A Comparison between Relational Databases and NoSQL Databases
A Comparison between Relational Databases and NoSQL DatabasesA Comparison between Relational Databases and NoSQL Databases
A Comparison between Relational Databases and NoSQL Databases
 
Sql server
Sql serverSql server
Sql server
 
Introduction to database with ms access.hetvii
Introduction to database with ms access.hetviiIntroduction to database with ms access.hetvii
Introduction to database with ms access.hetvii
 
Introduction4 SQLite
Introduction4 SQLiteIntroduction4 SQLite
Introduction4 SQLite
 
NoSQL-Database-Concepts
NoSQL-Database-ConceptsNoSQL-Database-Concepts
NoSQL-Database-Concepts
 
Brief introduction to NoSQL by fas mosleh
Brief introduction to NoSQL by fas moslehBrief introduction to NoSQL by fas mosleh
Brief introduction to NoSQL by fas mosleh
 
11g architecture
11g architecture11g architecture
11g architecture
 
Asp.net interview questions
Asp.net interview questionsAsp.net interview questions
Asp.net interview questions
 
History of database processing module 1 (2)
History of database processing module 1 (2)History of database processing module 1 (2)
History of database processing module 1 (2)
 
Creating database
Creating databaseCreating database
Creating database
 
Kaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions PresentationKaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions Presentation
 
Nosql
NosqlNosql
Nosql
 

Similar to Android project (1)

Similar to Android project (1) (20)

Rise of NewSQL
Rise of NewSQLRise of NewSQL
Rise of NewSQL
 
1. introduction to no sql
1. introduction to no sql1. introduction to no sql
1. introduction to no sql
 
Database
DatabaseDatabase
Database
 
DATABASE MANAGEMENT SYSTEM-MRS. LAXMI B PANDYA FOR 25TH AUGUST,2022.pptx
DATABASE MANAGEMENT SYSTEM-MRS. LAXMI B PANDYA FOR 25TH AUGUST,2022.pptxDATABASE MANAGEMENT SYSTEM-MRS. LAXMI B PANDYA FOR 25TH AUGUST,2022.pptx
DATABASE MANAGEMENT SYSTEM-MRS. LAXMI B PANDYA FOR 25TH AUGUST,2022.pptx
 
No Sql Databases
No Sql DatabasesNo Sql Databases
No Sql Databases
 
data base system to new data science lerne
data base system to new data science lernedata base system to new data science lerne
data base system to new data science lerne
 
DBMS PART 1.docx
DBMS PART 1.docxDBMS PART 1.docx
DBMS PART 1.docx
 
Whitepaper tableau for-the-enterprise-0
Whitepaper tableau for-the-enterprise-0Whitepaper tableau for-the-enterprise-0
Whitepaper tableau for-the-enterprise-0
 
Database Management Systems
Database Management SystemsDatabase Management Systems
Database Management Systems
 
SQL ARPIT YADAV.pptx
SQL ARPIT YADAV.pptxSQL ARPIT YADAV.pptx
SQL ARPIT YADAV.pptx
 
Data management in cloud study of existing systems and future opportunities
Data management in cloud study of existing systems and future opportunitiesData management in cloud study of existing systems and future opportunities
Data management in cloud study of existing systems and future opportunities
 
Database Management Systems
Database Management SystemsDatabase Management Systems
Database Management Systems
 
DBMS Notes.pdf
DBMS Notes.pdfDBMS Notes.pdf
DBMS Notes.pdf
 
Database management system
Database management systemDatabase management system
Database management system
 
SQL_Introduction_Updated.pptx
SQL_Introduction_Updated.pptxSQL_Introduction_Updated.pptx
SQL_Introduction_Updated.pptx
 
Project seminar
Project seminarProject seminar
Project seminar
 
Introduction to Data Management
Introduction to Data ManagementIntroduction to Data Management
Introduction to Data Management
 
jose rizal
jose rizaljose rizal
jose rizal
 
MySQL.pptx
MySQL.pptxMySQL.pptx
MySQL.pptx
 
Bt0066 database management system1
Bt0066 database management system1Bt0066 database management system1
Bt0066 database management system1
 

Recently uploaded

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Android project (1)

  • 1. Introduction: Databases: Databasesare an organized collectionof logicallyrelated data, whichcanbe easilyaccessedand manipulatedusingadatabase systemmanager.There existseveral modelsof databases,most notablyrelational databases. Relational databases: Relational databasesare databasesbasedonrelational model.Virtuallyall relational database systemsuse SQL(StructuredQueryLanguage) formaintainingdatabases. Relational model: Relational model organisesdataintoa one or more tables,a table ismade of columnsand rows. Each row is calledarecord andis identifiedbyaunique key.Columnsare calledattributes.Inmost cases,a table representsone entitytype,forexample:Client,whererowsare the instancesof that type for example:Ali. DBMS (Database management system): DBMS iscomputersoftware thatinteractswithend-users(anenduserissomeone whousesa productor intendsto,opposite tothose whomaintainorsupportit.) Theyare basedondatabase modelsbutall of themsupportrelational databases since1980. There existmanyDBMS but the most popularsystemsare Oracle,MySQL,MicrosoftSQL server. SQL (Structured Query Language): SQL is domain-specificlanguage (alanguage that’susedinaspecificapplication,contrarytoa general-purpose programminglanguages) usedinprogrammingandin relational databases managementsystems. SQL was originallybasedonrelationalalgebraand tuple relational calculus.SQLis divided intothree mainelements(some people classifythemassublanguages) Data Query Language (DQL): isusedto make queriesindatabase. Data DefinitionLanguage (DDL): isusedto create and delete ormodifydatabasesandtables Data control language (DCL): isusedto control access(permissions) todatastoredindatabases. Data manipulationlanguage (DML):Is usedto insert,deleteandmodifying(updating) dataina database
  • 2. MySQL: MySQL is an opensource Relational Database ManagementSystem,itwasownedandsponsoredby MySQL AB, and nowisownedbyOracle.Several paid versionsexistwhich offeradditional functionalities. ItiswidelyusedinmanybigwebsitessuchasGoogle,Facebook,Twitterand YouTube. MySQL supported types:  TINYINT.  SMALLINT.  MEDIUMINT.  INT or INTEGER.  BIGINT.  FLOAT.  DOUBLE, DOUBLE PRECISION,REAL: DECIMAL, NUMERIC.  DATE.  DATETIME.  TIMESTAMP.  TIME.  YEAR.  CHAR.  VARCHAR.  TINYBLOB,TINYTEXT.  BLOB, TEXT.  MEDIUMBLOB, MEDIUMTEXT.  LONGBLOB,LONGTEXT.  ENUM.  SET. Advantages of MySQL:  Easy to workwith: o MySQL can be installedveryeasily.  Feature rich: o MySQL supportsa lot of SQL functionalities  Data security: o It isknownto be most secure andreliable database managementsystem.  Scalability: o MySQL can handle alotof data efficiently.  Speed: o MySQL is knownforitsspeedandefficientwork. Disadvantage of MySQL:  MySQL lack some featuresthatsome applicationmayrequire( itwasnot intendedtodo everything)
  • 3.  Stagnateddevelopment: MySQLisstill anopen-source,buthasnotmuch improvedsince its acquisition. When touse MYSQL: Highsecurity: whenyouneedhighsecuritytoprotectyourdata bases,mysql can offeravery reliable protectionfordata-accessinasimple way. When not to use MySQL: Concurrency: AlthoughMySQLperformreallywell withreadoperations,concurrentread-write operationscanbe problematic. Lack of features: Since MySQL doesn’timplementfullSQLstandards,itlackssome feature thatyour applicationmayneed. SQLite: A verypowerful embedded Relational DatabasesManagementSystem.ContrarytootherRDBMS, SQLite isnot a client-serverDatabase engine. Butisinstead,embeddedintothe endapplication. SQLite isverypopularchoice as an embedded-database adatabase whichisintegrateddirectlyinto an applicationthatrequiresaccesstostoreddata,and ishiddenfromthe applicationuser) for embedded systemssuchasmobile phones,SQLite isknowntobe efficientandfastdue to its integrationdirectlyinthe application,itoffersavaried setof toolstohandle all sortof data with much lessconstraints andease comparedtohosted,serverbaseddatabases. SQLite supportedtypes:  NULL.  INTEGER.  REAL.  TEXT.  BLOB. Advantage of SQLite: File based:the data consistsof one single file storedonthe disk,whichmakesitextremelyportable and easyto use. Lightweight: SQLite isverylightweightdatabase whichcanusedinembeddedsystemslike Mobile phones,TV,cameras . Better performance: readingandwritingdata isveryfast inSQLite. Itonlyloadsdata it needsrather than loadingthe whole file inmemory. Onlypartsthatare changedwill be overwritten. No installationneeded: youjustneedtodownloadthe libraryandyouare readyto go. Reliable: itcontinuouslyupdatescontent,notmuchworkislostdue to powerfailure orcrash. Portable: it’sportable acrossall OS,and differentplatforms. Itcanalsobe usedwith many programminglanguage withoutanycomputabilityissues.
  • 4. Accessible: SQLite isaccessible throughwide varietyof thirdpartytools. Reduce cost and complexity:Contentcanbe accessedand updatedeasily usingSQLqueries. Itcan be easilyextendedjustbyaddingacolumn or two,andalso preserve backwardcompatibility SQLite disadvantage:  Most databasesare limitedto2GB.  Cannothandle highhttptraffic. When touse SQLite? Embeddedapplications: all applicationsthat needportability,anddonotrequire extensionlike mobile applications Disk access replacement:applicationsthatwrite/readfilesinto/fromdiskdirectlycanswitchto SQLite andbenefice fromthe functionalitiesandsimplicitythatSQLoffers. Testing. When not to use SQLite? Workingan applicationwhere manyusersaccessto the same database at the same time, Applicationsrequiringhighwriting volume:SQLite doesallow onlyone singlewrite operationatthe same time (file locking). Case study: Inserting username and password into database. Describingthe scheme of table “Login”: private static final String createTable= "Create table if not exists "+Clients.TABLE_NAME+" ( "+ Clients.ID + " integer PRIMARY KEY AUTOINCREMENT,"+Clients.USER_COLUMN+ " text," + Clients.PASS_COLUMN+ " text)"; Usingof static class DataBaseHelper to which is a subclass of SQLiteOpenHelpertohelpus manage database (creating and upgrading database),then usingan objectof this subclassto insert, delete and other operations. private static class DataBaseHelper extends SQLiteOpenHelper{ Context context; public DataBaseHelper(Context context){ super(context, DBName, null, DBVersion); this.context = context; } @Override public void onCreate(SQLiteDatabase sqLiteDatabase) { sqLiteDatabase.execSQL(createTable); }
  • 5. We useda helperclass calledDBManger to manage all SQL queries: UsingmyDataBaseHelper Object(instance ofDataBaseHelper) to create a WritableDatabase. public DBManager(Context context){ myDataBaseHelper = new DataBaseHelper(context); SQLdb = myDataBaseHelper.getWritableDatabase(); } Performinginsertquery on the database. public long insert(ContentValues values){ return SQLdb.insert(Clients.TABLE_NAME, "", values); } Insert iscalled from the mainActivity : ContentValues values = new ContentValues(); values.put(DBManager.Clients.USER_COLUMN, usernameString); values.put(DBManager.Clients.PASS_COLUMN, passwordString); id = myDBManager.insert(values);