SHS Computing · Year 3

Building a Database-Driven E-commerce Site practice questions

Setting up a local web server with XAMPP (Apache and MySQL), creating databases and tables in phpMyAdmin, field names, data types, lengths and auto-increment keys, adding records with SQL INSERT and querying with conditions, building a simple shop page in VS Code with HTML and a linked style sheet, relative file paths, and connecting a page to a MySQL database with PHP.

21 questions in this topic: 6 applying skills and concepts, 12 strategic thinking and 3 extended thinking. Every one carries a written explanation.

Sample questions

3 of 21 questions in this topic. Sign up to answer them and see the explanations.

  1. Question 1Extended thinking

    A school wants a site where parents check their child's fees balance. Which design is sound?

    • aA static HTML page listing every student's balance for anyone at all to read
    • bA PHP page that queries a fees table by the logged-in parent's student ID
    • cA spreadsheet e-mailed to all parents each week with all the balances
    • dA CSS file that stores each balance as a colour on the page
  2. Question 2Strategic thinking

    Which data type is most suitable for a product name field that may hold up to 100 characters?

    • aINT
    • bDECIMAL(8,2)
    • cVARCHAR(100)
    • dBOOLEAN
  3. Question 3Skills & concepts

    In a products table, why is the id field usually set to AUTO_INCREMENT?

    • aIt makes each product's price rise by one cedi every day
    • bEach new row gets the next unique number automatically
    • cIt allows two products to share the same id without errors
    • dIt sorts the products alphabetically each time one is added

Answer these and 18 more on Building a Database-Driven E-commerce Site

Free account. Instant marking, a written explanation for every question.

Start practising free

More Computing Year 3 topics

All Computing topics