SlideShare ist ein Scribd-Unternehmen logo
1 von 32
CGS 2835 Interdisciplinary Web Development
Web
Database
Useful
Web Apps
+
CGS 2835 Interdisciplinary Web Development
The Value of Databases
• Databases and Database Management Systems (DBMS)
transform large quantities of data into specific and
valuable information for accomplishing some goal.
CGS 2835 Interdisciplinary Web Development
AMP
•Apache – open source Web server
•MySQL – open source database
•PHP – programming language that
works in HTML to provide
interactivity with MySQL
CGS 2835 Interdisciplinary Web Development
Database
Server
Web
ServerHTML REQUEST w/DATAHTML REQUEST w/DATA
SQL CommandSQL Command
PHP
CGS 2835 Interdisciplinary Web Development
Database
Server
Web
Server
PHP
data
PHP-created HTML
CGS 2835 Interdisciplinary Web Development
MySQL
Database
Server
PHPdata
PHP-created HTML
SQLSQL
Our Focus
CGS 2835 Interdisciplinary Web Development
Databases
CGS 2835 Interdisciplinary Web Development
File or Table
Database
• A collection of data organized to meet user’s
needs.
Records
(Entities)
Field
(Attribute)
CGS 2835 Interdisciplinary Web Development
Database Fields
• Fields are set to hold
specific types of data.
CGS 2835 Interdisciplinary Web Development
Database
A Database
is a
collection of
files/tables
CGS 2835 Interdisciplinary Web Development
Database Heirarchy
Table
CGS 2835 Interdisciplinary Web Development
Keys and Primary Key
• Key: A field in a record that is used to identify
the record
• Primary key: A field that uniquely identifies a
record
– A primary key field prevents duplicate records
from occurring in a table.
CGS 2835 Interdisciplinary Web Development
Primary Keys
• User identification number
• Sometimes email addresses are used as a unique
login, assuming two people cannot have the same
email
• A number is faster to look up, so a unique number
is often still generated
CGS 2835 Interdisciplinary Web Development
Primary Key
CGS 2835 Interdisciplinary Web Development
The Relational Model
• In a relational database, tables are linked (related) through
common fields.
• This can remove redundant data, and organize information
CGS 2835 Interdisciplinary Web Development
“Flat” database
userID First Name Last Name Email, …, … Message
1 Geo Miller …, … , … Hello!
2 Ken Baldauf …, … , … Greetings, how
are you?
1 Geo Miller …, … , … Doing well
2 Ken Baldauf ……, … , … Great!
The Relational Model
CGS 2835 Interdisciplinary Web Development
“Relational”
databaseuserID First
Name
Last
Name
Email, …,
…
1 Geo Miller …, … , …
2 Ken Baldauf …, … , …
The Relational Model
userID Message
1 Hello!
2 Greetings, how
are you?
1 Doing well
2 Great!
CGS 2835 Interdisciplinary Web Development
Relation Types
• One-to-many
– Makes use of primary key
– Example: one person makes
many posts
• One-to-one
– A piece of data only relating to one
record
• Many-to-many
– An item can have many sellers
and sellers can sell that item
many times
CGS 2835 Interdisciplinary Web Development
MySQL
An open-source, relational database
CGS 2835 Interdisciplinary Web Development
MySQL - Installing
• Some servers require an administrator to install
• On your own machine, there are installation packages for
AMP
• On Codio:
– parts install mysql
– parts start mysql
• On many linux distributions:
– apt-get install mysql-server
– service mysql start
CGS 2835 Interdisciplinary Web Development
MySQL – Creating a Database
Creating a database in MySQL is traditionally done with a terminal that has
administrator access to the MySQL server.
CREATE DATABASE IF NOT EXISTS “databasename”
A MySQL user must be created and given access to use the new database
CREATE USER IF NOT EXISTS “username”
SET PASSWORD FOR “username”=PASSWORD(“password”)
GRANT ALL PRIVILEGES ON “databasename” TO “username”
IDENTIFIED BY “password”
CGS 2835 Interdisciplinary Web Development
phpMyAdmin
is a popular application
for managing mySQL
databases.
Here you can click a
database name to access
its properties and tools.
Note that whenever
prompted for charset or
collation select UTF-8
Unicode (utf8).
CGS 2835 Interdisciplinary Web Development
Access MySQL Database
We will use phpMyAdmin
to:
•Create tables in databases
•Create fields in the tables
•Manage the database
•Examine table data
We will use PHP to:
• Enter records into tables
from HTML forms
• Read records from tables
and output to HTML pages
CGS 2835 Interdisciplinary Web Development
When I click my database link in phpMyAdmin, I am prompted to create a table.
CGS 2835 Interdisciplinary Web Development
Then I create fields for my table.
CGS 2835 Interdisciplinary Web Development
I can then use the
Insert tab to enter
records into the table.
CGS 2835 Interdisciplinary Web Development
CGS 2835 Interdisciplinary Web Development
The browse buttons allows you to view the contents of the table.
CGS 2835 Interdisciplinary Web Development
CGS 2835 Interdisciplinary Web Development
You can also run SQL
queries on your data from
within phpMyAdmin.
CGS 2835 Interdisciplinary Web Development
MySQL & phpMyAdmin
• phpMyAdmin is a useful tool for manipulating mySQL
databases; however, in order to work with Web-generated
data, the mySQL database must be accessed from the HTML
code using PHP.
MySQL
Database
Server
SQLSQLSQLSQL
PHP
CGS 2835 Interdisciplinary Web Development
MySQL & phpMyAdmin
• Either method of interacting with the database
requires knowledge of SQL
MySQL
Database
Server
SQLSQLSQLSQL
PHP

