FREE! Click here to Join FunTrivia. Thousands of games, quizzes, and lots more!
Quiz about The SQL Database Environment
Quiz about The SQL Database Environment

The SQL Database Environment Trivia Quiz


Essential to the operation of businesses, a database functions as an electronic file cabinet. The SQL programming language is one of the main building blocks of databases, and is used to enter and retrieve data.

A multiple-choice quiz by ebanks120. Estimated time: 3 mins.
  1. Home
  2. »
  3. Quizzes
  4. »
  5. Science Trivia
  6. »
  7. Computers
  8. »
  9. Software and Programming

Author
ebanks120
Time
3 mins
Type
Multiple Choice
Quiz #
410,531
Updated
Apr 28 23
# Qns
10
Difficulty
Average
Avg Score
6 / 10
Plays
190
Last 3 plays: Guest 174 (1/10), klotzplate (10/10), joecali (5/10).
- -
Question 1 of 10
1. Which of these would be the most suitable candidate as a primary key in a store's database? Hint


Question 2 of 10
2. A database where each table has a fixed number of columns and a variable number of rows with individual tables being interconnected based on data they have in common is based on what data model? Hint


Question 3 of 10
3. Which of these database management systems is made by IBM? Hint


Question 4 of 10
4. Which of these values would be the most appropriate for the SQL data type VARCHAR(7)? Hint


Question 5 of 10
5. What SQL command adds rows to a table? Hint


Question 6 of 10
6. You have 4 tables in a database: TEACHER, CLASSROOM, STUDENT, and BUS. The STUDENT table has three foreign keys that connect to the TEACHER, CLASSROOM, and BUS tables. The CLASSROOM table has a foreign key that connects to the TEACHER table. The TEACHER and BUS tables have no foreign keys. Which table can be dropped first? Hint


Question 7 of 10
7. What is an alternate name for columns and tables called? Hint


Question 8 of 10
8. The COUNT aggregate function counts all rows including those containing null values.


Question 9 of 10
9. Which of these is not a typical size class for database management systems? Hint


Question 10 of 10
10. Which join type will only return rows for which both tables contain data in the respective key column? Hint



(Optional) Create a Free FunTrivia ID to save the points you are about to earn:

arrow Select a User ID:
arrow Choose a Password:
arrow Your Email:




Most Recent Scores
Oct 09 2024 : Guest 174: 1/10
Oct 05 2024 : klotzplate: 10/10
Sep 23 2024 : joecali: 5/10

Quiz Answer Key and Fun Facts
1. Which of these would be the most suitable candidate as a primary key in a store's database?

Answer: Invoice Number

A primary key is a column that uniquely identifies a row and should have no duplicates. For instance, if an invoice number is SB1021, there cannot be another row containing that value for that column. Invoice numbers go in that column, and they uniquely identify one specific sale.
2. A database where each table has a fixed number of columns and a variable number of rows with individual tables being interconnected based on data they have in common is based on what data model?

Answer: relational model

The relational model was designed at IBM by E.F. Codd in a paper entitled "A Relational Model of Data for Large Shared Databanks".
3. Which of these database management systems is made by IBM?

Answer: Db2

Db2 was released in 1983. It was one of the first database management systems to use the relational model.
4. Which of these values would be the most appropriate for the SQL data type VARCHAR(7)?

Answer: 'Sylvia'

The VARCHAR data type is used for data entries in the form of text. If the length given is greater than the number of characters in the text data entry, the length that is left over will occupy empty space. In this case, "Sylvia" has 6 characters, and the length is 7. The spot for the seventh character will be left vacant.

Depending on the database management system, attempting to assign a numeric value to a VARCHAR field would either give an error or convert the number to a text (possibly losing accuracy or even the correct value if the field is too short).
5. What SQL command adds rows to a table?

Answer: INSERT

The INSERT keyword creates a row with values that corresponds with the column's attributes. Here is an SQL syntax example for the INSERT keyword:

INSERT INTO table EMPLOYEE VALUES (234, 'Sanders', 'Ashley', 'N', '20-Jun-22');

In this example, Ashley Nicole Sanders' employee ID is 234 and her hire date is June 20, 2022. So, EmployeeID=234, EmployeeLastName='Sanders', EmployeeFirstName='Ashley', MiddleInitial='N', and HireDate= '20-Jun-22'.
6. You have 4 tables in a database: TEACHER, CLASSROOM, STUDENT, and BUS. The STUDENT table has three foreign keys that connect to the TEACHER, CLASSROOM, and BUS tables. The CLASSROOM table has a foreign key that connects to the TEACHER table. The TEACHER and BUS tables have no foreign keys. Which table can be dropped first?

Answer: STUDENT

Since there is no foreign key that refers to the STUDENT table, it can be dropped first. That makes CLASSROOM and BUS independent, and either of those tables can be dropped anytime. TEACHER is still connected to CLASSROOM, but CLASSROOM no longer connected to a table with a foreign key, so it is now droppable. So either CLASSROOM or BUS can be dropped after STUDENT. That leaves TEACHER and CLASSROOM (if BUS is dropped) or TEACHER and BUS (if classroom is dropped). If TEACHER and CLASSROOM remain, TEACHER will be the last table to be dropped since CLASSROOM has a foreign key that connects to teacher, making it being the next table to be dropped. If TEACHER and BUS remain, both tables can be dropped in any order since they are now both independent.
7. What is an alternate name for columns and tables called?

Answer: alias

Sometimes columns and tables are given aliases for the sake of making an SQL statement more readable. Aliases can be created by using the AS keyword. Here is an example of an SQL query using aliases:

SELECT TEAM_COLORS AS COLORS
FROM TEAM AS T;

Even though you can create an alias for a table, table names are not passed back to the caller and are typically not needed.
8. The COUNT aggregate function counts all rows including those containing null values.

Answer: False

The COUNT aggregate function only returns the number of rows with non-null values. For example, if your table has 30 rows and 6 of them have null values, the COUNT aggregate function will return 24 rows.
9. Which of these is not a typical size class for database management systems?

Answer: Distributed

Desktop, workgroup, and enterprise databases are defined by the number of end users. Desktop databases support one user (or a very small number of external connections, but these are often very slow). Workgroup database typically support a small to medium number of people such as committee and sub committee members. Enterprise databases support companies consisting of hundreds of people. Centralized and distributed databases are location based rather than based on how many people use the database.

A centralized database has one server while distributed systems use multiple servers which synchronize data between themselves.
10. Which join type will only return rows for which both tables contain data in the respective key column?

Answer: Inner Join

An inner join in SQL is equivalent to the intersection of two sets in a Venn diagram. Typically values of one table's primary key matches the values of another table's foreign key. The query will return the selected rows based on common attribute values between them.

The left join will return rows with all attributes found on the left side (the right side can be identical or empty), whereas the right join will return all attributes found on the right side. As for the full join, it returns rows for all attributes found in both the left table and right table whether they are shared between the tables or not.
Source: Author ebanks120

This quiz was reviewed by FunTrivia editor WesleyCrusher before going online.
Any errors found in FunTrivia content are routinely corrected through our feedback system.
Related Quizzes
This quiz is part of series Computer Science Quizzes:

A series of quizzes on computer programming and architecture.

  1. C++ Trivia Average
  2. Assembly Language for the x86 Processor Average
  3. The Science of Computer Technology Average
  4. Unix Is Unique Average
  5. HTML Fundamentals Average
  6. The SQL Database Environment Average

11/21/2024, Copyright 2024 FunTrivia, Inc. - Report an Error / Contact Us