Database1

Database1

9th - 12th Grade

7 Qs

quiz-placeholder

Similar activities

SQL Injection

SQL Injection

10th Grade

10 Qs

Quiz de Bases de Datos

Quiz de Bases de Datos

10th Grade

10 Qs

SQL

SQL

10th Grade

10 Qs

Grade 10 FT Quiz1 - Intro to SQL

Grade 10 FT Quiz1 - Intro to SQL

10th Grade

10 Qs

CA - Chapter 3 Book back

CA - Chapter 3 Book back

12th Grade

10 Qs

Latihan Soal Assesmen Sumatif

Latihan Soal Assesmen Sumatif

11th Grade

10 Qs

SQL Quiz - La Select

SQL Quiz - La Select

12th Grade - University

12 Qs

Database fundamentals III

Database fundamentals III

11th Grade

8 Qs

Database1

Database1

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Dhilma Dhilma

Used 3+ times

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does SQL stand for?

Structured Query Language

Server Query Lanuage

Stylish Query Lingo

Super Quantum Logic

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the name of the SQL database that comes distributed with Python?

SQLite

PostgreSQL

MySQL

PySQL

Answer explanation

There are numerous SQL databases, and some are better suited to particular purposes than others. One of the simplest, most lightweight SQL databases is SQLite, which runs directly on your machine and comes bundled with Python automatically.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following code snippets creates and connects to a new SQLite Database?

Media Image
Media Image
Media Image
Media Image

Answer explanation

The sqlite3.connect() function is used to connect to, or create, a database. When you execute .connect("test_database.db"), Python searches for an existing database called "test_database.db".

If no database with that name is found, a new one is created in the current working directory. To create a database in a different directory, you must specify the full path in the argument to .connect().

4.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which of the following are valid Cursor methods used to execute SQL statements and retrieve query results? Select all that apply.

Cursor.fetchall()

Cursor.fetchone()

Cursor.execute()

Cursor.fetchmany()

Answer explanation

Cursor objects are used to execute SQL statements and retrieve query results. For example, Cursor.execute() and Cursor.executescript() are used to execute SQL queries. You can retrieve query results using the Cursor.fetchone() and Cursor.fetchall() methods.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the type of the results variable in the following code snippet?

tuple

list

dict

QuerySet

Answer explanation

The Cursor.fetchall() method returns the results of a query as a list of tuples, where each tuple contains the data from a single row in the query results.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which command is used to create a new database in SQLite?


CREATE DATABASE

CREATE SCHEMA


CREATE TABLE

CREATE DATABASE TABLE

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a primary key in a SQLite database?

A unique identifier for each row in a table


A foreign key in a related table

A column that stores binary data


A special type of index for sorting data