Bird
Raised Fist0
DBMS Theoryknowledge~10 mins

Types of databases (relational, NoSQL, object-oriented) in DBMS Theory - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select all columns from a relational database table named 'employees'.

DBMS Theory
SELECT [1] FROM employees;
Drag options to blanks, or click blank then click option'
AALL_COLUMNS
BALL
CEVERY
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using words like ALL or EVERY instead of the symbol *.
Trying to write the column names manually when all columns are needed.
2fill in blank
medium

Complete the code to insert a document into a NoSQL database collection named 'users'.

DBMS Theory
db.users.insertOne({ name: 'Alice', age: [1] });
Drag options to blanks, or click blank then click option'
A'25'
B25
C"25"
Dtwentyfive
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numbers inside quotes, which makes them strings.
Writing age as a word instead of a number.
3fill in blank
hard

Fix the error in the object-oriented database query to retrieve all objects of class 'Car'.

DBMS Theory
SELECT * FROM [1];
Drag options to blanks, or click blank then click option'
ACar
Bcar
CCAR
Dcars
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase class names which may cause errors.
Using plural form instead of the class name.
4fill in blank
hard

Fill both blanks to create a NoSQL query that finds users older than 30.

DBMS Theory
db.users.find({ age: { [1]: [2] } });
Drag options to blanks, or click blank then click option'
A$gt
B$lt
C30
D25
Attempts:
3 left
💡 Hint
Common Mistakes
Using $lt which means 'less than' instead of 'greater than'.
Using the wrong number for the age condition.
5fill in blank
hard

Fill all three blanks to create an SQL query that selects the 'name' and 'price' columns from the 'products' table where price is less than 100.

DBMS Theory
SELECT [1], [2] FROM products WHERE price [3] 100;
Drag options to blanks, or click blank then click option'
Aname
Bprice
C<
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using the greater than operator > instead of less than.
Swapping the column names or missing one.

Practice

(1/5)
1. Which type of database stores data in tables and uses SQL for queries?
easy
A. Object-oriented database
B. NoSQL database
C. Graph database
D. Relational database

Solution

  1. Step 1: Understand database types

    Relational databases organize data in tables with rows and columns.
  2. Step 2: Identify query language

    They use SQL (Structured Query Language) to manage and query data.
  3. Final Answer:

    Relational database -> Option D
  4. Quick Check:

    Tables + SQL = Relational database [OK]
Hint: Tables and SQL mean relational database [OK]
Common Mistakes:
  • Confusing NoSQL with relational because both store data
  • Thinking object-oriented databases use SQL
  • Assuming graph databases are relational
2. Which of the following is the correct way to describe a NoSQL database?
easy
A. Stores flexible data like documents or key-value pairs
B. Stores data only in tables with fixed schema
C. Stores data as objects matching programming languages
D. Uses only SQL for data queries

Solution

  1. Step 1: Recall NoSQL database features

    NoSQL databases store data flexibly, often as documents or key-value pairs.
  2. Step 2: Eliminate incorrect options

    They do not require fixed schemas or only tables, and do not rely solely on SQL.
  3. Final Answer:

    Stores flexible data like documents or key-value pairs -> Option A
  4. Quick Check:

    No fixed schema + flexible data = NoSQL [OK]
Hint: Flexible data storage means NoSQL [OK]
Common Mistakes:
  • Thinking NoSQL uses only tables
  • Confusing object-oriented with NoSQL
  • Assuming NoSQL requires SQL queries
3. Given the following description, which database type fits best?
Data is stored as objects with properties and methods, similar to programming languages.
medium
A. Relational database
B. NoSQL database
C. Object-oriented database
D. Hierarchical database

Solution

  1. Step 1: Analyze data storage style

    The data is stored as objects with properties and methods, matching programming language objects.
  2. Step 2: Match to database type

    Object-oriented databases store data as objects, unlike relational or NoSQL databases.
  3. Final Answer:

    Object-oriented database -> Option C
  4. Quick Check:

    Objects with methods = Object-oriented database [OK]
Hint: Objects with methods mean object-oriented DB [OK]
Common Mistakes:
  • Confusing object-oriented with NoSQL
  • Thinking relational databases store objects
  • Assuming hierarchical is object-oriented
4. Identify the error in this statement:
NoSQL databases always use SQL queries to retrieve data.
medium
A. No error, statement is correct
B. NoSQL databases do not use SQL queries
C. NoSQL databases only store data in tables
D. NoSQL databases are a type of relational database

Solution

  1. Step 1: Understand NoSQL query methods

    NoSQL databases typically use query methods other than SQL, like JSON queries or key-value lookups.
  2. Step 2: Identify the error

    The statement wrongly claims NoSQL always uses SQL, which is false.
  3. Final Answer:

    NoSQL databases do not use SQL queries -> Option B
  4. Quick Check:

    NoSQL ≠ SQL queries [OK]
Hint: NoSQL means no SQL queries [OK]
Common Mistakes:
  • Believing NoSQL uses SQL
  • Confusing NoSQL with relational
  • Thinking NoSQL stores only tables
5. A company wants to store user profiles with flexible fields that can change often, and also wants to store some complex objects with methods for processing. Which combination of databases should they use?
hard
A. A NoSQL database for flexible data and an object-oriented database for complex objects
B. Only a relational database
C. Only a NoSQL database
D. Only an object-oriented database

Solution

  1. Step 1: Analyze data needs

    Flexible fields suggest NoSQL for schema flexibility; complex objects with methods suggest object-oriented database.
  2. Step 2: Choose suitable combination

    Using both NoSQL and object-oriented databases fits the requirements best.
  3. Final Answer:

    A NoSQL database for flexible data and an object-oriented database for complex objects -> Option A
  4. Quick Check:

    Flexible + complex objects = NoSQL + object-oriented [OK]
Hint: Use NoSQL for flexible, object-oriented for complex objects [OK]
Common Mistakes:
  • Choosing only relational database ignoring flexibility
  • Using only NoSQL and ignoring object methods
  • Assuming object-oriented alone handles flexible fields
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard