Introduction to Databases | Week 4
Course Name: Introduction to Databases
Course Link: Introduction to Databases
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Knowledge check: Database schema
Q1. A conceptual database schema is a blueprint that defines how data is organized and related in a relational database.
- False
- True
Answer: True
Q2. A conceptual database schema defines three essential parts. Select all that apply.
- Relationships
- Attributes
- Tables
Answer: Relationships
Attributes
Tables
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q3. A key advantage of developing a conceptual database schema is that it provides – in advance – a clear view of what tables are necessary and the way they will be connected.
- False
- True
Answer: True
Q4. The foreign key is used to connect tables in a database schema.
- False
- True
Answer: True
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q5. A bookstore schema includes two tables: customers and orders 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));
True or false. The two tables are connected through the OrderID attribute.
- True
- False
Answer: False
Knowledge check: Defining keys
Q1. Which column can be used as the primary key in the following student table?
- Date of Birth
- Student name
Answer: Email
Q2. What type of primary key is used in the following Sales table?
- A composite primary key represented by Customer ID and Product Code columns.
- A primary key represented by the Customer ID column.
Answer: A composite primary key represented by Customer ID and Product Code columns.
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q3. 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));
- Yes
- No
Answer: Yes
Q4. The following SQL code defines three primary keys: SalesID, CustomerID and ProductID.
CONSTRAINT SalesID PRIMARY KEY (customerID, productID);
- True
- False
Answer: False
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q5. 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(CustomerID));
- CREATE TABLE Orders ( OrderID int NOT NULL, CustomerID int, PRIMARY KEY (OrderID), FOREIGN KEY (CustomerID) REFERENCES Customers(OrderID));
Answer: CREATE TABLE Orders ( OrderID int NOT NULL, CustomerID int, PRIMARY KEY (OrderID), FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID));
Database relations and keys
Q1. Identify the relationship between the following two tables (Customer and Order)
- One-to-Many relationship
- Many-to-Many relationship
Answer: One-to-Many relationship
Q2. The following tables contain data about citizens and passports. Each citizen is permitted to own one passport. Identify the relationship between the two tables.
- One-to-One relationship
- Many-to-Many relationship
Answer: One-to-One relationship
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q3. The following ER diagram presents a many-to-many relationship between the actor entity and the movie entity.
- True
- False
Answer: True
Q4. The customer_id in the Order table is a foreign key used to reference the primary key (customer_id) in the Customer table.
- True
- False
Answer: True
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q5. The entity relationship model is based on two key concepts: Entities and relationships
- False
- True
Answer: True
Knowledge Check: Database normalization
Q1. Which of the following is a key aim of database normalization? Select all that apply.
- Minimize data duplication
- Avoid errors during data modifications
- Simplify data queries
Answer: Minimize data duplication
Avoid errors during data modifications
Simplify data queries
Q2. True or false. The first normal form allows for the storage of multiple values in table fields.
- True
- False
Answer: False
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q3. 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
Third normal form
Second normal form
Answer: Second normal form
Q4. 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.
False
True
Answer: True
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q5. What actions should you take to ensure that a database is in first normal form? Select all that apply.
- Eliminate repeating groups of data within individual tables.
- Connect your table with other tables in the database using a foreign key.
- Create a separate table for each set of related data.
Answer: Eliminate repeating groups of data within individual tables.
Create a separate table for each set of related data.
Self-review: Database schema examples
NOTE: All questions in this quiz relate to the following table of data.
Q1. The table of data conforms with the first normal form.
- False
- True
Answer: False
Q2. 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.
- Decompose the table to avoid data redundancy.
- Assign a primary key to the table.
Answer: Decompose the table to avoid data redundancy.
Assign a primary key to the table.
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q3. 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.
Answer: 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.
Q4. 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
Answer: Diagram 2
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q5. 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
(
CourseID VARCHAR(5),
CourseName VARCHAR(50),
DepartmentID VARCHAR(10),
PRIMARY KEY (CourseID),
FOREIGN KEY (DepartmentID)
REFERENCES Courses (DepartmentID)
);
CREATE TABLE Courses
(
CourseID VARCHAR(5),
CourseName VARCHAR(50),
DepartmentID VARCHAR(10),
PRIMARY KEY (CourseID),
FOREIGN KEY (DepartmentID)
REFERENCES Departments (DepartmentID)
);
Answer:
CREATE TABLE Courses
(
CourseID VARCHAR(5),
CourseName VARCHAR(50),
DepartmentID VARCHAR(10),
PRIMARY KEY (CourseID),
FOREIGN KEY (DepartmentID)
REFERENCES Departments (DepartmentID)
);
Module quiz: Database design
Q1. A logical database schema introduces a blueprint of how the data is organized and related in tables.
- True
- False
Answer: True
Q2. Which column is the primary key in the following Patients table?
- Date of Birth
- Patient name
Answer: Email
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q3. A foreign key is used to connect tables in a database.
- True
- False
Answer: True
Q4. The normalization process aims to reduce the negative effects of the different types of data anomalies.
- True
- False
Answer: True
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q5. Identify the issue with the following table of data in accordance with the rules of first normal form criteria
- Atomicity problem.
- Duplication of data.
Answer: Duplication of data.
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q6. To normalize the following table of data, you must decompose it into how many tables?
- Two tables (departments and courses).
- Four tables (departments, directors, courses, and tutors).
- Three tables (departments, courses, and tutors).
Answer: Three tables (departments, courses, and tutors).
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q7. 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
Answer: Second normal form partial dependency
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q8. 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 (gameID) REFERENCES players(gameID));
- CREATE TABLE Games( gameID int NOT NULL, playerID int, PRIMARY KEY (gameID), FOREIGN KEY (playerID) REFERENCES players(playerID));
Answer: CREATE TABLE Games( gameID int NOT NULL, playerID int, PRIMARY KEY (gameID), FOREIGN KEY (playerID) REFERENCES players(playerID));
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q9. 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.
- Partially
- Fully
Answer: Fully
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
Q10. 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
Answer: True
These are answers of Introduction to Databases Week 4 Quiz Answers Coursera
More Weeks of this course: Click Here
More Coursera Courses: http://progiez.com/coursera