SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
DatabaseDatabase
Database Table
• ก F (table) F ก F F
•Table ก F row column
• F table student ก F column (id) ก (name) ʾ• F table student ก F column (id) ก (name) ʾ
(year)
• ก F (column id) ˈ F F ก F row ก
column F primary
id name year
projetcsoft.biz F
F ก
Database Table
•Table primary key F F F row ก array
index 1,2,3, F F F F
• F ก username password F (Table Admin)• F ก username password F (Table Admin)
column F กF username password username ˈ primary key
username F ก F F
username password
projetcsoft.biz F
F ก
Database Table
• (table subject) ก F 2 column F กF (id)
(name)
id name
•
F F ก F ก ก F F ก F F F
(table score) F F F ก F ก
(student_id), (subject_id) F(point)
id name
projetcsoft.biz F
F ก
Database Table
• F ก ˈ F F F F F
student_id subject_id point
• F ก ˈ F F F F F
ก ก ก table student ก table subject
• กก ก ก F F ก ˈ F F F ก
F F F F ก primary key
•primary key ก ก F foreign key
projetcsoft.biz F
F ก
Database Table
projetcsoft.biz F
F ก
Database Table
projetcsoft.biz F
F ก
Database Table
projetcsoft.biz F
F ก
ก F F
ก F F F ก column ก F ก
F Fก F ก ก F
ก column department faculty ก F ก
projetcsoft.biz F
F ก
My SQL
•My SQL ก ก database
• ก F , , กF table , F , , กF
column, F , , กF F row Fcolumn, F , , กF F row F
• ก F ก ก database ก ก F F
•Database Management System
• ก F My SQL F ก F PHP MyAdmin
projetcsoft.biz F
F ก
PHP MyAdmin
• App Serv F ก F PHP MyAdmin
F ʽ ก web browser F F
http://localhost F addresshttp://localhost F address
projetcsoft.biz F
F ก
PHP MyAdmin
F ก phpMyAdmin Database Manager Version
•Link ก
•Web browser F F F login F F F root•Web browser F F F login F F F root
username F password ก F
Appserv
projetcsoft.biz F
F ก
Column Data Type
• F MySQL F กF
•INT
•FLOAT•FLOAT
•VARCHAR String ก F F F ก F F
•TEXT String 65,535 ก
•MEDIUMTEXT String 16,777,215
ก
•DATE F YYYY-MM-DD
•TIME F ˈ HH:MM:SS
projetcsoft.biz F
F ก
Autorun Primary key
•ก F F F F ก ก F F
array index ก F F ($array[1])
• F ก ก F F F primary key ˈ ก• F ก ก F F F primary key ˈ ก
F F F F F
• ก F column ˈ primary key F
• F primary key auto run ˈ
projetcsoft.biz F
F ก
Database F ˈ case study
projetcsoft.biz F
F ก
SQL , , กF FSQL , , กF F
SQL F ก Structure Query
Langue , , กF , ก
F F
SQL CREATE TABLE
•CREATE TABLE (
• column F ,
•……………,
•PRIMARY KEY ( column ˈ primary key )•PRIMARY KEY ( column ˈ primary key )
•) ENGINE = MYISAM DEFAULT CHARSET = utf8
•COLLATE = utf8_unicode_ci
projetcsoft.biz F
F ก
SQL CREATE TABLE
•CREATE TABLE student(
•id INT ,
•name VARCHAR(80 ) ,•name VARCHAR(80 ) ,
•PRIMARY KEY (id)
•) ENGINE = MYISAM DEFAULT CHARSET =
utf8
•COLLATE = utf8_unicode_ci
projetcsoft.biz F
F ก
SQL CREATE TABLE
•CREATE TABLE subject(
•id INT ,
•name VARCHAR(80 ) ,•name VARCHAR(80 ) ,
•PRIMARY KEY (id)
•) ENGINE = MYISAM DEFAULT CHARSET =
utf8
•COLLATE = utf8_unicode_ci
projetcsoft.biz F
F ก
CREATE TABLE score (
id int auto_increment,
student_id int ,
subject_id int ,
public_date date ,
public_time time ,public_time time ,
point float ,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
COLLATE=utf8_unicode_ci
F F ก F primary key ˈ auto increment F F auto_increment
F
projetcsoft.biz F
F ก
SQL INSERT
•INSERT INTO table_name(column_name,…)
•VALUES (column_value,…)
• F ก table subject• F ก table subject
•INSERT INTO subject(id,name)
•VALUES (112233 , “Basic Web Application”)
• F ก ก F ก F column F ˈ
ก F VARCHAR TEXT F F F F F
“…” F ˈ F
projetcsoft.biz F
F ก
SQL INSERT
• SQL F Student
•INSERT INTO student(id,name)
VALUES(47180187," ")VALUES(47180187," ")
• SQL F score
•INSERT INTO score(id, student_id, subject_id,
point, public_date, public_time)VALUES
•(null,47180187,112233,45.5,"2009-12-
31","23:59:10")
projetcsoft.biz F
F ก
SQL INSERT
• F ก ก score
•ก F column id ก F ˈ auto run primary
key F ˈ null ( F F F F ˈ F F Fkey F ˈ null ( F F F F ˈ F F F
column ˈ auto run MySQL F
F F 1 F ก ก)
•ก F column public_date ˈ F
F F F “..” ˈ yyyy-mm-dd
( ʾ( . .)- - )
projetcsoft.biz F
F ก
SQL INSERT
•ก F column public_time ˈ F F F
F “..” hh:mm:ss ( : : )
• F function NOW() SQL F ก ˆ
FF
•INSERT INTO score(id, student_id, subject_id, point,
public_date, public_time)VALUES
•(null,47180187,112233,45.5,NOW(),NOW())
projetcsoft.biz F
F ก
SQL DELETE
• F ก ก F
•DELETE FROM WHERE primary key=
• Fก F F F ก F F F ก ก F F array F F
index ก F F F F ก F F primary key ก
Fก F F F ก F F F ก ก F F F F
index ก F F F F ก F F primary key ก
F F F ก
• ก F ก F F F F ก F
primary key= ก F ก
• F F F ก WHERE primary key= MySQL
F ก
projetcsoft.biz F
F ก
SQL DELETE
• id ˈ 9 score
•DELETE FROM score WHERE id=9
• id ˈ 45180932 student• id ˈ 45180932 student
•DELETE FROM student WHERE id=45180932
• id ˈ 1133675 subject
•DELETE FROM subject WHERE id=1133675
• ก ก 2009-1-3 20:30:45
•DELETE FROM score WHERE (public_date="2009-
1-3") AND (public_time="20:30:45")
projetcsoft.biz F
F ก
SQL UPDATE
• F ก ก ก F กก F
ก ก F AND ()
FF
•ก F ก F column public_date
F ˈ "2009-1-3” column public_time F
ˈ "20:30:45” F ก column public_date F
ˈ "2009-1-3” Fcolumn public_time F F F ก
ˈ "20:30:45” F ก F
projetcsoft.biz F
F ก
SQL UPDATE
• ก กF F column F
•UPDATE SET column= F F ก ,
column= F F ก WHERE primary key=column= F F ก WHERE primary key=
• F ก DELETE F F F
WHERE primary key= ˈ ก F F ก กF F
• F กF F column ˈ primary
projetcsoft.biz F
F ก
SQL UPDATE
• กF ก ก ˈ 5123454
•UPDATE student SET name=" กF "
WHERE id=5123454WHERE id=5123454
projetcsoft.biz F
F ก
SQL UPDATE
• กF , ก ก 442331
321456
•UPDATE score SET public_date="2009-1-•UPDATE score SET public_date="2009-1-
3",public_time="20:30:45",point=12.8 WHERE
(student_id=442331)AND(subject_id=321456)
• ก F ก F ก ก
INSERT
projetcsoft.biz F
F ก
SQL UPDATE
• กF 987645 ก 47189187
•UPDATE score SET point=0 WHERE
(student_id=47189187)AND(subject_id=987645)(student_id=47189187)AND(subject_id=987645)
projetcsoft.biz F
F ก
SQL SELECT
•SELECT column_name, … FROM table_name
• F column_name ก table_name
• F SELECT id,name FROM subject ก ก F
column id coulumn name subjectcolumn id coulumn name subject
• F ˈ F ก column F F ก F
column F F
•SELECT name FROM student ก ก ก F
student
• ก F ก F ก column F F *
•SELECT * FROM student
projetcsoft.biz F
F ก
SQL SELECT
• F ก F (WHERE) F F ก
UPDATE ก DELETE
• WHERE ˈ logical operation ก• WHERE ˈ logical operation ก
F F ก F F F ก ก F กก F
F ก 20 112233 F
•SELECT student_id FROM score WHERE
(point>=20) AND(subject_id= 112233)
projetcsoft.biz F
F ก
SQL Logical Operation
• SQL ก WHERE ˈ logical operation
•(column_name operator value )AND|OR(
•operator F F column ก F•operator F F column ก F
F ก operator SQL F กF
•= F ก <> F F ก > กก F >= กก F F ก
•< F ก F <= F ก F F ก
• value ก F column F F ˈ F
F value F F F “..”
projetcsoft.biz F
F ก
SQL Logical Operation
• F ก ก 47180187
•SELECT name FROM student WHERE
•(id =47180187)•(id =47180187)
projetcsoft.biz F
F ก
SQL Logical Operation
• F ก ก F F 20 30
112233
•SELECT student_id FROM score WHERE•SELECT student_id FROM score WHERE
•(point >20)AND (point <30)
•AND (subject_id =112233)
projetcsoft.biz F
F ก
ก F ก ก 11273 F
sql F
SELECT MAX(point) FROM score
WHERE (subject_id =11273)
SQL MAX MIN Function
WHERE (subject_id =11273)
ก ก F
SELECT MIN(point) FROM score
WHERE (subject_id =11273)
projetcsoft.biz F
F ก

Contenu connexe

Tendances

Web осень 2012 лекция 7
Web осень 2012 лекция 7Web осень 2012 лекция 7
Web осень 2012 лекция 7Technopark
 
Rails view chapte 5 - form
Rails view   chapte 5 - formRails view   chapte 5 - form
Rails view chapte 5 - formThaichor Seng
 
Building custom sections in Umbraco
Building custom sections in UmbracoBuilding custom sections in Umbraco
Building custom sections in Umbracodawoe
 
Becoming a jQuery expert
Becoming a jQuery expertBecoming a jQuery expert
Becoming a jQuery expertAra Pehlivanian
 
Web Development Paradigms and djangoic approach to deal with them
Web Development Paradigms and djangoic approach to deal with themWeb Development Paradigms and djangoic approach to deal with them
Web Development Paradigms and djangoic approach to deal with themLakshman Prasad
 
Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011David Fetter
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statementsapdocs. info
 
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & ReasonType Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & ReasonNikolaus Graf
 
Simple Blue Blog Template XML 的副本
Simple Blue Blog Template XML 的副本Simple Blue Blog Template XML 的副本
Simple Blue Blog Template XML 的副本a5494535
 
Nseg41 あなたの知らないjavascriptの基本
Nseg41 あなたの知らないjavascriptの基本Nseg41 あなたの知らないjavascriptの基本
Nseg41 あなたの知らないjavascriptの基本hATrayflood
 

Tendances (14)

Web осень 2012 лекция 7
Web осень 2012 лекция 7Web осень 2012 лекция 7
Web осень 2012 лекция 7
 
Using an ARLA Agent
Using an ARLA AgentUsing an ARLA Agent
Using an ARLA Agent
 
Rails view chapte 5 - form
Rails view   chapte 5 - formRails view   chapte 5 - form
Rails view chapte 5 - form
 
Duug - Ttypescript
Duug - TtypescriptDuug - Ttypescript
Duug - Ttypescript
 
Building custom sections in Umbraco
Building custom sections in UmbracoBuilding custom sections in Umbraco
Building custom sections in Umbraco
 
Becoming a jQuery expert
Becoming a jQuery expertBecoming a jQuery expert
Becoming a jQuery expert
 
Mtl in 15m
Mtl in 15mMtl in 15m
Mtl in 15m
 
Basic programming
Basic programmingBasic programming
Basic programming
 
Web Development Paradigms and djangoic approach to deal with them
Web Development Paradigms and djangoic approach to deal with themWeb Development Paradigms and djangoic approach to deal with them
Web Development Paradigms and djangoic approach to deal with them
 
Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statement
 
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & ReasonType Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
 
Simple Blue Blog Template XML 的副本
Simple Blue Blog Template XML 的副本Simple Blue Blog Template XML 的副本
Simple Blue Blog Template XML 的副本
 
Nseg41 あなたの知らないjavascriptの基本
Nseg41 あなたの知らないjavascriptの基本Nseg41 あなたの知らないjavascriptの基本
Nseg41 あなたの知らないjavascriptの基本
 

Similaire à Seasion7

CCM AlchemyAPI and Real-time Aggregation
CCM AlchemyAPI and Real-time AggregationCCM AlchemyAPI and Real-time Aggregation
CCM AlchemyAPI and Real-time AggregationVictor Anjos
 
Mcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singhMcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singhDIVYA SINGH
 
Advanced query parsing techniques
Advanced query parsing techniquesAdvanced query parsing techniques
Advanced query parsing techniqueslucenerevolution
 
A brief history of Django model syntax
A brief history of Django model syntaxA brief history of Django model syntax
A brief history of Django model syntaxJacob Kaplan-Moss
 
pandas - Python Data Analysis
pandas - Python Data Analysispandas - Python Data Analysis
pandas - Python Data AnalysisAndrew Henshaw
 
Bibliographic Data Spring Cleaning with Sierra DNA
Bibliographic Data Spring Cleaning with Sierra DNA Bibliographic Data Spring Cleaning with Sierra DNA
Bibliographic Data Spring Cleaning with Sierra DNA Becky Yoose
 
BMIS 325CMS Project Phase II InstructionsIn this phase, you w.docx
BMIS 325CMS Project Phase II InstructionsIn this phase, you w.docxBMIS 325CMS Project Phase II InstructionsIn this phase, you w.docx
BMIS 325CMS Project Phase II InstructionsIn this phase, you w.docxhartrobert670
 
CMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docxCMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docxmary772
 
Power & flexibility of the Google Sheets API
Power & flexibility of the Google Sheets APIPower & flexibility of the Google Sheets API
Power & flexibility of the Google Sheets APIwesley chun
 
Coding and Cookies: R basics
Coding and Cookies: R basicsCoding and Cookies: R basics
Coding and Cookies: R basicsC. Tobin Magle
 
Basic data analysis using R.
Basic data analysis using R.Basic data analysis using R.
Basic data analysis using R.C. Tobin Magle
 
Use FLUID templating for your TYPO3 search
Use FLUID templating for your TYPO3 searchUse FLUID templating for your TYPO3 search
Use FLUID templating for your TYPO3 searchtimohund
 
Webinar: Index Tuning and Evaluation
Webinar: Index Tuning and EvaluationWebinar: Index Tuning and Evaluation
Webinar: Index Tuning and EvaluationMongoDB
 
SAP Batch data communication
SAP Batch data communicationSAP Batch data communication
SAP Batch data communicationJugul Crasta
 
Using MySQL in a web-scale environment
Using MySQL in a web-scale environmentUsing MySQL in a web-scale environment
Using MySQL in a web-scale environmentDavid Landgren
 

Similaire à Seasion7 (20)

CCM AlchemyAPI and Real-time Aggregation
CCM AlchemyAPI and Real-time AggregationCCM AlchemyAPI and Real-time Aggregation
CCM AlchemyAPI and Real-time Aggregation
 
Mcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singhMcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singh
 
Advanced Relevancy Ranking
Advanced Relevancy RankingAdvanced Relevancy Ranking
Advanced Relevancy Ranking
 
Advanced query parsing techniques
Advanced query parsing techniquesAdvanced query parsing techniques
Advanced query parsing techniques
 
A brief history of Django model syntax
A brief history of Django model syntaxA brief history of Django model syntax
A brief history of Django model syntax
 
pandas - Python Data Analysis
pandas - Python Data Analysispandas - Python Data Analysis
pandas - Python Data Analysis
 
Bibliographic Data Spring Cleaning with Sierra DNA
Bibliographic Data Spring Cleaning with Sierra DNA Bibliographic Data Spring Cleaning with Sierra DNA
Bibliographic Data Spring Cleaning with Sierra DNA
 
BMIS 325CMS Project Phase II InstructionsIn this phase, you w.docx
BMIS 325CMS Project Phase II InstructionsIn this phase, you w.docxBMIS 325CMS Project Phase II InstructionsIn this phase, you w.docx
BMIS 325CMS Project Phase II InstructionsIn this phase, you w.docx
 
CMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docxCMS Project Phase II InstructionsIn this phase, you will create t.docx
CMS Project Phase II InstructionsIn this phase, you will create t.docx
 
Power & flexibility of the Google Sheets API
Power & flexibility of the Google Sheets APIPower & flexibility of the Google Sheets API
Power & flexibility of the Google Sheets API
 
Structure & union
Structure & unionStructure & union
Structure & union
 
FQL Overview
FQL OverviewFQL Overview
FQL Overview
 
Coding and Cookies: R basics
Coding and Cookies: R basicsCoding and Cookies: R basics
Coding and Cookies: R basics
 
Basic data analysis using R.
Basic data analysis using R.Basic data analysis using R.
Basic data analysis using R.
 
Use FLUID templating for your TYPO3 search
Use FLUID templating for your TYPO3 searchUse FLUID templating for your TYPO3 search
Use FLUID templating for your TYPO3 search
 
Webinar: Index Tuning and Evaluation
Webinar: Index Tuning and EvaluationWebinar: Index Tuning and Evaluation
Webinar: Index Tuning and Evaluation
 
CPP Quiz
CPP QuizCPP Quiz
CPP Quiz
 
SAP Batch data communication
SAP Batch data communicationSAP Batch data communication
SAP Batch data communication
 
Using MySQL in a web-scale environment
Using MySQL in a web-scale environmentUsing MySQL in a web-scale environment
Using MySQL in a web-scale environment
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 

Dernier

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Dernier (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
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...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Seasion7

  • 2. Database Table • ก F (table) F ก F F •Table ก F row column • F table student ก F column (id) ก (name) ʾ• F table student ก F column (id) ก (name) ʾ (year) • ก F (column id) ˈ F F ก F row ก column F primary id name year projetcsoft.biz F F ก
  • 3. Database Table •Table primary key F F F row ก array index 1,2,3, F F F F • F ก username password F (Table Admin)• F ก username password F (Table Admin) column F กF username password username ˈ primary key username F ก F F username password projetcsoft.biz F F ก
  • 4. Database Table • (table subject) ก F 2 column F กF (id) (name) id name • F F ก F ก ก F F ก F F F (table score) F F F ก F ก (student_id), (subject_id) F(point) id name projetcsoft.biz F F ก
  • 5. Database Table • F ก ˈ F F F F F student_id subject_id point • F ก ˈ F F F F F ก ก ก table student ก table subject • กก ก ก F F ก ˈ F F F ก F F F F ก primary key •primary key ก ก F foreign key projetcsoft.biz F F ก
  • 9. ก F F ก F F F ก column ก F ก F Fก F ก ก F ก column department faculty ก F ก projetcsoft.biz F F ก
  • 10. My SQL •My SQL ก ก database • ก F , , กF table , F , , กF column, F , , กF F row Fcolumn, F , , กF F row F • ก F ก ก database ก ก F F •Database Management System • ก F My SQL F ก F PHP MyAdmin projetcsoft.biz F F ก
  • 11. PHP MyAdmin • App Serv F ก F PHP MyAdmin F ʽ ก web browser F F http://localhost F addresshttp://localhost F address projetcsoft.biz F F ก
  • 12. PHP MyAdmin F ก phpMyAdmin Database Manager Version •Link ก •Web browser F F F login F F F root•Web browser F F F login F F F root username F password ก F Appserv projetcsoft.biz F F ก
  • 13. Column Data Type • F MySQL F กF •INT •FLOAT•FLOAT •VARCHAR String ก F F F ก F F •TEXT String 65,535 ก •MEDIUMTEXT String 16,777,215 ก •DATE F YYYY-MM-DD •TIME F ˈ HH:MM:SS projetcsoft.biz F F ก
  • 14. Autorun Primary key •ก F F F F ก ก F F array index ก F F ($array[1]) • F ก ก F F F primary key ˈ ก• F ก ก F F F primary key ˈ ก F F F F F • ก F column ˈ primary key F • F primary key auto run ˈ projetcsoft.biz F F ก
  • 15. Database F ˈ case study projetcsoft.biz F F ก
  • 16. SQL , , กF FSQL , , กF F SQL F ก Structure Query Langue , , กF , ก F F
  • 17. SQL CREATE TABLE •CREATE TABLE ( • column F , •……………, •PRIMARY KEY ( column ˈ primary key )•PRIMARY KEY ( column ˈ primary key ) •) ENGINE = MYISAM DEFAULT CHARSET = utf8 •COLLATE = utf8_unicode_ci projetcsoft.biz F F ก
  • 18. SQL CREATE TABLE •CREATE TABLE student( •id INT , •name VARCHAR(80 ) ,•name VARCHAR(80 ) , •PRIMARY KEY (id) •) ENGINE = MYISAM DEFAULT CHARSET = utf8 •COLLATE = utf8_unicode_ci projetcsoft.biz F F ก
  • 19. SQL CREATE TABLE •CREATE TABLE subject( •id INT , •name VARCHAR(80 ) ,•name VARCHAR(80 ) , •PRIMARY KEY (id) •) ENGINE = MYISAM DEFAULT CHARSET = utf8 •COLLATE = utf8_unicode_ci projetcsoft.biz F F ก
  • 20. CREATE TABLE score ( id int auto_increment, student_id int , subject_id int , public_date date , public_time time ,public_time time , point float , PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci F F ก F primary key ˈ auto increment F F auto_increment F projetcsoft.biz F F ก
  • 21. SQL INSERT •INSERT INTO table_name(column_name,…) •VALUES (column_value,…) • F ก table subject• F ก table subject •INSERT INTO subject(id,name) •VALUES (112233 , “Basic Web Application”) • F ก ก F ก F column F ˈ ก F VARCHAR TEXT F F F F F “…” F ˈ F projetcsoft.biz F F ก
  • 22. SQL INSERT • SQL F Student •INSERT INTO student(id,name) VALUES(47180187," ")VALUES(47180187," ") • SQL F score •INSERT INTO score(id, student_id, subject_id, point, public_date, public_time)VALUES •(null,47180187,112233,45.5,"2009-12- 31","23:59:10") projetcsoft.biz F F ก
  • 23. SQL INSERT • F ก ก score •ก F column id ก F ˈ auto run primary key F ˈ null ( F F F F ˈ F F Fkey F ˈ null ( F F F F ˈ F F F column ˈ auto run MySQL F F F 1 F ก ก) •ก F column public_date ˈ F F F F “..” ˈ yyyy-mm-dd ( ʾ( . .)- - ) projetcsoft.biz F F ก
  • 24. SQL INSERT •ก F column public_time ˈ F F F F “..” hh:mm:ss ( : : ) • F function NOW() SQL F ก ˆ FF •INSERT INTO score(id, student_id, subject_id, point, public_date, public_time)VALUES •(null,47180187,112233,45.5,NOW(),NOW()) projetcsoft.biz F F ก
  • 25. SQL DELETE • F ก ก F •DELETE FROM WHERE primary key= • Fก F F F ก F F F ก ก F F array F F index ก F F F F ก F F primary key ก Fก F F F ก F F F ก ก F F F F index ก F F F F ก F F primary key ก F F F ก • ก F ก F F F F ก F primary key= ก F ก • F F F ก WHERE primary key= MySQL F ก projetcsoft.biz F F ก
  • 26. SQL DELETE • id ˈ 9 score •DELETE FROM score WHERE id=9 • id ˈ 45180932 student• id ˈ 45180932 student •DELETE FROM student WHERE id=45180932 • id ˈ 1133675 subject •DELETE FROM subject WHERE id=1133675 • ก ก 2009-1-3 20:30:45 •DELETE FROM score WHERE (public_date="2009- 1-3") AND (public_time="20:30:45") projetcsoft.biz F F ก
  • 27. SQL UPDATE • F ก ก ก F กก F ก ก F AND () FF •ก F ก F column public_date F ˈ "2009-1-3” column public_time F ˈ "20:30:45” F ก column public_date F ˈ "2009-1-3” Fcolumn public_time F F F ก ˈ "20:30:45” F ก F projetcsoft.biz F F ก
  • 28. SQL UPDATE • ก กF F column F •UPDATE SET column= F F ก , column= F F ก WHERE primary key=column= F F ก WHERE primary key= • F ก DELETE F F F WHERE primary key= ˈ ก F F ก กF F • F กF F column ˈ primary projetcsoft.biz F F ก
  • 29. SQL UPDATE • กF ก ก ˈ 5123454 •UPDATE student SET name=" กF " WHERE id=5123454WHERE id=5123454 projetcsoft.biz F F ก
  • 30. SQL UPDATE • กF , ก ก 442331 321456 •UPDATE score SET public_date="2009-1-•UPDATE score SET public_date="2009-1- 3",public_time="20:30:45",point=12.8 WHERE (student_id=442331)AND(subject_id=321456) • ก F ก F ก ก INSERT projetcsoft.biz F F ก
  • 31. SQL UPDATE • กF 987645 ก 47189187 •UPDATE score SET point=0 WHERE (student_id=47189187)AND(subject_id=987645)(student_id=47189187)AND(subject_id=987645) projetcsoft.biz F F ก
  • 32. SQL SELECT •SELECT column_name, … FROM table_name • F column_name ก table_name • F SELECT id,name FROM subject ก ก F column id coulumn name subjectcolumn id coulumn name subject • F ˈ F ก column F F ก F column F F •SELECT name FROM student ก ก ก F student • ก F ก F ก column F F * •SELECT * FROM student projetcsoft.biz F F ก
  • 33. SQL SELECT • F ก F (WHERE) F F ก UPDATE ก DELETE • WHERE ˈ logical operation ก• WHERE ˈ logical operation ก F F ก F F F ก ก F กก F F ก 20 112233 F •SELECT student_id FROM score WHERE (point>=20) AND(subject_id= 112233) projetcsoft.biz F F ก
  • 34. SQL Logical Operation • SQL ก WHERE ˈ logical operation •(column_name operator value )AND|OR( •operator F F column ก F•operator F F column ก F F ก operator SQL F กF •= F ก <> F F ก > กก F >= กก F F ก •< F ก F <= F ก F F ก • value ก F column F F ˈ F F value F F F “..” projetcsoft.biz F F ก
  • 35. SQL Logical Operation • F ก ก 47180187 •SELECT name FROM student WHERE •(id =47180187)•(id =47180187) projetcsoft.biz F F ก
  • 36. SQL Logical Operation • F ก ก F F 20 30 112233 •SELECT student_id FROM score WHERE•SELECT student_id FROM score WHERE •(point >20)AND (point <30) •AND (subject_id =112233) projetcsoft.biz F F ก
  • 37. ก F ก ก 11273 F sql F SELECT MAX(point) FROM score WHERE (subject_id =11273) SQL MAX MIN Function WHERE (subject_id =11273) ก ก F SELECT MIN(point) FROM score WHERE (subject_id =11273) projetcsoft.biz F F ก