Weitere ähnliche Inhalte

Was ist angesagt?

Do Logic Apps support error handling?
Do Logic Apps support error handling?Do Logic Apps support error handling?
Do Logic Apps support error handling?BizTalk360
 
Tech talk live share extras extension modules feb 13
Tech talk live   share extras extension modules feb 13Tech talk live   share extras extension modules feb 13
Tech talk live share extras extension modules feb 13Alfresco Software
 
Tech talk-live-alfresco-drupal
Tech talk-live-alfresco-drupalTech talk-live-alfresco-drupal
Tech talk-live-alfresco-drupalAlfresco Software
 
Wai yanleunglinktag
Wai yanleunglinktagWai yanleunglinktag
Wai yanleunglinktagwaiyanleung
 
Brian Campo, DoD JCS, Content.gov Presentation
Brian Campo, DoD JCS, Content.gov PresentationBrian Campo, DoD JCS, Content.gov Presentation
Brian Campo, DoD JCS, Content.gov PresentationAlfresco Software
 
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
#3 Hanoi Magento Meetup - Part 3: Magento Website OptimizationHanoi MagentoMeetup
 
Azure dboptions maniacs_nerdzao2802
Azure dboptions maniacs_nerdzao2802Azure dboptions maniacs_nerdzao2802
Azure dboptions maniacs_nerdzao2802Marcelo Adade
 
Speedup Magento Website
Speedup Magento WebsiteSpeedup Magento Website
Speedup Magento WebsiteBeehexa
 
MongoDB Security Features
MongoDB Security FeaturesMongoDB Security Features
MongoDB Security Featuresmahdidousti
 
managing content objects
managing content objectsmanaging content objects
managing content objectsahmreenmalik
 
SQL vs. NoSQL Databases
SQL vs. NoSQL DatabasesSQL vs. NoSQL Databases
SQL vs. NoSQL DatabasesOsama Jomaa
 
Ajax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE EnvironmentAjax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE Environmentstarchaser
 
Who's afraid of front end databases?
Who's afraid of front end databases?Who's afraid of front end databases?
Who's afraid of front end databases?Gil Fink
 

Was ist angesagt? (20)

Do Logic Apps support error handling?
Do Logic Apps support error handling?Do Logic Apps support error handling?
Do Logic Apps support error handling?
 
Tech talk live share extras extension modules feb 13
Tech talk live   share extras extension modules feb 13Tech talk live   share extras extension modules feb 13
Tech talk live share extras extension modules feb 13
 
Tech talk-live-alfresco-drupal
Tech talk-live-alfresco-drupalTech talk-live-alfresco-drupal
Tech talk-live-alfresco-drupal
 
Wai yanleunglinktag
Wai yanleunglinktagWai yanleunglinktag
Wai yanleunglinktag
 
SQL vs NoSQL
SQL vs NoSQLSQL vs NoSQL
SQL vs NoSQL
 
Brian Campo, DoD JCS, Content.gov Presentation
Brian Campo, DoD JCS, Content.gov PresentationBrian Campo, DoD JCS, Content.gov Presentation
Brian Campo, DoD JCS, Content.gov Presentation
 
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
#3 Hanoi Magento Meetup - Part 3: Magento Website Optimization
 
My sql vs mongo
My sql vs mongoMy sql vs mongo
My sql vs mongo
 
Azure dboptions maniacs_nerdzao2802
Azure dboptions maniacs_nerdzao2802Azure dboptions maniacs_nerdzao2802
Azure dboptions maniacs_nerdzao2802
 
Speedup Magento Website
Speedup Magento WebsiteSpeedup Magento Website
Speedup Magento Website
 
MongoDB Security Features
MongoDB Security FeaturesMongoDB Security Features
MongoDB Security Features
 
Javascript & Jquery
Javascript & JqueryJavascript & Jquery
Javascript & Jquery
 
Css
CssCss
Css
 
EPiServer Charts
EPiServer ChartsEPiServer Charts
EPiServer Charts
 
managing content objects
managing content objectsmanaging content objects
managing content objects
 
Briney - Leveling Up Data Management - With Notes
Briney - Leveling Up Data Management - With NotesBriney - Leveling Up Data Management - With Notes
Briney - Leveling Up Data Management - With Notes
 
SQL vs. NoSQL Databases
SQL vs. NoSQL DatabasesSQL vs. NoSQL Databases
SQL vs. NoSQL Databases
 
Ajax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE EnvironmentAjax Frameworks in the J(2)EE Environment
Ajax Frameworks in the J(2)EE Environment
 
Who's afraid of front end databases?
Who's afraid of front end databases?Who's afraid of front end databases?
Who's afraid of front end databases?
 
Code camp orlando
Code camp   orlandoCode camp   orlando
Code camp orlando
 

Andere mochten auch (7)

Workbook1
Workbook1Workbook1
Workbook1
 
CGS2835 HTML5
CGS2835 HTML5CGS2835 HTML5
CGS2835 HTML5
 
Chapter.03
Chapter.03Chapter.03
Chapter.03
 
Chapter.02
Chapter.02Chapter.02
Chapter.02
 
Chapter.01
Chapter.01Chapter.01
Chapter.01
 
Ting's report on training of spa
Ting's report on training of spaTing's report on training of spa
Ting's report on training of spa
 
School personnel sheet2
School personnel sheet2School personnel sheet2
School personnel sheet2
 

Ähnlich wie Database basics

Hadoop & no sql new generation database systems
Hadoop & no sql   new generation database systemsHadoop & no sql   new generation database systems
Hadoop & no sql new generation database systemsramazan fırın
 
Steps towards business intelligence
Steps towards business intelligenceSteps towards business intelligence
Steps towards business intelligenceAhsan Kabir
 
Build a modern data platform.pptx
Build a modern data platform.pptxBuild a modern data platform.pptx
Build a modern data platform.pptxIke Ellis
 
Microsoft Azure Big Data Analytics
Microsoft Azure Big Data AnalyticsMicrosoft Azure Big Data Analytics
Microsoft Azure Big Data AnalyticsMark Kromer
 
Scalable relational database with SQL Azure
Scalable relational database with SQL AzureScalable relational database with SQL Azure
Scalable relational database with SQL AzureShy Engelberg
 
