SlideShare a Scribd company logo
1 of 18
Running SQL Queries on the Moodle
Database
An overview
18 November 2016
Tools available
• Moodle Adminer
• Ad-hoc Database Queries
• Configurable Reports
• PHP MyAdmin
Moodle Adminer
• The ‘work horse’
• SQL in, information out
• Aimed at Admins
• Powerful for large queries
• Slick authoring of queries
• Robust browsing of tables
• So what’s the catch?
Moodle Adminer
Great so I can edit the database directly?
Technically speaking yes…
Moodle Adminer
Installation and set up
The plugin installs like any other Moodle plugin, in the local
folder and can be found at Site Administration > Server
Top Tip: If your Database Server has multiple databases,
consider using moodleuser or similar in your config.php
(create if needed)
Moodle Adminer
Demo
SELECT fullname, shortname FROM mdl_course
ORDER BY fullname ASC
Ad Hoc SQL
Installation and set up
The plugin installs like any other Moodle plugin, in the reports
folder and can be found at Site Administration > Reports
Ad Hoc SQL
• Write once, run many
• Great for delegating running of queries to curriculum
managers
• Not 100% foolproof
• Elegant
• Easy to use
• Timer and Email utilisation
Ad Hoc SQL
Configurable Reports
• Very user friendly
• Elegantly formatted output
• Can be applied at course level as a block
Configurable Reports
Installation and set up
The plugin installs like any other Moodle plugin, in the block
folder and can be added at course level
PHP My Admin
Installation and set up
Installed as a fully fledged application at server level.
Managing the Databases
Dumps
We do this through command line
mysqldump –u root –p –h localhost moodle > dump.sql
-v (verbose mode)
Managing the Databases
Find and Replace
We do this through command line, but the replace tool is also
useful
sed –i
‘s/moodle.westcollegescotland.ac.uk/moodle14.westcollege
scotland.ac.uk/g’ ./dump.sql
(sed is a Linux tool)
Managing the Databases
Managing the Databases
Imports
We do this through command line too
mysql –u root –p –h localhost moodle < dump.sql
-v (verbose mode)

More Related Content

Viewers also liked

Sql query performance analysis
Sql query performance analysisSql query performance analysis
Sql query performance analysisRiteshkiit
 
Still Game to Learn Presentation
Still Game to Learn PresentationStill Game to Learn Presentation
Still Game to Learn PresentationDouglas Morrison
 
Beyond Simple MCQs
Beyond Simple MCQsBeyond Simple MCQs
Beyond Simple MCQsKenji Lamb
 
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Michael Rys
 
Design and further development of an evidence-based framework for technology-...
Design and further development of an evidence-based framework for technology-...Design and further development of an evidence-based framework for technology-...
Design and further development of an evidence-based framework for technology-...College Development Network
 
How to Fail Your Research Degree - A Game to Enhance Research Skills
How to Fail Your Research Degree - A Game to Enhance Research SkillsHow to Fail Your Research Degree - A Game to Enhance Research Skills
How to Fail Your Research Degree - A Game to Enhance Research SkillsCollege Development Network
 
Clipper - Enhancing Time-Based Media for Research
Clipper - Enhancing Time-Based Media for ResearchClipper - Enhancing Time-Based Media for Research
Clipper - Enhancing Time-Based Media for ResearchCollege Development Network
 
Moodle Development Best Pracitces
Moodle Development Best PracitcesMoodle Development Best Pracitces
Moodle Development Best PracitcesJustin Filip
 
Database Design Slide 1
Database Design Slide 1Database Design Slide 1
Database Design Slide 1ahfiki
 

Viewers also liked (16)

Sql query performance analysis
Sql query performance analysisSql query performance analysis
Sql query performance analysis
 
Learning & Teaching with Animations and Games
Learning & Teaching with Animations and GamesLearning & Teaching with Animations and Games
Learning & Teaching with Animations and Games
 
Still Game to Learn Presentation
Still Game to Learn PresentationStill Game to Learn Presentation
Still Game to Learn Presentation
 
Beyond Simple MCQs
Beyond Simple MCQsBeyond Simple MCQs
Beyond Simple MCQs
 
Gaining Buy-in for ED&I through Digital Badges
Gaining Buy-in for ED&I through Digital BadgesGaining Buy-in for ED&I through Digital Badges
Gaining Buy-in for ED&I through Digital Badges
 
BBC Micro:bit Introduction
BBC Micro:bit IntroductionBBC Micro:bit Introduction
BBC Micro:bit Introduction
 
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
 
Design and further development of an evidence-based framework for technology-...
Design and further development of an evidence-based framework for technology-...Design and further development of an evidence-based framework for technology-...
Design and further development of an evidence-based framework for technology-...
 
How to Fail Your Research Degree - A Game to Enhance Research Skills
How to Fail Your Research Degree - A Game to Enhance Research SkillsHow to Fail Your Research Degree - A Game to Enhance Research Skills
How to Fail Your Research Degree - A Game to Enhance Research Skills
 
TinCan & Learning Record Stores in Moodle
TinCan & Learning Record Stores in MoodleTinCan & Learning Record Stores in Moodle
TinCan & Learning Record Stores in Moodle
 
Clipper - Enhancing Time-Based Media for Research
Clipper - Enhancing Time-Based Media for ResearchClipper - Enhancing Time-Based Media for Research
Clipper - Enhancing Time-Based Media for Research
 
Technology Update - New College Lanarkshire
Technology Update - New College LanarkshireTechnology Update - New College Lanarkshire
Technology Update - New College Lanarkshire
 
Technology Enhanced Learning @ SERC
Technology Enhanced Learning @ SERCTechnology Enhanced Learning @ SERC
Technology Enhanced Learning @ SERC
 
Moodle Development Best Pracitces
Moodle Development Best PracitcesMoodle Development Best Pracitces
Moodle Development Best Pracitces
 
100 sql queries
100 sql queries100 sql queries
100 sql queries
 
Database Design Slide 1
Database Design Slide 1Database Design Slide 1
Database Design Slide 1
 

Similar to Running SQL Queries on the Moodle Database

Best Practices In Moodle Administration
Best Practices In Moodle AdministrationBest Practices In Moodle Administration
Best Practices In Moodle Administrationmoorejon
 
Best practices in Moodle administration Monatana Moot 2014
Best practices in Moodle administration Monatana Moot 2014Best practices in Moodle administration Monatana Moot 2014
Best practices in Moodle administration Monatana Moot 2014moorejon
 
Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4Tejas Purohit
 
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the Data
DevOps and Decoys  How to Build a Successful Microsoft DevOps Including the DataDevOps and Decoys  How to Build a Successful Microsoft DevOps Including the Data
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the DataKellyn Pot'Vin-Gorman
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Drupalcon Paris
 
Midwest PHP - Scaling Magento
Midwest PHP - Scaling MagentoMidwest PHP - Scaling Magento
Midwest PHP - Scaling MagentoMathew Beane
 
Drupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal ConceptsDrupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal ConceptsMicky Metts
 
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopersBryan Cafferky
 
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...Frederic Descamps
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Phase2
 
Geek Sync | Deployment and Management of Complex Azure Environments
Geek Sync | Deployment and Management of Complex Azure EnvironmentsGeek Sync | Deployment and Management of Complex Azure Environments
Geek Sync | Deployment and Management of Complex Azure EnvironmentsIDERA Software
 
Building perfect sql servers, every time -oops
Building perfect sql servers, every time -oopsBuilding perfect sql servers, every time -oops
Building perfect sql servers, every time -oopsJoseph D'Antoni
 

Similar to Running SQL Queries on the Moodle Database (20)

Moving to moodle 2
Moving to moodle 2Moving to moodle 2
Moving to moodle 2
 
Best Practices In Moodle Administration
Best Practices In Moodle AdministrationBest Practices In Moodle Administration
Best Practices In Moodle Administration
 
Best practices in Moodle administration Monatana Moot 2014
Best practices in Moodle administration Monatana Moot 2014Best practices in Moodle administration Monatana Moot 2014
Best practices in Moodle administration Monatana Moot 2014
 
Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4Ahmedabad MuleSoft Meetup #4
Ahmedabad MuleSoft Meetup #4
 
