Pie Logo
Quiz: SQL vs NoSQL Databases
by Tomas Trescak

QuizTest your understanding of the section content.

ContentDetailed description of the section content.

Full Stack Development
Introduction
Generative AI
🍰 Player
💼 Editor
Setup
React Fundamentals
Next.js
Advanced React
Databases
Fetching Data
SQL vs No-SQL Databases
Exercise: Databases
Quiz: SQL vs NoSQL Databases
Prisma and ORM
Seeding and Migrations
Search and Pagination
Server Actions
Client-Side Mutations
Validations and Error Handling
Assignment 2.2: Blog - Admin
React Hooks
Authentication and Authorisation
APIs
CI/CD and DevOps
Testing React
Advanced Topics
    Pie Logo
    Quiz: SQL vs NoSQL Databases
    by Tomas Trescak

    QuizTest your understanding of the section content.

    ContentDetailed description of the section content.

    Full Stack Development
    Introduction
    Generative AI
    🍰 Player
    💼 Editor
    Setup
    React Fundamentals
    Next.js
    Advanced React
    Databases
    Fetching Data
    SQL vs No-SQL Databases
    Exercise: Databases
    Quiz: SQL vs NoSQL Databases
    Prisma and ORM
    Seeding and Migrations
    Search and Pagination
    Server Actions
    Client-Side Mutations
    Validations and Error Handling
    Assignment 2.2: Blog - Admin
    React Hooks
    Authentication and Authorisation
    APIs
    CI/CD and DevOps
    Testing React
    Advanced Topics

    SQL vs NoSQL
    by Tomas Trescak· SQL vs No-SQL Databases

    QUESTION 1

    Your blogging app needs to generate a report showing the number of posts per tag for January 2025. Based on the lecture’s examples, which database and query approach would handle this efficiently?


    QUESTION 2

    In the lecture’s Next.js app, the SQL code uses this query to fetch posts by tag:

    SELECT p.id, p.title, p.content, p.date
    FROM posts p
    JOIN post_tags pt ON p.id = pt.post_id
    JOIN tags t ON t.id = pt.tag_id
    WHERE t.name = $1
    

    What happens if the post_tags table is empty?


    QUESTION 3

    Imagine your blogging app grows, and users demand a new feature: embedding images in posts. Which database setup from the lecture would handle this change with the least rework?


    QUESTION 4

    You’re prototyping the blogging app quickly for a demo. Based on the lecture, which database choice and reasoning make the most sense?


    QUESTION 5

    Look at this NoSQL code from the lecture:

    async function getPostsByTag(tag: string): Promise<Post[]> {
      await client.connect();
      const db = client.db('blog_db');
      const posts = await db.collection('posts').find({ tags: tag }).toArray();
      return posts as Post[];
    }
    

    Your app now needs posts with multiple tags (e.g., "tech" AND "intro"). Which modification works?


    QUESTION 6

    Your blogging app’s admin wants to filter posts by date range and tag, like "all tech posts from January 2025." Which database(s) from the lecture can handle this easily?

    This content is only available to registered users.
    Please register at the the home page.

    SQL vs NoSQL
    by Tomas Trescak· SQL vs No-SQL Databases

    QUESTION 1

    Your blogging app needs to generate a report showing the number of posts per tag for January 2025. Based on the lecture’s examples, which database and query approach would handle this efficiently?


    QUESTION 2

    In the lecture’s Next.js app, the SQL code uses this query to fetch posts by tag:

    SELECT p.id, p.title, p.content, p.date
    FROM posts p
    JOIN post_tags pt ON p.id = pt.post_id
    JOIN tags t ON t.id = pt.tag_id
    WHERE t.name = $1
    

    What happens if the post_tags table is empty?


    QUESTION 3

    Imagine your blogging app grows, and users demand a new feature: embedding images in posts. Which database setup from the lecture would handle this change with the least rework?


    QUESTION 4

    You’re prototyping the blogging app quickly for a demo. Based on the lecture, which database choice and reasoning make the most sense?


    QUESTION 5

    Look at this NoSQL code from the lecture:

    async function getPostsByTag(tag: string): Promise<Post[]> {
      await client.connect();
      const db = client.db('blog_db');
      const posts = await db.collection('posts').find({ tags: tag }).toArray();
      return posts as Post[];
    }
    

    Your app now needs posts with multiple tags (e.g., "tech" AND "intro"). Which modification works?


    QUESTION 6

    Your blogging app’s admin wants to filter posts by date range and tag, like "all tech posts from January 2025." Which database(s) from the lecture can handle this easily?

    This content is only available to registered users.
    Please register at the the home page.

    Pie Logo
    Quiz: SQL vs NoSQL Databases
    by Tomas Trescak
    Pie Logo
    Quiz: SQL vs NoSQL Databases
    by Tomas Trescak
    Full Stack Development
    Introduction
    Generative AI
    🍰 Player
    💼 Editor
    Setup
    React Fundamentals
    Next.js
    Advanced React
    Databases
    Fetching Data
    SQL vs No-SQL Databases
    Exercise: Databases
    Quiz: SQL vs NoSQL Databases
    Prisma and ORM
    Seeding and Migrations
    Search and Pagination
    Server Actions
    Client-Side Mutations
    Validations and Error Handling
    Assignment 2.2: Blog - Admin
    React Hooks
    Authentication and Authorisation
    APIs
    CI/CD and DevOps
    Testing React
    Advanced Topics
    Full Stack Development
    Introduction
    Generative AI
    🍰 Player
    💼 Editor
    Setup
    React Fundamentals
    Next.js
    Advanced React
    Databases
    Fetching Data
    SQL vs No-SQL Databases
    Exercise: Databases
    Quiz: SQL vs NoSQL Databases
    Prisma and ORM
    Seeding and Migrations
    Search and Pagination
    Server Actions
    Client-Side Mutations
    Validations and Error Handling
    Assignment 2.2: Blog - Admin
    React Hooks
    Authentication and Authorisation
    APIs
    CI/CD and DevOps
    Testing React
    Advanced Topics