AZMS PRESENTATION.pptx
AZMS PRESENTATION.pptxAZMS PRESENTATION.pptx
AZMS PRESENTATION.pptxSonuShaw16
 
How to Achieve Scale with MongoDB
How to Achieve Scale with MongoDBHow to Achieve Scale with MongoDB
How to Achieve Scale with MongoDBMongoDB
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server DatabasesColdFusionConference
 
Sharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data LessonsSharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data LessonsGeorge Stathis
 
Week3 Lecture Database Design
Week3 Lecture Database DesignWeek3 Lecture Database Design
Week3 Lecture Database DesignKevin Element
 
Webinar: Scaling MongoDB
Webinar: Scaling MongoDBWebinar: Scaling MongoDB
Webinar: Scaling MongoDBMongoDB
 
SQL Server 2019 Big Data Cluster
SQL Server 2019 Big Data ClusterSQL Server 2019 Big Data Cluster
SQL Server 2019 Big Data ClusterMaximiliano Accotto
 
Transform your DBMS to drive engagement innovation with Big Data
Transform your DBMS to drive engagement innovation with Big DataTransform your DBMS to drive engagement innovation with Big Data
Transform your DBMS to drive engagement innovation with Big DataAshnikbiz
 
SQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveSQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveIBM Cloud Data Services
 
Framing the Argument: How to Scale Faster with NoSQL
Framing the Argument: How to Scale Faster with NoSQLFraming the Argument: How to Scale Faster with NoSQL
Framing the Argument: How to Scale Faster with NoSQLInside Analysis
 
Integration Monday - Analysing StackExchange data with Azure Data Lake
Integration Monday - Analysing StackExchange data with Azure Data LakeIntegration Monday - Analysing StackExchange data with Azure Data Lake
Integration Monday - Analysing StackExchange data with Azure Data LakeTom Kerkhove
 
Azure database as a service options
Azure database as a service optionsAzure database as a service options
Azure database as a service optionsMarcelo Adade
 

Ähnlich wie Database basics (20)

Database
DatabaseDatabase
Database
 
Mysql
MysqlMysql
Mysql
 
Hadoop & no sql new generation database systems
Hadoop & no sql   new generation database systemsHadoop & no sql   new generation database systems
Hadoop & no sql new generation database systems
 
NoSQL for SQL Users
NoSQL for SQL UsersNoSQL for SQL Users
NoSQL for SQL Users
 
Steps towards business intelligence
Steps towards business intelligenceSteps towards business intelligence
Steps towards business intelligence
 
Build a modern data platform.pptx
Build a modern data platform.pptxBuild a modern data platform.pptx
Build a modern data platform.pptx
 
Microsoft Azure Big Data Analytics
Microsoft Azure Big Data AnalyticsMicrosoft Azure Big Data Analytics
Microsoft Azure Big Data Analytics
 
Scalable relational database with SQL Azure
Scalable relational database with SQL AzureScalable relational database with SQL Azure
Scalable relational database with SQL Azure
 
AZMS PRESENTATION.pptx
AZMS PRESENTATION.pptxAZMS PRESENTATION.pptx
AZMS PRESENTATION.pptx
 
How to Achieve Scale with MongoDB
How to Achieve Scale with MongoDBHow to Achieve Scale with MongoDB
How to Achieve Scale with MongoDB
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server Databases
 
Sharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data LessonsSharing a Startup’s Big Data Lessons
Sharing a Startup’s Big Data Lessons
 
Week3 Lecture Database Design
Week3 Lecture Database DesignWeek3 Lecture Database Design
Week3 Lecture Database Design
 
Webinar: Scaling MongoDB
Webinar: Scaling MongoDBWebinar: Scaling MongoDB
Webinar: Scaling MongoDB
 
SQL Server 2019 Big Data Cluster
SQL Server 2019 Big Data ClusterSQL Server 2019 Big Data Cluster
SQL Server 2019 Big Data Cluster
 
Transform your DBMS to drive engagement innovation with Big Data
Transform your DBMS to drive engagement innovation with Big DataTransform your DBMS to drive engagement innovation with Big Data
Transform your DBMS to drive engagement innovation with Big Data
 
SQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveSQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The Move
 
Framing the Argument: How to Scale Faster with NoSQL
Framing the Argument: How to Scale Faster with NoSQLFraming the Argument: How to Scale Faster with NoSQL
Framing the Argument: How to Scale Faster with NoSQL
 
Integration Monday - Analysing StackExchange data with Azure Data Lake
Integration Monday - Analysing StackExchange data with Azure Data LakeIntegration Monday - Analysing StackExchange data with Azure Data Lake
Integration Monday - Analysing StackExchange data with Azure Data Lake
 
Azure database as a service options
Azure database as a service optionsAzure database as a service options
Azure database as a service options
 

Mehr von Program in Interdisciplinary Computing (20)

Mysocial databasequeries
Mysocial databasequeriesMysocial databasequeries
Mysocial databasequeries
 
Mysocial databasequeries
Mysocial databasequeriesMysocial databasequeries
Mysocial databasequeries
 
01 intro tousingjava
01 intro tousingjava01 intro tousingjava
01 intro tousingjava
 
Xhtml
XhtmlXhtml
Xhtml
 
Webdev
WebdevWebdev
Webdev
 
Web architecture
Web architectureWeb architecture
Web architecture
 
Sdlc
SdlcSdlc
Sdlc
 
Mysocial
MysocialMysocial
Mysocial
 
Javascript
JavascriptJavascript
Javascript
 
Javascript
JavascriptJavascript
Javascript
 
Html5
Html5Html5
Html5
 
Frameworks
FrameworksFrameworks
Frameworks
 
Drupal
DrupalDrupal
Drupal
 
Javascript2
Javascript2Javascript2
Javascript2
 
12 abstract classes
12 abstract classes12 abstract classes
12 abstract classes
 
11 polymorphism
11 polymorphism11 polymorphism
11 polymorphism
 
13 interfaces
13 interfaces13 interfaces
13 interfaces
 
15b more gui
15b more gui15b more gui
15b more gui
 
15a gui
15a gui15a gui
15a gui
 
14b exceptions
14b exceptions14b exceptions
14b exceptions
 

Kürzlich hochgeladen

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 

