Get All Weeks Introduction to Databases Coursera Quiz Answers
Table of Contents
Week 1: Introduction to Databases Coursera Quiz Answers
Quiz 1: Knowledge check: Databases and data
Question 1: What is a Database in computing?
- A collection of organized data stored and accessed electronically.
- A collection of tables of data stored and accessed electronically.
Question 2: Which database model uses only tables to store data?
ViewQuestion 3: Which of the following is a key advantage of organizing data in tables?
ViewQuestion 4: The foreign key can be used to identify a specific record of data in a relational database.
ViewQuestion 5: Big data contains a wide variety of data, arriving in increasing volumes and at high velocities.
ViewQuiz 2: Knowledge check: SQL syntax review
Question 1: What makes SQL a popular database language? Select all that apply.
2.It is an easy programming language to understand and learn.
Question 2: Which of the following commands belong to the SQL data manipulation language (DML)? Select all that apply.
View2.Update
3.Insert
Question 3: The SELECT command should be used to retrieve data from a database table.
ViewQuestion 4: Which SQL syntax should be used to create a student table?
ViewQuestion 5: Choose the correct syntax to create a college database in SQL.
ViewQuiz 3: Knowledge check: Database structure
Question 1: What term is used to describe the complete information about one specific staff member in a college database that contains data about staff?
View- Table
- Column
- Record
Question 2: What is the minimum number of tables that must be present in a relational database?
ViewQuestion 3: What is the name of the attribute that is chosen in the database to uniquely identify each record in a table?
ViewQuestion 4: Which attribute could be used as a primary key in the following customer table?
Customer-first name | Customer last name | Customer email address |
Carl | Anderson | [email protected] |
Mark | Jacky | [email protected] |
Question 5: Which of the following keys can you select as the primary key in a relational database? Select all that apply.
View2.Candidate Key
Quiz 4: Module quiz: Introduction to Databases
Question 1: What is the most used database type in computing?
ViewQuestion 2: Which one of the following is an advantage of storing data in tables?
ViewQuestion 3: In a bookshop database, the complete information about one specific book is referred to as a ______________.
ViewQuestion 4: What makes SQL a very popular database language? Select all that apply.
ViewQuestion 5: Which SQL command is used to update data in a database table?
ViewQuestion 6: Which of the following database management systems uses the SQL language? Select all that apply.
View2.MySQL
3.PostgreSQL
Question 7: What is the importance of a candidate key in a database?
View- A candidate key can be used to uniquely identify rows in a table.
- A candidate key can be used to encrypt data in a table.
- A candidate key can be used to drop a table.
Question 8: In the following student table, which attribute could be used as a primary key?
Student first name | Student last name | Mobile number |
Carl | Merlo | 07445532123 |
Mark | Nero | 07456532327 |
Question 9: CREATE TABLE student is the right syntax to create a student table in SQL.
ViewQuestion 10: Choose the right syntax to create a club database in SQL. Select all correct answers.
View2.create database club
Week 2: Introduction to Databases Coursera Quiz Answers
Quiz 1: Self-review: Working with strings
Question 1: A college database contains a table called “Students” that has three columns: username, full name and email address. The username column contains alphanumeric values such as “St001” and has a fixed length of five characters. Select the correct SQL syntax for the username column.
ViewQuestion 2: Which of the following SQL statements uses the right syntax to create the Student table in a college database with character limits?
ViewQuestion 3: You are sourcing feedback from students on college services. Each student can provide up to 10000 characters worth of feedback in an online form, which will then be stored in a database. Identify the correct SQL syntax to create the “Feedback” column.
ViewQuestion 4: TINYTEXT is a string data type used to define columns with small letter characters only.
ViewQuiz 2: Self-review: Working with default values
Question 1: A soccer club in London wants to create a table within their database to hold data on each player. Since most of the players are from London, the club can set “London” as the default value in the “City” column. Can you identify the correct SQL syntax to set London as the default value for this column?
ViewQuestion 2: The skill level of all new players within a soccer club must automatically be set at Level 1. Can you identify the correct SQL syntax to set each new player’s skill level using the DEFAULT keyword?
ViewQuestion 3: The following SQL statement creates a table in a soccer club database called “Players”. It also adds two default values to the table: club with a default value of “Newport FC”, and city with a default value of “Newport”.
CREATE TABLE Players (playerName VARCHAR(50), club VARCHAR (10) DEFAULT “Newport FC”, city VARCHAR (100) DEFAULT “Newport”);
ViewQuestion 4: Database default constraints are used to limit the value of data that can be stored in a table.
View- False
- True
Question 5: You are creating a new members table in the sports club database. The table must have two columns with the following default values: city ‘London’ and gender ‘female’. How many instances of the DEFAULT keyword does your SQL statement require?
ViewQuiz 3: Self-review: Choosing the right data type for a column
Question 1: A soccer club’s database includes a “Players” table. The table contains a “Player number” column that records the jersey number of each player in the team. Each jersey number is a whole number. Identify the correct data type for this column.
ViewQuestion 2: In a sports club database, the “Players” table includes a date of birth column that records the date of birth for each player. The right SQL data type to define the player date of birth is DOB VARCHAR(100).
ViewQuestion 3: Which one of the following SQL statements makes use of the correct data types to create a “Players” table in a soccer club’s database?
ViewQuestion 4: A soccer club’s database includes a staff table with three columns: username, full name and title. The username contains alphanumeric values such as: “Staff001” and has a fixed length of eight characters. Select the right SQL syntax.
ViewQuestion 5: The following SQL statement can be used to create a table called “Players”, with a default value of “Miami” for the city column.
CREATE TABLE players (playerName VARCHAR(100), city VARCHAR(50) DEFAULT “Miami”, age INT);
ViewQuiz 4: Self-review: Create a Database, create a table and insert data
Question 1: The following SQL statement can be used to create a database for a bookshop:
CREATE bookshop DATABASE
ViewQuestion 2: The following SQL statement can be used to create a “Customers” table in a bookshop database:
ViewCREATE TABLE customers (customerName VARCHAR(100), customerAddress VARCHAR(100))
Question 3: Identify the correct SQL command to insert a new record of data in a table.
ViewQuestion 4: Which of the following SQL statements can you use to insert a record for a customer named “Karl”, aged 21 into a table called “Customers”?
ViewQuestion 5: Identify the missing keyword in the following SQL statement.
INSERT INTO customers (ID, name) ____ (7, “Tom”)
ViewQuiz 5: Self-review: Practicing table creation
Question 1: Which of the following SQL syntax statements can you use to create a table? Select all that apply.
View2.CREATE TABLE table_name
Question 2: Select all steps to create a table in the database.
View2.Write the table name.
3.Use the CREATE TABLE command.
4.Define the columns of the table with relevant data types.
Question 3: Identify which of the following SQL statements can be used to create a table called “Products” for an online store. The table must contain two columns named “ID” and “Quantity.” The values within both columns must be whole numbers.
ViewQuestion 4: Which of the following SQL statements can be used to build a table that stores data about cell phone products?
ViewQuestion 5: You need to create a table called “Players”. The table must contain two columns. The first column is called “playername” and holds the names of each player as a text data type. The second column is called “playerAge” and contains the age of each player as a whole number value. Identify the correct syntax to create this table.
ViewQuiz 6: Knowledge check: Create, insert, and select
Question 1: The following SQL statement contains the syntax to create a product table with two columns ID and price:
CREATE TABLE product_table (ID, price)
ViewQuestion 2: You need to create a table for bank account records in a financial database. Which of the following SQL statements can you use to complete this task?
ViewQuestion 3: Select the right SQL statement to insert a new record of data into three columns of a table called “Games” with the following values:
GameID = 1, gameDate = 2022-10-10 and score = 3
ViewQuestion 4: A player with ID = 5, name = “Tina” and age = 23 must be added to the “Players” table for a soccer club database. Select the right SQL syntax to insert the player data into the table.
ViewQuestion 5: A hockey team requires all available data on their players for an upcoming meeting. Choose the correct SQL statement to select all data available in the players’ table
ViewQuiz 7: Self-review: Record deletion
Question 1: The correct command to remove a record from a table is: DROP FROM
ViewQuestion 2: You can delete all records of data from a table without deleting the table itself using the SQL command DELETE FROM.
ViewQuestion 3: You can delete the record of the player assigned the number seven from the table “Players” using the following SQL syntax:
DELETE FROM players WHERE playerNumber = seven ;
ViewQuestion 4: You can delete all records from a table called “Players” where the value of City is equal to “London” using the following SQL syntax:
DELETE FROM players WHERE city = “London”
ViewQuiz 8: Knowledge check: Update and Delete
Question 1: Which of the following statements is the correct command syntax to update a table in SQL?
ViewQuestion 2: What is the missing SQL keyword in the following SQL statement to update the customer’s table?
UPDATE Customers ___ ContactName = ‘Jack Molly’ WHERE CustomerID = 10;
ViewQuestion 3: Which of the following SQL statements can be used to update data for a student in the “Students” table?
ViewQuestion 4: The following table contains data about customers. The customer data should be removed completely, but without deleting the table. Identify which statement can be used to delete all records of data from the customer’s table without deleting the table itself.
Customer ID | Customer Name |
C1 | Karl |
C2 | Jack |
Question 5: The ‘WHERE’ keyword is used in SQL to specify a condition to update or delete data from a table.
ViewQuiz 9: Module quiz: Create, Read, Update and Delete (CRUD) Operations
Question 1: The following SQL clause creates a table named staff within a database:
CREATE staff TABLE;
ViewQuestion 2: The following SQL statement creates a table named staff, with two columns called name and address:
CREATE TABLE staff (name VARCHAR(100), address VARCHAR(100));
ViewQuestion 3: What is the SQL command to add a new record of data in the staff table?
ViewQuestion 4: Which is the right command syntax to update the staff table in SQL?
ViewQuestion 5: EDIT command is used to modify data in a database table.
ViewQuestion 6: Which one of the following SQL statements updates the staff email address for the individual named “Karl” in the staff table?
ViewQuestion 7: Select the right keyword to complete the missing part of the following statement:
INSERT INTO staff (ID, name) ___ (7, “Tom”);
ViewQuestion 8: A staff table consists of three columns called name, email and age. Which of the following SQL statements selects all available data in all three columns in the staff table?
Select all correct answers.
View2.SELECT * FROM staff
Question 9: The following SQL statement returns all staff phone numbers from the staff table:
SELECT phoneNumber FROM staff;
ViewQuestion 10: Which of the following SQL statements deletes all records of data from the staff table without deleting the table itself?
Select all correct answers.
View2.TRUNCATE TABLE staff
Week 3: Introduction to Databases Coursera Quiz Answers
Quiz 2: Self-review: ORDER BY and WHERE
Question 1: The ORDER BY keyword in SQL sorts the records of a table column in descending order by default.
ViewQuestion 2: The output result of the following SQL statement is the data of all customers from Germany, as “*” in this context means all columns.
SELECT * FROM customers WHERE Country = “Germany”;
ViewQuestion 3: Choose the SQL statement that shows a list of all customers who live in India organized alphabetically from A to Z within a database table named “customers”.
ViewQuestion 4: Identify the effect of the following SQL statement on the “Staff” table:
SELECT * FROM staff ORDER BY Country, StaffName
ViewQuiz 3: Module quiz: SQL operators and sorting and filtering data
Question 1: Which of the following SQL statements adds a $2.00 service fee to the total price in a table called “Orders”, that lists the price of orders customers placed with a store?
ViewQuestion 2: What does the following SQL statement do?
View2.It returns the result of total price divided by 2 for each cell in the total price column
Question 3: The following SQL statement returns 2 percent of the total price:
SELECT total % 2 FROM Orders;
ViewQuestion 4: Which of the following SQL statements returns 50% of the total price? Choose all correct answers.
ViewQuestion 5: Select the right SQL statement to display the values of the total prices that are greater than $140.
ViewQuestion 6: Does the following SQL statements sort the result-set of the total prices in ascending or descending order?
SELECT * FROM Orders ORDER BY total;
ViewQuestion 7: The following SQL statement filters data based on ____
SELECT * FROM customers WHERE Country = “Germany”;
ViewQuestion 8: In SQL you can sort records in descending order using the DESCENDING keyword.
ViewQuestion 9: The output of the following SQL query within the Orders table is: UK, UK, UK, France, France, Finland
SELECT DISTINCT Country FROM Orders;
ViewQuestion 10: What does the following SQL statement do?
SELECT * FROM Orders ORDER BY country, total;
ViewWeek 4: Introduction to Databases Coursera Quiz Answers
Quiz 1: Knowledge check: Database schema
Question 1: he term database schema refers to the organization of data as a blueprint of how data should be organized and related.
ViewQuestion 2: Identify the essential parts of a database schema. Select all that apply.
View2.Relationships between tables
Question 3: A key advantage of a database conceptual schema is that it provides a clear view of how data is stored in database, which makes it easier to build and secure.
ViewQuestion 4: The primary key is used to connect tables in a database schema.
ViewQuestion 5: A bookstore schema including two tables: customers and orders, which are implemented as follows:
CREATE TABLE Customers( CustomerID int NOT NULL, Name VARCHAR(50), PRIMARY KEY (CustomerID));
CREATE TABLE Orders ( OrderID int NOT NULL, CustomerID int, PRIMARY KEY (OrderID), FOREIGN KEY (CustomerID) REFERENCES customers(CustomersID));
The two tables are connected through the OrderID attribute, because no order can be placed without a customer placing an order.
ViewQuiz 2: Knowledge check: Defining keys
Question 1: Which column can be used as the primary key in the following student table?
StudentName | Date Of Birth | |
Tim | 19/03/2000 | [email protected] |
Mark | 20/05/1999 | [email protected] |
Mark | 10/03/2001 | [email protected] |
Peter | 19/03/2000 | [email protected] |
Question 2: What type of primary key is used in the following Sales table?
Customer ID | Order ID | Product Code | Quantity |
Cu01 | Or10 | Pro123 | 10 |
Cu02 | Or11 | Pro153 | 12 |
Cu01 | Or10 | Pro124 | 16 |
Cu02 | Or12 | Pro123 | 11 |
Question 3: You need to create a table for staff members in a college. You must define the email address column as the primary key. Can the following SQL syntax be used to complete this task?
CREATE TABLE Staff( Email VARCHAR(200) NOT NULL, Name varchar(255) NOT NULL, CONSTRAINT PK_Email PRIMARY KEY (Email));
ViewQuestion 4: The following SQL code defines three primary keys: SalesID, CustomerID and ProductID.
CONSTRAINT SalesID PRIMARY KEY (customerID, proudctID)
ViewQuestion 5: Which of the following statements is the correct SQL syntax to define a foreign key that links the orders table with the customers table in the following diagram?
ViewQuiz 3: Database relations and keys
Question 1: Identify the relationship between the following two tables (customer and order)
ViewQuestion 2: The following tables contain data about citizens and passports. Each citizen is permitted to own one passport. Identify the relationship between the two tables.
ViewQuestion 3: The following ER diagram presents a many-to-many relationship between the actor entity and the movie entity.
ViewQuestion 4: The Customer ID in the Order table is a foreign key used to reference the primary key (customer ID) in the Customer table.
ViewQuestion 5: The entity relationship model is based on two key concepts: Entities and relationships
ViewQuiz 4: Knowledge Check: Database normalization
Question 1: Which of the following is a key aim of database normalization? Select all that apply.
View2.Simplify data queries
3.Avoid errors during data modifications
Question 2: True or false. The first normal form allows for the storage of multiple values in table fields.
ViewQuestion 3: Partial Dependency occurs when a non-primary key attribute is functionally dependent on part of a composite key. This action violates which of the three normal forms?
ViewQuestion 4: True or false. Transitive dependency occurs when a non-key attribute determines the values of one or more other attributes, violating the third normal form criteria.
ViewQuestion 5: What actions should you take to ensure that a database is in first normal form? Select all that apply.
View2.Create a separate table for each set of related data.
Quiz 5: Self-review: Database schema examples
Question 1: he table of data conforms with the first normal form.
ViewQuestion 2: What steps can you take to make sure that the table complies with the first normal form? Select all that apply.
View2.Decompose the table to avoid data redundancy.
Question 3: Assume that the table has been decomposed into two separate tables: “Departments” and “Courses”. Which attributes should be included in each of the new tables? Remember that the records of the two tables must be linked with a foreign key.
ViewQuestion 4: After the normalization process is completed and the “College” table is decomposed into two tables called “Departments” and “Courses”. Which of the following two diagrams represents the correct schema?
ViewQuestion 5: Which of the following SQL statements can be used to create the Courses table in the new schema? Remember that the Courses table must be linked to the Departments table.
ViewQuiz 6: Module quiz: Database design
Question 1: A logical database schema introduces a blueprint of how the data is organized and related in tables.
ViewQuestion 2: Which column is the primary key in the following Patients table?
Patients | ||
Patient Name | Date Of Birth | |
Karl | 19/03/2000 | [email protected] |
Mark | 20/05/1999 | [email protected] |
Peter | 10/03/2001 | [email protected] |
Peter | 19/03/2000 | [email protected] |
Question 3: A foreign key is used to connect tables in a database.
ViewQuestion 4: The normalization process aims to reduce the negative effects of the different types of data anomalies.
ViewQuestion 5: Identify the issue with the following table of data in accordance with the rules of first normal form criteria
Department ID | Department Name | Director | Course ID | Course Name | Tutor ID | Tutor |
D1 | Computing | Dr Karl | C1 | Database | T1 | Mark |
D1 | Computing | Dr Karl | C2 | Python | T1 | Mark |
D1 | Computing | Dr Karl | C3 | Web | T2 | Jack |
D1 | Computing | Dr Karl | C4 | Java | T2 | Jack |
D2 | Math | Dr Mosa | C5 | Math | T3 | Rose |
Question 6: To normalize the following table of data, you must decompose it into how many tables?
Department ID | Department Name | Director | Course ID | Course Name | Tutor ID | Tutor |
D1 | Computing | Dr Karl | C1 | Database | T1 | Mark |
D1 | Computing | Dr Karl | C2 | Python | T1 | Mark |
D1 | Computing | Dr Karl | C3 | Web | T2 | Jack |
D1 | Computing | Dr Karl | C4 | Java | T2 | Jack |
D2 | Math | Dr Mosa | C5 | Math | T3 | Rose |
Question 7 : The table below contains a composite primary key made up of the columns “Tutor ID” and “Subject”. What kind of normalization problem does this composite key create?
Tutor ID | Subject | Credits |
T1 | Java | 20 |
T1 | Web | 15 |
T2 | Math | 15 |
T2 | History | 20 |
Question 8: Which of the following statements is the correct syntax to define a foreign key that links the “Players” and “Games” table in an ER diagram?
ViewQuestion 9: A database relation is in second normal form if it is in first normal form and every non key attribute is __________ functionally dependent on the primary key.
ViewQuestion 10: Database normalization is a progressive process, which means that the database relation cannot be in the third normal form if it is not already applying the rules of the first and the second normal forms.
ViewWeek 5: Introduction to Databases Coursera Quiz Answers
Quiz 1: Graded Assessment: Intro to Databases
Question 1: Write an SQL statement to create a database called “SportsClub”.
Answer: CREATE DATABASE SportsClub;
Question 2: In the text field below, input the missing keyword (___) from the following SQL statement to create a table called “Players”.
CREATE ____ Players (playerID INT, playerName VARCHAR(50), age INT, PRIMARY KEY(playerID));
ViewRun the complete SQL statement in MySQL to create the table in the club database.
Question 3: In the text field below, input the missing keyword (___) from the following SQL statement to insert data into the “Players” table.
INSERT INTO Players (playerID, playerName, age) ____ (1, “Jack”, 25);
ViewRun the complete SQL statement in MySQL to insert the record of data in the players table.
Question 4: Insert three more records into the “Players” table that contain the following data:
- (2, “Karl”, 20)
- (3, “Mark”, 21)
- (4, “Andrew”, 22)
Once you have executed the INSERT INTO statement to enter these three records of data, run the following SQL statement:
SELECT playerName FROM Players WHERE playerID = 2;
What is the playerName that appears on the screen?
ViewQuestion 5: Write a SQL statement that outputs all players names in the “Players” table. When you run the right SQL query, you should have the following output result:
ViewAnswer: SELECT playerName FROM Players;
Question 6: The following table called “Players”, contains four records of data. Write a SQL statement that updates the age of the player with ID = 3. The new age value should be ’22’.
ViewQuestion 7: The following table called “Players”, contains four records of data. Write a SQL statement that deletes the record of the player with ID = 4.
ViewQuestion 8: Write an SQL statement that evaluates if the PlayerID in the following “Players” table is odd or even.
Hint: Assume X is a number. If the remainder of X divided by 2 is 0, then X is an even number otherwise X is an odd number. Remember to use the “%” symbol to get the remainder.
PlayerID | Name |
---|---|
1 | Karl |
2 | Adam |
3 | Anas |
Question 9: Write an SQL statement that outputs all names of the players in the following “Players” table who are older than 25 years of age.
Age | Name |
---|---|
38 | Karl |
25 | Adam |
22 | Anas |
Question 10: Review the following ER-Diagram. Write the missing part of the SQL statement to define a foreign key that links the course table with the department table.
CREATE TABLE Course( courseID int NOT NULL, courseName VARCHAR(50), PRIMARY KEY (courseID), ____ ____(____) ____ ____ (____) );
Hint: write only the missing part in your answer.
ViewPart 2 – Quiz
Question 11: What is a row of information about one specific staff member in a college database table referred to as?
ViewQuestion 12: A sports club database includes a table called “Members” with two columns:
- A ‘member number’ column that contains the phone number of each member
- And a ‘full name’ column that contains the full name of each member.
Choose the right data type for each column. Select all correct answers.
View2.The Full name column data type is VARCHAR.
Question 13: In a football club the skill level of all new players must automatically be set at the default of level 1. Which SQL syntax is used to set this default level using the DEFAULT keyword?
ViewQuestion 14: Database constraints are used to limit the type of data value that can be stored in a table.
ViewQuestion 15: The output result of the following SQL statement is the data of all customers from Italy.
SELECT * FROM customers WHERE Country = “Italy”;
ViewQuestion 16: The output result of the following SQL statement returns the records of all customers from India in Alphabetical order from A to Z.
SELECT * FROM students WHERE country = “India” ORDER BY FirstName DESC;
ViewQuestion 17: What does the following SQL statement do?
SELECT * FROM Players ORDER BY Country, PlayerName;
ViewQuestion 18
The following table of data conforms with the first normal form.
Department ID | Department Name | Head of department | Course ID | Course Name |
D1 | Computing | Dr Karl | C1 | Database |
D1 | Computing | Dr Karl | C2 | Python |
D1 | Computing | Dr Karl | C3 | Web |
D1 | Computing | Dr Karl | C4 | Java |
D2 | Math | Dr Mosa | C5 | Math |
Get All Weeks Meta Database Engineer Professional Certificate
Introduction to Databases Coursera Quiz Answers
Version Control Coursera Quiz Answers
Database Structures and Management with MySQL Quiz Answers
Advanced MySQL Topics Coursera Quiz Answers
Programming in Python Coursera Quiz Answers
Database Clients Coursera Quiz Answers
Advanced Data Modeling Coursera Quiz Answers