BAN5013 Week-4 Quiz

  1. Which of the following is one of the foundational skills emphasized in the introductory course on SQL and relational databases? writing SQL statements
  2. What is the SELECT statement in SQL called, and what is the output from executing this statement called? Query; Result set
  3. Which of the following statements rightly indicates the missing part of the query? A where clause to limit the results to films released in 2019
  4. Which of the following SQL queries will retrieve the list of unique countries that received gold medals from the MEDALS table? select Distinct country from medals where medaltype = ‘gold’;
  5. Which of the following statements about the INSERT statement is correct? the insert statement can add multiple rows at a time by specifying each row in the values clause, separated by commas.
  6. What is the function of a primary key? the primary key uniquely identifies each row in a table
  7. Which of the following are DDL statements? The CREATE, ALTER, and DROP are Data Definition Language (DDL) statements and act on objects such as tables, not the data within the table.
  8. Which of the following statements correctly describes an entity in an entity relationship (ER) model? An entity is indeed a noun that represents a person, place, or thing, and it is depicted as a rectangle in an ER diagram.
  9. Which statement deletes data in a table but not the table itself? TRUNCATE
  10. Which ALTER TABLE statement is used to add a new column named “email” to an existing table named “customers” in a database? ALTER TABLE customers ADD COLUMN email VARCHAR(255);
  11. Which of the following statements about a database is/are correct? A database is a repository or logically coherent collection of data with some inherent meaning.
  12. The primary key of a relational table uniquely identifies each _______ in a table. Row
  13. Attributes of an entity become ________ in a table. Attributes of an entity become columns in a table.
  14. Which of the following statements correctly describes the purpose of Data Manipulation Language (DML) statements like INSERT, SELECT, UPDATE, and DELETE? they read and modify data in a table
  15. The CREATE TABLE statement is a ______________. ddl statement
  16. What is the correct syntax for creating a table named AUTHOR with the columns author_id, lastname, firstname, email, city, and country where author_id is the primary key? create table author ( author_id char(2) primary key, lastname varchar(15) not null, firstname
  17. Which of the following queries changes the data type of an existing column (phone) to the varchar data type? alter table author alter column phone set data type varchar(20)
  18. You want to retrieve a list of employees in alphabetical order of ‘Lastname’ from the Employees table. Which SQL statement will you use? select * from employees order by lastname;
  19. You want to retrieve a list of authors from Australia, Canada, and India from the table Authors. Which SQL statement will you use? select * from author where country in (‘Australia’, ‘canada’, ‘india’);
  20. You want to retrieve a list of books priced above $10 and below $25 from the table Book. What are the two ways in which you can specify the range? select title, price from book where price > 10 and price < 25;
  21. You want to select the author’s last name from the author table, but you only remember that the author’s last name starts with the letter B. Which string pattern should you use? select lastname from author where lastname like ‘b%’
  22. In a SELECT statement, which SQL clause controls how the result set is displayed? order by clause
  23. Which of the following keywords sets a condition for a GROUP BY clause? Having
  24. When querying the author table that contains a list of authors and their country of residence, which of the following queries will return the number of authors from each country? select country, count(country) from author group by country
  25. You want to retrieve a list of books that have between 450 and 600 pages. Which clause would you add to the following SQL statement: SELECT Title, Pages FROM Book ________________________________ where pages >= 450 and pages <= 600
  26. How can you write a query to list countries with more than four authors, showing the number of authors from each country, and sorting the results alphabetically by country? select country, count(country) as count from author group by country having count(country) > 4 order by country
  27. Which of the following clauses executes an implicit join? WHERE
  28. Which of the following statements about built-in database functions is correct? built-in database functions reduce the amount of retrieved data
  29. Which of the following SQL statements can be used to query the data below, which returns the day (such as MON,FRI, etc.) each dog was rescued? select dayofweek(rescuedate) from petrescue where animal = ‘dog’;
  30. For the data given in the table below, which of the following queries will return the employees who earn less than the average salary? SELECT * FROM Employees WHERE Salary < (SELECT AVG(Salary) FROM Employees);
  31. What are the three ways to work with multiple tables in the same query? Sub-queries, implicit joins, JOIN operators
  32. Which of the following SQL statements can be used to query the data below to retrieve the LOWEST value of SALARY? select min(salary) from employees
  33. Which of the following queries will return the first name of the employee who earns the highest salary? SELECT FIRST_NAME FROM EMPLOYEES WHERE SALARY =(SELECT MAX(SALARY) FROM EMPLOYEES)
  34. You are writing a query that will give you the total cost to the Pet Rescue organization of rescuing animals. The cost of each rescue is stored in the Cost column of the PetRescue table. You want the result column to be called “Total_Cost”. Which of the following SQL queries is correct for the same? select sum(cost) as total_cost from petrescue
  35. What result can be expected from the following query: it returns how long it has been since each rescue
  36. Which of the following statements about working with multiple tables in a SQL query is true? Cartesian joins result in every row from the first table being joined with every row from the second table.
  37. Which SQL query will help you fetch the department ID and department name for departments where the number of employees exceeds 10? where department in
  38. Which SQL query correctly retrieves the department name for each employee? SELECT E.F_NAME, D.DEP_NAME FROM EMPLOYEES E JOIN DEPARTMENTS D ON E.DEPT_ID_DEP = D.DEP_ID;
  39. How can a relational database help R handle memory issues? Running SQL queries in a relational database reduces memory demands in the R client
  40. Which R function saves a single data structure to a .Rda file? saveRDS()
  41. A dataframe in R is like which of the following relational database concept Table
  42. When mapping data types between R and database , you should consider converting which of the following to strings? Date
  43. When designing a relational database, which aspect is primarily addressed by normalization techniques? Data redundancy
  44. Which of the following is the simplest way to update individual observations in a data frame? store the data in a relational database and make the updates there
  45. Which R function loads multiple R data structures from a .Rda file? load()
  46. A variable in R is comparable to which of the following relational database concepts? column or atteribute
  47. Which of the following R variables holds the platform numeric limits for your R environment? .machine
  48. Choose a statement that best describes declarative referential integrity. it means managing dependency relationships between two tables
  49. In the context of mapping data between R and relational databases, how does logical data from R typically represent when exchanged with a database server?logical data from R is usually mapped to a single character column in a relational database.
  50. What benefit does using a relational database with R provide even when the data does not reside in the database? optimized extraction of data subsets for analysis,
  51. Which function in the RJDBC package is used to close the database connection after accessing the data? dbdisconnect
  52. What does RJDBC stand for? r java database connectivity
  53. Which of the following statements about database packages for R are true? (Select all that apply) the rodbc package can be used with many database servers dbi-based packages are database server-specific
  54. What does “CRAN” stand for in the context of R programming? comprehensive R archive network
  55. Which of the following statements correctly describes the ODBC Driver Manager? platform-specific
  56. What are the two categories of relational database access packages in R? Select all that applies. ODBC database interface-based (dbi)
  57. Which of the following is the first step that you must take before using the RJDBC package for R? load the rjdbc library
  58. Which of the following is one of the two components of ODBC? odbc driver manager
  59. What is the best way to provide a data analyst with knowledge of a database schema or structure, often depicted using an entity relationship (ER) diagram? utilizing ibm infosphere data architect
  60. Which RODBC function is best suited for retrieving information about the structure and attributes of database tables? sql(tables()
  61. What is the first step you must complete outside of R before installing the RODBC package? install the odbc driver for your database server
  62. What is the role of the ODBC Driver Manager in the context of database connectivity? it provides platform-specific management for odbc drivers
  63. You are preparing to analyze sales data and have much information in an Excel spreadsheet. You have decided to convert the Excel spreadsheet to a relational database. What is your first step? Create a logical and physical database design.
  64. Which of the following correctly describes the condition for the referential constraint to occur?
  65. Which of the following correctly describes the condition for the referential constraint to occur? referential constraint occurs when two tables have a primary key/foreign critical relationship
  66. Which of the following is a standard tool or language that can be used to clean and split data into load files? python
  67. Why is the SQL LOAD command recommended over the IMPORT command for large amounts of data? the load command bypasses the database transactional logging mechanism, making it fast and efficient
  68. Which plot type is specifically employed to visualize the median and distribution within and across categories? boxplots
  69. What are two reasons to map an existing data source, like pre-existing database tables, database dump files, or raw data, to a relational database design? Select all that apply. To eliminate redundancy in the data To facilitate addressing issues with data normalization
  70. You have two tables in your database design: Customers, which lists all your customers, and Orders, which lists all the sales transactions that your customers have made over the years. Both the tables have a field called Customer_ID. Which of the following describes the relationship between the two tables? the customer_ID field in the customers table is a primary key, and the customer_ID field in the orders table is a foreign key
  71. What is the SQL DDL command that can be used to add primary keys to an existing table in a database? ALTER TABLE
  72. What is the recommended SQL command for loading small to medium amounts of data into a database? Import command
  73. What are two ways to limit database movement and increase performance when querying a database? use sql functions provided by the database vendor whenever possible use stored procedures when possible
  74. What type of relationship does the database model indicate between each school board and multiple schools? one to many
  75. Which method is recommended to avoid unnecessary data transfer when analyzing data with a powerful database engine? leverage sql functions provided by the databas
  76. You want to retrieve salary information for an employee called Ed from the employee table. where firstName = ‘Ed’;
  77. Which statement is true about the SQL SELECT statement? a select statement is used to retrieve data from a table
  78. Which of the following statements adds a new instructor to the Instructor table shown below? insert into instructAssume that there exists an INSTRUCTOR table with several columns including firstname, lastname, etc.
  79. Assume that there exists an INSTRUCTOR table with several columns including firstname, lastname, etc. leon paul joe
  80. What is the importance of the WHERE clause in the DELETE and UPDATE statements? it specifies the conditions for selecting the rows to be deleted or updated
  81. What does the following SQL statement do? it changes all rows for the instructor with the last name of smith to have the last name of brewster
  82. Which of the following SQL statements will delete the authors with IDs of A10 and A11? delete from author where author_ID in (‘a10’,’a11)
  83. Which SQL expression retrieves the number of rows that match the query criteria? Count
  84. When mapping data types between R and a database, which of the following should you consider converting to strings? Date


Other Links:

Statistics Quiz

Networking Quiz

See other websites for quiz:

Check on QUIZLET

Check on CHEGG

Leave a Reply

Your email address will not be published. Required fields are marked *