Cloud Orchestration is Broken
Cloud Orchestration is BrokenCloud Orchestration is Broken
Cloud Orchestration is Broken
 
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the Data
DevOps and Decoys  How to Build a Successful Microsoft DevOps Including the DataDevOps and Decoys  How to Build a Successful Microsoft DevOps Including the Data
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the Data
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
Drupal -Introduction to Drupal
Drupal -Introduction to DrupalDrupal -Introduction to Drupal
Drupal -Introduction to Drupal
 
Midwest PHP - Scaling Magento
Midwest PHP - Scaling MagentoMidwest PHP - Scaling Magento
Midwest PHP - Scaling Magento
 
Drupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal ConceptsDrupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal Concepts
 
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopers
 
72d5drupal
72d5drupal72d5drupal
72d5drupal
 
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
 
Instant hadoop of your own
Instant hadoop of your ownInstant hadoop of your own
Instant hadoop of your own
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7
 
Geek Sync | Deployment and Management of Complex Azure Environments
Geek Sync | Deployment and Management of Complex Azure EnvironmentsGeek Sync | Deployment and Management of Complex Azure Environments
Geek Sync | Deployment and Management of Complex Azure Environments
 
Drupal intro
Drupal introDrupal intro
Drupal intro
 
Drupal intro
Drupal introDrupal intro
Drupal intro
 
Movingto moodle2 v1 1
Movingto moodle2 v1 1Movingto moodle2 v1 1
Movingto moodle2 v1 1
 
Building perfect sql servers, every time -oops
Building perfect sql servers, every time -oopsBuilding perfect sql servers, every time -oops
Building perfect sql servers, every time -oops
 

More from College Development Network

Virtual Bridge Sessions: Making Delivery Online Work for Everyone
Virtual Bridge Sessions: Making Delivery Online Work for EveryoneVirtual Bridge Sessions: Making Delivery Online Work for Everyone
Virtual Bridge Sessions: Making Delivery Online Work for EveryoneCollege Development Network
 
Scottish Moodle User Group (SMUG): Blackboard Ally & Moodle
Scottish Moodle User Group (SMUG): Blackboard Ally & MoodleScottish Moodle User Group (SMUG): Blackboard Ally & Moodle
Scottish Moodle User Group (SMUG): Blackboard Ally & MoodleCollege Development Network
 
Scottish Moodle User Group (SMUG): Blackboard Ally & Moodle
Scottish Moodle User Group (SMUG): Blackboard Ally & MoodleScottish Moodle User Group (SMUG): Blackboard Ally & Moodle
Scottish Moodle User Group (SMUG): Blackboard Ally & MoodleCollege Development Network
 
Virtual Bridge Sessions: Approaches to Learning and Teaching during Remote De...
Virtual Bridge Sessions: Approaches to Learning and Teaching during Remote De...Virtual Bridge Sessions: Approaches to Learning and Teaching during Remote De...
Virtual Bridge Sessions: Approaches to Learning and Teaching during Remote De...College Development Network
 
Virtual Bridge Sessions: Hybrid Delivery - Best of Both Worlds
Virtual Bridge Sessions: Hybrid Delivery - Best of Both WorldsVirtual Bridge Sessions: Hybrid Delivery - Best of Both Worlds
Virtual Bridge Sessions: Hybrid Delivery - Best of Both WorldsCollege Development Network
 
Virtual Bridge Sessions: Social Media, Esports and Copyright - Friends or Foes?
Virtual Bridge Sessions: Social Media, Esports and Copyright - Friends or Foes?Virtual Bridge Sessions: Social Media, Esports and Copyright - Friends or Foes?
Virtual Bridge Sessions: Social Media, Esports and Copyright - Friends or Foes?College Development Network
 
Virtual Bridge Sessions: The National Cyber Security Centre at Your Service
Virtual Bridge Sessions: The National Cyber Security Centre at Your ServiceVirtual Bridge Sessions: The National Cyber Security Centre at Your Service
Virtual Bridge Sessions: The National Cyber Security Centre at Your ServiceCollege Development Network
 
