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?
- Flat Files databases
- Relational databases
- NoSQL databases
Question 3: Which of the following is a key advantage of organizing data in tables?
- To protect data
- To store a large amount of data
- To provide a clear view of the data
Question 4: The foreign key can be used to identify a specific record of data in a relational database.
- True
- False
Question 5: Big data contains a wide variety of data, arriving in increasing volumes and at high velocities.
- True
- False
Quiz 2: Knowledge check: SQL syntax review
Question 1: What makes SQL a popular database language? Select all that apply.
- It is a portable programming language.
- It works with different relational database management systems.
- 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.
- Select
- Create
- Update
- Insert
Question 3: The SELECT command should be used to retrieve data from a database table.
- True
- False
Question 4: Which SQL syntax should be used to create a student table?
- CREATE Student TABLE
- CREATE TABLE Student
Question 5: Choose the correct syntax to create a college database in SQL.
- CREATE COLLEGE DATABASE
- CREATE DATABASE COLLEGE
Quiz 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?
- Table
- Column
- Record
Question 2: What is the minimum number of tables that must be present in a relational database?
- Three tables
- One table
- Two tables
Question 3: What is the name of the attribute that is chosen in the database to uniquely identify each record in a table?
- Foreign Key
- Secondary Key
- Primary Key
Question 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] |
- Customer email address
- Customer-first name
- Customer last name
Question 5: Which of the following keys can you select as the primary key in a relational database? Select all that apply.
- Composite Key
- Alternate key
- Foreign Key
- Candidate Key
Quiz 4: Module quiz: Introduction to Databases
Question 1: What is the most used database type in computing?
- NoSQL Database
- Relational Database
- Flat File Database
Question 2: Which one of the following is an advantage of storing data in tables?
- Tables offer the ability to encrypt data.
- Tables let you store large amounts of data.
- Tables provide a simple and clear view of data
Question 3: In a bookshop database, the complete information about one specific book is referred to as a ______________.
- Table
- Record
- Column
Question 4: What makes SQL a very popular database language? Select all that apply.
- SQL is a portable programming language.
- SQL requires very little coding skills to use.
- SQL works with different relational database management systems.
Question 5: Which SQL command is used to update data in a database table?
- MODIFY command
- EDIT command
- UPDATE command
Question 6: Which of the following database management systems uses the SQL language? Select all that apply.
- Oracle
- MySQL
- PostgreSQL
Question 7: What is the importance of a candidate key in a database?
- 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 |
- Mobile number
- Student first name
- Student last name
Question 9: CREATE TABLE student is the right syntax to create a student table in SQL.
- False
- True
Question 10: Choose the right syntax to create a club database in SQL. Select all correct answers.
- CREATE CLUB DATABASE
- create club database
- CREATE DATABASE CLUB
- 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.
- username CHAR(5)
- username VARCHAR(5)
Question 2: Which of the following SQL statements uses the right syntax to create the Student table in a college database with character limits?
- CREATE TABLE students (username CHAR, fullName VARCHAR, email VARCHAR);
- CREATE TABLE students (username CHAR(5), fullName VARCHAR(100), email VARCHAR(255));
Question 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.
- article TEXT(10000)
- article CHAR(10000)
Question 4: TINYTEXT is a string data type used to define columns with small letter characters only.
- True
- False
Quiz 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?
- City DEFAULT VARCHAR(30) “London”
- City VARCHAR(30) DEFAULT “London”
Question 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?
- DEFAULT level INT 1;
- level INT DEFAULT 1;
Question 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”);
- False
- True
Question 4: Database default constraints are used to limit the value of data that can be stored in a table.
- 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?
- Two DEFAULT keywords.
- One DEFAULT keyword.
Quiz 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.
- TINYINT
- DECIMAL
Question 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).
- True
- False
Question 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?
- CREATE TABLE players (playerNumber INT, fullName VARCHAR(100), date_of_birth CHAR);
- CREATE TABLE players (playerNumber Decimal, fullName VARCHAR(100), date_of_birth DATE);
- CREATE TABLE players (playerNumber INT, fullName VARCHAR(100), date_of_birth DATE);
Question 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.
- username VARCHAR(7)
- username CHAR(7)
Question 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);
- True
- False
Quiz 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
- False
- True
Question 2: The following SQL statement can be used to create a “Customers” table in a bookshop database:
CREATE TABLE customers (customerName VARCHAR(100), customerAddress VARCHAR(100))
- True
- False
Question 3: Identify the correct SQL command to insert a new record of data in a table.
- INSERT INTO SELECT
- INSERT INTO
Question 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”?
- INSERT INTO customer (name, age) VALUES (“Karl”, 21);
- INSERT name, age INTO customer table values “Karl” “21”
- INSERT customer SET name = “Karl” and age = 21
Question 5: Identify the missing keyword in the following SQL statement.
INSERT INTO customers (ID, name) ____ (7, “Tom”)
- INSERT INTO customers (ID, name) WHERE (7, “Tom”)
- INSERT INTO customers (ID, name) VALUES (7, “Tom”)
Quiz 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.
- CREATE TABLE table name
- CREATE table_name TABLE
- create table table_name
- CREATE TABLE table_name
Question 2: Select all steps to create a table in the database.
- Select a database.
- Write the table name.
- Use the CREATE TABLE command.
- Use the FROM keyword.
- 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.
- CREATE TABLE products (ID INT, quantity INT)
- CREATE TABLE products (ID CHAR, quantity VARCHAR)
Question 4: Which of the following SQL statements can be used to build a table that stores data about cell phone products?
- CREATE TABLE cell_phone (name VARCHAR(), productionDate DATE, price DECIMAL)
- CREATE TABLE cell_phone (name VARCHAR(100), productionDate DATE, price DECIMAL)
Question 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.
- CREATE TABLE Players (playerName VARCHAR(100), playerAge INT)
- CREATE TABLE Players (playerName VARCHAR(100), playerAge DECIMAL)
Quiz 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)
- True
- False
Question 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?
- CREATE TABLE bank_account (account_number INT, balance Decimal )
- CREATE ENTITY bank_account (account_number INT, balance Decimal )
Question 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
- INSERT INTO games (GameID, gameDate, score) VALUES (1, “2022-10-10”, 3);
- INSERT INTO games (GameID, gameDate, score) CONSTRAINT (1, “2022-10-10”, 3);
Question 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.
- INSERT INTO Players (ID, name, age) VALUES (5, “Tina”, 23);
- INSERT INTO TABLE Players (ID, name, age) VALUES (5, “Tina”, 23);
Question 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
- SELECT * players;
- SELECT * FROM players;
Quiz 7: Self-review: Record deletion
Question 1: The correct command to remove a record from a table is: DROP FROM
- False
- True
Question 2: You can delete all records of data from a table without deleting the table itself using the SQL command DELETE FROM.
- False
- True
Question 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 ;
- True
- False
Question 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”
- True
- False
Quiz 8: Knowledge check: Update and Delete
Question 1: Which of the following statements is the correct command syntax to update a table in SQL?
- UPDATE column
- UPDATE table_name
- UPDATE Table table_name
Question 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;
- ANY
- SET
Question 3: Which of the following SQL statements can be used to update data for a student in the “Students” table?
- UPDATE students WHERE ID = 18 SET name = ‘Karl’;
- UPDATE students SET name = ‘Karl’ AND ID = 18;
- UPDATE students SET name = ‘Karl’ WHERE ID = 18;
Question 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 |
- DROP TABLE customers
- DELETE FROM customers;
Question 5: The ‘WHERE’ keyword is used in SQL to specify a condition to update or delete data from a table.
- False
- True
Quiz 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;
- False
- True
Question 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));
- True
- False
Question 3: What is the SQL command to add a new record of data in the staff table?
- INSERT staff INTO
- INSERT INTO staff
- ADD INTO staff
Question 4: Which is the right command syntax to update the staff table in SQL?
- UPDATE Table staff
- UPDATE staff
Question 5: EDIT command is used to modify data in a database table.
- False
- True
Question 6: Which one of the following SQL statements updates the staff email address for the individual named “Karl” in the staff table?
- UPDATE staff SET email = ‘[email protected]’ WHERE name = ‘Karl’;
- UPDATE staff WHERE ID = 16 SET email = ‘[email protected]’;
- UPDATE staff SET name = ‘[email protected]’ WHERE email = ‘Karl’;
Question 7: Select the right keyword to complete the missing part of the following statement:
INSERT INTO staff (ID, name) ___ (7, “Tom”);
- DATA
- VALUES
Question 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.
- SELECT name, email, age FROM staff
- SELECT * FROM staff
- SELECT name, email AND age FROM staff
Question 9: The following SQL statement returns all staff phone numbers from the staff table:
SELECT phoneNumber FROM staff;
- False
- True
Question 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.
- DELETE FROM staff
- TRUNCATE TABLE staff
- DROP 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.
- True
- False
Question 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”;
- False
- True
Question 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”.
- SELECT * FROM customers WHERE country = “India” ORDER BY FirstName ASC;
- SELECT * FROM customers WHERE country = “India” ORDER BY FirstName DESC;
Question 4: Identify the effect of the following SQL statement on the “Staff” table:
SELECT * FROM staff ORDER BY Country, StaffName
- Displays the results ordered by country first then staff name.
- Orders the result by country and ignores the staff name.
Quiz 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?
- SELECT total + 2 FROM Orders TABLE;
- SELECT total + 2 FROM Orders;
- SELECT total + 2 FROM the Orders TABLE;
Question 2: What does the following SQL statement do?
SELECT total / 2 FROM Orders;
- It returns the value of total price column in the second row.
- 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;
- False
- True
Question 4: Which of the following SQL statements returns 50% of the total price? Choose all correct answers.
- SELECT total * 0.5 FROM Orders;
- SELECT total * 50 FROM Orders;
- SELECT total / 50% FROM Orders;
- SELECT total / 2 FROM Orders;
Question 5: Select the right SQL statement to display the values of the total prices that are greater than $140.
- SELECT total FROM Orders where total < 140
- SELECT total FROM Orders where total > 140
- SELECT total FROM Orders where total >= 140
Question 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;
- Ascending
- Descending
Question 7: The following SQL statement filters data based on ____
SELECT * FROM customers WHERE Country = “Germany”;
- ‘Country’ column with ‘Germany’ value
- ‘Germany’ column with ‘country’ value
Question 8: In SQL you can sort records in descending order using the DESCENDING keyword.
- True
- False
Question 9: The output of the following SQL query within the Orders table is: UK, UK, UK, France, France, Finland
SELECT DISTINCT Country FROM Orders;
- True
- False
Question 10: What does the following SQL statement do?
SELECT * FROM Orders ORDER BY country, total;
- Orders the result by country and ignores the total price.
- Orders the result by country first then total price.
Week 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.
- False
- True
Question 2: Identify the essential parts of a database schema. Select all that apply.
- Tables
- Relationships between tables
- Composite key
- Foreign key
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.
- False
- True
Question 4: The primary key is used to connect tables in a database schema.
- True
- False
Question 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.
- True
- False
Quiz 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] |
- Date of Birth
- Student name
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 |
- A composite primary key represented by Customer ID and Product Code columns.
- A primary key represented by the Customer ID column.
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));
- No
- Yes
Question 4: The following SQL code defines three primary keys: SalesID, CustomerID and ProductID.
CONSTRAINT SalesID PRIMARY KEY (customerID, proudctID)
- True
- False
Question 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?
- CREATE TABLE Orders ( OrderID int NOT NULL, CustomerID int, PRIMARY KEY (OrderID), FOREIGN KEY (CustomerID) REFERENCES Customers(OrderID));
- CREATE TABLE Orders ( OrderID int NOT NULL, CustomerID int, PRIMARY KEY (OrderID), FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID));
Quiz 3: Database relations and keys
Question 1: Identify the relationship between the following two tables (customer and order)
- One-to-Many relationship
- Many-to-Many relationship
Question 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.
- Many-to-Many relationship
- One-to-One relationship
Question 3: The following ER diagram presents a many-to-many relationship between the actor entity and the movie entity.
- True
- False
Question 4: The Customer ID in the Order table is a foreign key used to reference the primary key (customer ID) in the Customer table.
- False
- True
Question 5: The entity relationship model is based on two key concepts: Entities and relationships
- False
- True
Quiz 4: Knowledge Check: Database normalization
Question 1: Which of the following is a key aim of database normalization? Select all that apply.
- Minimize data duplication
- Simplify data queries
- Avoid errors during data modifications
Question 2: True or false. The first normal form allows for the storage of multiple values in table fields.
- True
- False
Question 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?
- First normal form
- Second normal form
- Third normal form
Question 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.
- True
- False
Question 5: What actions should you take to ensure that a database is in first normal form? Select all that apply.
- Connect your table with other tables in the database using a foreign key.
- Eliminate repeating groups of data within individual tables.
- 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.
- False
- True
Question 2: What steps can you take to make sure that the table complies with the first normal form? Select all that apply.
- Assign a foreign key to the table.
- Assign a primary key to the table.
- 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.
- The “Departments” table should include the department ID, name, and head of department. The “Courses” table should include the course ID, course name and department ID.
- The “Departments” table should include the department ID, name, and head of department. The “Courses” table should include the course ID and course name.
Question 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?
- Diagram 1.
- Diagram 2.
Question 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.
- CREATE TABLE Courses (CouseID VARCHAR(5), CourseName VARCHAR(50), DepartmentID VARCHAR(10), PRIMARY KEY (CouseID), FOREIGN KEY (DepartmentID) REFERENCES Courses (DepartmentID))
- CREATE TABLE Courses (CouseID VARCHAR(5), CourseName VARCHAR(50), DepartmentID VARCHAR(10), PRIMARY KEY (CouseID), FOREIGN KEY (DepartmentID) REFERENCES Departments (DepartmentID))
Quiz 6: Module quiz: Database design
Question 1: A logical database schema introduces a blueprint of how the data is organized and related in tables.
- True
- False
Question 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] |
- Patient name
- Date of Birth
Question 3: A foreign key is used to connect tables in a database.
- True
- False
Question 4: The normalization process aims to reduce the negative effects of the different types of data anomalies.
- False
- True
Question 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 |
- Atomicity problem.
- Duplication of data.
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 |
- Three tables (departments, courses, and tutors).
- Two tables (departments and courses).
- Four tables (departments, directors, courses, and tutors).
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 |
- First normal form data redundancy
- Second normal form partial dependency
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?
- CREATE TABLE Games( gameID int NOT NULL, playerID int, PRIMARY KEY (gameID), FOREIGN KEY (playerID) REFERENCES players(playerID));
- CREATE TABLE Games( gameID int NOT NULL, playerID int, PRIMARY KEY (gameID), FOREIGN KEY (gameID) REFERENCES players(gameID));
Question 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.
- Fully
- Partially
Question 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.
- True
- False
Week 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));
Run the complete SQL statement in MySQL to create the table in the club database.
Answer: CREATE TABLE Players (playerID INT, playerName VARCHAR(50), age INT, PRIMARY KEY(playerID));
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);
Run the complete SQL statement in MySQL to insert the record of data in the players table.
Answer: INSERT INTO Players (playerID, playerName, age) VALUES (1, “Jack”, 25);
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?
Answer: The playerName that appears on the screen is “Karl”.
Question 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:
Answer: 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’.
Answer: UPDATE Players SET age = 22 WHERE playerID = 3;
Question 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.
Answer: DELETE FROM Players WHERE playerID = 4;
Question 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 |
Answer: SELECT PlayerID, CASE WHEN PlayerID % 2 = 0 THEN ‘Even’ ELSE ‘Odd’ END AS NumberType FROM Players;
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 |
Answer: SELECT Name FROM Players WHERE Age > 25;
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.
Answer: FOREIGN KEY (departmentID) REFERENCES Department(departmentID)
Part 2 – Quiz
Question 11: What is a row of information about one specific staff member in a college database table referred to as?
- A record
- A column
- A key
Question 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.
- The Player number column data type is DECIMAL.
- The Player number column data type is INT.
- The Full name column data type is CHAR.
- 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?
- DEFAULT level INT 1;
- level INT DEFAULT 1;
Question 14: Database constraints are used to limit the type of data value that can be stored in a table.
- False
- True
Question 15: The output result of the following SQL statement is the data of all customers from Italy.
SELECT * FROM customers WHERE Country = “Italy”;
- False
- True
Question 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;
- False
- True
Question 17: What does the following SQL statement do?
SELECT * FROM Players ORDER BY Country, PlayerName;
- It orders the result by country and ignores the staff name.
- It displays the results ordered by country first, then players name.
Question 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 |
- True
- False
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