Kürzlich hochgeladen (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

Database basics

  • 1. CGS 2835 Interdisciplinary Web Development Web Database Useful Web Apps +
  • 2. CGS 2835 Interdisciplinary Web Development The Value of Databases • Databases and Database Management Systems (DBMS) transform large quantities of data into specific and valuable information for accomplishing some goal.
  • 3. CGS 2835 Interdisciplinary Web Development AMP •Apache – open source Web server •MySQL – open source database •PHP – programming language that works in HTML to provide interactivity with MySQL
  • 4. CGS 2835 Interdisciplinary Web Development Database Server Web ServerHTML REQUEST w/DATAHTML REQUEST w/DATA SQL CommandSQL Command PHP
  • 5. CGS 2835 Interdisciplinary Web Development Database Server Web Server PHP data PHP-created HTML
  • 6. CGS 2835 Interdisciplinary Web Development MySQL Database Server PHPdata PHP-created HTML SQLSQL Our Focus
  • 7. CGS 2835 Interdisciplinary Web Development Databases
  • 8. CGS 2835 Interdisciplinary Web Development File or Table Database • A collection of data organized to meet user’s needs. Records (Entities) Field (Attribute)
  • 9. CGS 2835 Interdisciplinary Web Development Database Fields • Fields are set to hold specific types of data.
  • 10. CGS 2835 Interdisciplinary Web Development Database A Database is a collection of files/tables
  • 11. CGS 2835 Interdisciplinary Web Development Database Heirarchy Table
  • 12. CGS 2835 Interdisciplinary Web Development Keys and Primary Key • Key: A field in a record that is used to identify the record • Primary key: A field that uniquely identifies a record – A primary key field prevents duplicate records from occurring in a table.
  • 13. CGS 2835 Interdisciplinary Web Development Primary Keys • User identification number • Sometimes email addresses are used as a unique login, assuming two people cannot have the same email • A number is faster to look up, so a unique number is often still generated
  • 14. CGS 2835 Interdisciplinary Web Development Primary Key
  • 15. CGS 2835 Interdisciplinary Web Development The Relational Model • In a relational database, tables are linked (related) through common fields. • This can remove redundant data, and organize information
  • 16. CGS 2835 Interdisciplinary Web Development “Flat” database userID First Name Last Name Email, …, … Message 1 Geo Miller …, … , … Hello! 2 Ken Baldauf …, … , … Greetings, how are you? 1 Geo Miller …, … , … Doing well 2 Ken Baldauf ……, … , … Great! The Relational Model
  • 17. CGS 2835 Interdisciplinary Web Development “Relational” databaseuserID First Name Last Name Email, …, … 1 Geo Miller …, … , … 2 Ken Baldauf …, … , … The Relational Model userID Message 1 Hello! 2 Greetings, how are you? 1 Doing well 2 Great!
  • 18. CGS 2835 Interdisciplinary Web Development Relation Types • One-to-many – Makes use of primary key – Example: one person makes many posts • One-to-one – A piece of data only relating to one record • Many-to-many – An item can have many sellers and sellers can sell that item many times
  • 19. CGS 2835 Interdisciplinary Web Development MySQL An open-source, relational database
  • 20. CGS 2835 Interdisciplinary Web Development MySQL - Installing • Some servers require an administrator to install • On your own machine, there are installation packages for AMP • On Codio: – parts install mysql – parts start mysql • On many linux distributions: – apt-get install mysql-server – service mysql start
  • 21. CGS 2835 Interdisciplinary Web Development MySQL – Creating a Database Creating a database in MySQL is traditionally done with a terminal that has administrator access to the MySQL server. CREATE DATABASE IF NOT EXISTS “databasename” A MySQL user must be created and given access to use the new database CREATE USER IF NOT EXISTS “username” SET PASSWORD FOR “username”=PASSWORD(“password”) GRANT ALL PRIVILEGES ON “databasename” TO “username” IDENTIFIED BY “password”
  • 22. CGS 2835 Interdisciplinary Web Development phpMyAdmin is a popular application for managing mySQL databases. Here you can click a database name to access its properties and tools. Note that whenever prompted for charset or collation select UTF-8 Unicode (utf8).
  • 23. CGS 2835 Interdisciplinary Web Development Access MySQL Database We will use phpMyAdmin to: •Create tables in databases •Create fields in the tables •Manage the database •Examine table data We will use PHP to: • Enter records into tables from HTML forms • Read records from tables and output to HTML pages
  • 24. CGS 2835 Interdisciplinary Web Development When I click my database link in phpMyAdmin, I am prompted to create a table.
  • 25. CGS 2835 Interdisciplinary Web Development Then I create fields for my table.
  • 26. CGS 2835 Interdisciplinary Web Development I can then use the Insert tab to enter records into the table.
  • 27. CGS 2835 Interdisciplinary Web Development
  • 28. CGS 2835 Interdisciplinary Web Development The browse buttons allows you to view the contents of the table.
  • 29. CGS 2835 Interdisciplinary Web Development
  • 30. CGS 2835 Interdisciplinary Web Development You can also run SQL queries on your data from within phpMyAdmin.
  • 31. CGS 2835 Interdisciplinary Web Development MySQL & phpMyAdmin • phpMyAdmin is a useful tool for manipulating mySQL databases; however, in order to work with Web-generated data, the mySQL database must be accessed from the HTML code using PHP. MySQL Database Server SQLSQLSQLSQL PHP
  • 32. CGS 2835 Interdisciplinary Web Development MySQL & phpMyAdmin • Either method of interacting with the database requires knowledge of SQL MySQL Database Server SQLSQLSQLSQL PHP