Virtual Bridge Sessions: Managing and Supporting Staff Who Are Delivering Rem...
Virtual Bridge Sessions: Managing and Supporting Staff Who Are Delivering Rem...Virtual Bridge Sessions: Managing and Supporting Staff Who Are Delivering Rem...
Virtual Bridge Sessions: Managing and Supporting Staff Who Are Delivering Rem...College Development Network
 
Virtual Bridge Sessions: Key Messages from Research on Blended or Digital Lea...
Virtual Bridge Sessions: Key Messages from Research on Blended or Digital Lea...Virtual Bridge Sessions: Key Messages from Research on Blended or Digital Lea...
Virtual Bridge Sessions: Key Messages from Research on Blended or Digital Lea...College Development Network
 
Virtual Bridge Sessions: Messages from international experiences
Virtual Bridge Sessions: Messages from international experiencesVirtual Bridge Sessions: Messages from international experiences
Virtual Bridge Sessions: Messages from international experiencesCollege Development Network
 
Public Sector Accessibility Guidelines: What you need to know (and do!)
Public Sector Accessibility Guidelines: What you need to know (and do!)Public Sector Accessibility Guidelines: What you need to know (and do!)
Public Sector Accessibility Guidelines: What you need to know (and do!)College Development Network
 
Enhancing Performance through Data-led Decision Making
Enhancing Performance through Data-led Decision MakingEnhancing Performance through Data-led Decision Making
Enhancing Performance through Data-led Decision MakingCollege Development Network
 

More from College Development Network (20)

Virtual Bridge Sessions: Making Delivery Online Work for Everyone
Virtual Bridge Sessions: Making Delivery Online Work for EveryoneVirtual Bridge Sessions: Making Delivery Online Work for Everyone
Virtual Bridge Sessions: Making Delivery Online Work for Everyone
 
Scottish Moodle User Group (SMUG): Blackboard Ally & Moodle
Scottish Moodle User Group (SMUG): Blackboard Ally & MoodleScottish Moodle User Group (SMUG): Blackboard Ally & Moodle
Scottish Moodle User Group (SMUG): Blackboard Ally & Moodle
 
Scottish Moodle User Group (SMUG): Blackboard Ally & Moodle
Scottish Moodle User Group (SMUG): Blackboard Ally & MoodleScottish Moodle User Group (SMUG): Blackboard Ally & Moodle
Scottish Moodle User Group (SMUG): Blackboard Ally & Moodle
 
Virtual Bridge Sessions: Approaches to Learning and Teaching during Remote De...
Virtual Bridge Sessions: Approaches to Learning and Teaching during Remote De...Virtual Bridge Sessions: Approaches to Learning and Teaching during Remote De...
Virtual Bridge Sessions: Approaches to Learning and Teaching during Remote De...
 
MIS Network Event: Sector Update
MIS Network Event: Sector UpdateMIS Network Event: Sector Update
MIS Network Event: Sector Update
 
MIS Network Event: SFC Update
MIS Network Event: SFC UpdateMIS Network Event: SFC Update
MIS Network Event: SFC Update
 
Digital ID cards at New College Lanarkshire
Digital ID cards at New College LanarkshireDigital ID cards at New College Lanarkshire
Digital ID cards at New College Lanarkshire
 
Virtual Bridge Sessions: Hybrid Delivery - Best of Both Worlds
Virtual Bridge Sessions: Hybrid Delivery - Best of Both WorldsVirtual Bridge Sessions: Hybrid Delivery - Best of Both Worlds
Virtual Bridge Sessions: Hybrid Delivery - Best of Both Worlds
 
Virtual Bridge Sessions: Social Media, Esports and Copyright - Friends or Foes?
Virtual Bridge Sessions: Social Media, Esports and Copyright - Friends or Foes?Virtual Bridge Sessions: Social Media, Esports and Copyright - Friends or Foes?
Virtual Bridge Sessions: Social Media, Esports and Copyright - Friends or Foes?
 
Virtual Bridge Sessions: The National Cyber Security Centre at Your Service
Virtual Bridge Sessions: The National Cyber Security Centre at Your ServiceVirtual Bridge Sessions: The National Cyber Security Centre at Your Service
Virtual Bridge Sessions: The National Cyber Security Centre at Your Service
 
Virtual Bridge Sessions: Managing and Supporting Staff Who Are Delivering Rem...
Virtual Bridge Sessions: Managing and Supporting Staff Who Are Delivering Rem...Virtual Bridge Sessions: Managing and Supporting Staff Who Are Delivering Rem...
Virtual Bridge Sessions: Managing and Supporting Staff Who Are Delivering Rem...
 
Virtual Bridge Sessions: Pedagogy Matters
Virtual Bridge Sessions: Pedagogy MattersVirtual Bridge Sessions: Pedagogy Matters
Virtual Bridge Sessions: Pedagogy Matters
 
Virtual Bridge Sessions: Key Messages from Research on Blended or Digital Lea...
Virtual Bridge Sessions: Key Messages from Research on Blended or Digital Lea...Virtual Bridge Sessions: Key Messages from Research on Blended or Digital Lea...
Virtual Bridge Sessions: Key Messages from Research on Blended or Digital Lea...
 
Virtual Bridge Sessions: Messages from international experiences
Virtual Bridge Sessions: Messages from international experiencesVirtual Bridge Sessions: Messages from international experiences
Virtual Bridge Sessions: Messages from international experiences
 
Public Sector Accessibility Guidelines: What you need to know (and do!)
Public Sector Accessibility Guidelines: What you need to know (and do!)Public Sector Accessibility Guidelines: What you need to know (and do!)
Public Sector Accessibility Guidelines: What you need to know (and do!)
 
Enhancing Performance through Data-led Decision Making
Enhancing Performance through Data-led Decision MakingEnhancing Performance through Data-led Decision Making
Enhancing Performance through Data-led Decision Making
 
FES Update Summary
FES Update SummaryFES Update Summary
FES Update Summary
 
MyDay Portal
MyDay PortalMyDay Portal
MyDay Portal
 
Online Enrolment and “Onboarding”
Online Enrolment and “Onboarding”Online Enrolment and “Onboarding”
Online Enrolment and “Onboarding”
 
Post-College Destination Data
Post-College Destination DataPost-College Destination Data
Post-College Destination Data
 

Recently uploaded

Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 

Recently uploaded (20)

Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 

Running SQL Queries on the Moodle Database

  • 1. Running SQL Queries on the Moodle Database An overview 18 November 2016
  • 2. Tools available • Moodle Adminer • Ad-hoc Database Queries • Configurable Reports • PHP MyAdmin
  • 3. Moodle Adminer • The ‘work horse’ • SQL in, information out • Aimed at Admins • Powerful for large queries • Slick authoring of queries • Robust browsing of tables • So what’s the catch?
  • 4.
  • 5.
  • 6. Moodle Adminer Great so I can edit the database directly? Technically speaking yes…
  • 7. Moodle Adminer Installation and set up The plugin installs like any other Moodle plugin, in the local folder and can be found at Site Administration > Server Top Tip: If your Database Server has multiple databases, consider using moodleuser or similar in your config.php (create if needed)
  • 8. Moodle Adminer Demo SELECT fullname, shortname FROM mdl_course ORDER BY fullname ASC
  • 9. Ad Hoc SQL Installation and set up The plugin installs like any other Moodle plugin, in the reports folder and can be found at Site Administration > Reports
  • 10. Ad Hoc SQL • Write once, run many • Great for delegating running of queries to curriculum managers • Not 100% foolproof • Elegant • Easy to use • Timer and Email utilisation
  • 12. Configurable Reports • Very user friendly • Elegantly formatted output • Can be applied at course level as a block
  • 13. Configurable Reports Installation and set up The plugin installs like any other Moodle plugin, in the block folder and can be added at course level
  • 14. PHP My Admin Installation and set up Installed as a fully fledged application at server level.
  • 15. Managing the Databases Dumps We do this through command line mysqldump –u root –p –h localhost moodle > dump.sql -v (verbose mode)
  • 16. Managing the Databases Find and Replace We do this through command line, but the replace tool is also useful sed –i ‘s/moodle.westcollegescotland.ac.uk/moodle14.westcollege scotland.ac.uk/g’ ./dump.sql (sed is a Linux tool)
  • 18. Managing the Databases Imports We do this through command line too mysql –u root –p –h localhost moodle < dump.sql -v (verbose mode)