This PHP, MySQL, and SQL Online Test Separates Good From Bad Hires

Check our public questions below

Solve questions to get feedback or
take a practice test and get a free certificate.

Screen with work-sample questions

Work-samples are the best predictor of work performance. 8,000+ companies use TestDome premium questions.

About the test

The PHP, MySQL and SQL online test assesses candidates' knowledge of programming in the PHP language, as well as their ability to use MySQL and SQL.

It's an ideal test for pre-employment screening. A good PHP developer, who is working exclusively on an MySQL server database layer, needs to not only solve problems using PHP, but also to write and analyze SQL queries that are used for communication with the database and to use MySQL-specific features to interface efficiently with a database. 

This online test requires candidates to solve coding problems in PHP, answer multiple-choice questions about MySQL, write queries and stored procedures for MySQL, and write SQL queries that extract, combine, and manipulate data.

Sample public questions

Easy
3 min
mca
Public
MySQL
Pagination

Consider the following table:

CREATE TABLE users (
  id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  username VARCHAR(50) NOT NULL
);

The following query is used to paginate the table:

SELECT * FROM users ORDER BY username LIMIT 5 OFFSET 15;

Select all the true statements about this method of pagination.

Easy
5 min
mca
Public
PHP
Sanitization
Validation

You're maintaining the PHP back-end of a Tree Planting website.

The registerForEvent function is called by the server when interested people fill a form to register for a tree planting event.

The register function it calls performs the registration logic.

Consider the code for the registerForEvent function:

function registerForEvent($name, $seedBagsNeeded)
{
    $sanitizedName = filter_var($name, FILTER_SANITIZE_SPECIAL_CHARS);
    $filteredBagsNeeded = filter_var($seedBagsNeeded, FILTER_VALIDATE_INT);
    register($sanitizedName, $filteredBagsNeeded);
}

What is correct about the filtering and sanitization done in the code above?

Easy
7 min
code
Public
SQL
Aggregation
Group by
Select

App usage data are kept in the following table:

TABLE sessions
  id INTEGER PRIMARY KEY,
  userId INTEGER NOT NULL,
  duration DECIMAL NOT NULL

Write a query that selects userId and average session duration for each user who has more than one session.

See the example case for more details.

For jobseekers: get certified

Earn a free certificate by achieving top 25% on the PHP, MySQL, and SQL test with public questions.

Take a Certification Test

Sample silver certificate

Sunshine Caprio

Java and SQL

TestDome
Certificate

TestDome logo on certificate

For companies: premium questions

Buy TestDome to access premium questions that can't be practiced.
Get money back if you find any premium question answered online.

Sign Up to Offer this Test

86 more premium PHP, MySQL, and SQL questions

Last Key, Height, Shipping, Dot Items, Cargo Concat, JSON Stock, Array Sum, Category Tree, Hobbies, Paragraph, Products, Username, View Count, Language Teacher, Crop Ratio, Log Parser, Kilometer Converter, String Occurrence, Employee Sales, Array Search, Roads, Authors, Autocomplete, Bank Branches, Cheapest Product, Countries, Developers, Hospital Patients, Index Performance, Menu Items, Movies, Projects, Rectangles, Restaurant Menu, Retirees, SMS Messages, Poll, Users and Accounts, Matching Clothes, Agents, Manager Sales, Bill Discount, Cultivated Fields, Reservations Report, Accounts Trigger, Root Menu, Sales, Employee Manager, Auto Show, Delete Orders, Welfare Organization, Tasks, Manager Sales, Student Rankings, Student Activities, Youngest Child, Movies Live, Department Report, Ingredients, Average Salary, Movie Genres, Segment, River Discharge, ATM Locations, Cookie, Customer Paging, Read Write Execute, Read First Line, Filter, Transactions, Fire Dragon, Unique Numbers, Shipping Service, Action Stack, Flower Shop, PC Parts Seller, Merge Stock Index, Date Transform, Greeter, Ban Users, Chain Link, Employee Tree, Numbers To Text, Vectors, Student Max Score, Special Actions.

Skills and topics tested

  • PHP
  • Arrays
  • Arithmetic
  • Language
  • MySQL
  • String Functions
  • Aggregation
  • JSON
  • Pass by Reference
  • Associative Arrays
  • Exceptions
  • Iteration
  • Regex
  • Strings
  • Serialization
  • Sorting
  • Inheritance
  • OOP
  • Bug Fixing
  • Integer Division
  • XML
  • Method Overriding
  • Stream
  • Window Functions
  • Recursion
  • SQL
  • Conditions
  • Views
  • Select
  • Create Index
  • Database Schema
  • Performance Tuning
  • Constraints
  • Create Table
  • Subqueries
  • Ordering
  • Indexes
  • Alter Table
  • Group by
  • Update
  • Insert
  • Joins
  • Left Join
  • Right Join
  • CTE
  • Cursors
  • Stored Procedure
  • Date Functions
  • Triggers
  • Delete
  • SQL CASE
  • Union
  • Database Normalization
  • Session
  • Pagination
  • Interfaces
  • Algorithmic Thinking
  • Callback
  • Stack
  • Null Coalescing Operator
  • Classes
  • Properties
  • Linked List

For job roles

    Sample candidate report

    What others say

    Decorative quote

    Simple, straight-forward technical testing

    TestDome is simple, provides a reasonable (though not extensive) battery of tests to choose from, and doesn't take the candidate an inordinate amount of time. It also simulates working pressure with the time limits.

    Jan Opperman, Grindrod Bank

    Product reviews

    G2 High Performer 2022G2 Read Our Reviews

    Used by

    Solve all your skill testing needs

    150+ Pre-made tests

    From web development and database administration to project management and customer support. See all pre-made tests.

    90+ skills

    From JavaScript and SQL to English and customer support. See all questions to filter by skill.

    Multi-skills Test

    Mix questions for different skills or even custom questions in one test. See an example.

    How TestDome works

    1

    Choose a pre-made test
    or create a custom test

    2

    Invite candidates via
    email, URL, or your ATS

    3

    Candidates take
    a test remotely

    4

    Sort candidates and
    get individual reports

    Want to know more?

    Not exactly what you're looking for?

    Related PHP, MySQL, and SQL Programming Tests: