Quiz
Database Fundamental Ch 1 - 3
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (38)
1High-school student Rajesh M. Patel works part-time in his dad’s cycle shop in Pune, India. Pune was the first city in India to have dedicated lanes for cycles. Raj’s dad currently keeps track of his inventory using pencil and paper. Ordering parts and accessories or counting inventory takes several days. Raj is taking a database management class in school and he realizes that his dad’s business could benefit greatly by implementing a database management system. Raj needs to review a few basic concepts before he starts, and has made of list of topics he knows will be important in the first steps of the project.
Identify tables that Raj might create for the database.- AA part table, a cycle table, and an accessories table
- BOne table for all parts, cycles, and accessories
- CA table for each part, each cycle, and each type of accessory (a helmet table, a biking glove table, and so on)
2High-school student Rajesh M. Patel works part-time in his dad’s cycle shop in Pune, India. Pune was the first city in India to have dedicated lanes for cycles. Raj’s dad currently keeps track of his inventory using pencil and paper. Ordering parts and accessories or counting inventory takes several days. Raj is taking a database management class in school and he realizes that his dad’s business could benefit greatly by implementing a database management system. Raj needs to review a few basic concepts before he starts, and has made of list of topics he knows will be important in the first steps of the project.
Identify the fields that Raj should use for column headings of the parts table.- A part number, part name, cycle number, and cycle name
- Bpart number and quantity sold
- Cpart number, part name, quantity, color, and cycle identifier
3High-school student Rajesh M. Patel works part-time in his dad’s cycle shop in Pune, India. Pune was the first city in India to have dedicated lanes for cycles. Raj’s dad currently keeps track of his inventory using pencil and paper. Ordering parts and accessories or counting inventory takes several days. Raj is taking a database management class in school and he realizes that his dad’s business could benefit greatly by implementing a database management system. Raj needs to review a few basic concepts before he starts, and has made of list of topics he knows will be important in the first steps of the project.
What is the name of the data located at the intersection of a row and column?- Afield
- Brecord
- Cvariable
4The next step for Raj in the design of the database to streamline his father’s cycle business is to determine the most useful relationships between the tables. He knows that he needs to create a relational database because it will be important to conduct searches by using data in one table to find additional data in another table. Figuring out a design that best meets the needs of the cycle shop is a critical step. While reviewing his current business requirements, he realizes that he needs to add another table to include the suppliers of the parts for the cycles. This new table requires Raj to update the parts table to include a foreign key to the supplier table.
What is the relationship between the supplier table and the parts table?- Aone-to-one
- Bone-to-many
- Cmany-to-many
5The next step for Raj in the design of the database to streamline his father’s cycle business is to determine the most useful relationships between the tables. He knows that he needs to create a relational database because it will be important to conduct searches by using data in one table to find additional data in another table. Figuring out a design that best meets the needs of the cycle shop is a critical step. While reviewing his current business requirements, he realizes that he needs to add another table to include the suppliers of the parts for the cycles. This new table requires Raj to update the parts table to include a foreign key to the supplier table.
What is a good foreign key for the relationship between the cycle table and the parts table?- Apart number
- Bcycle model number
- Cpart name
6The next step for Raj in the design of the database to streamline his father’s cycle business is to determine the most useful relationships between the tables. He knows that he needs to create a relational database because it will be important to conduct searches by using data in one table to find additional data in another table. Figuring out a design that best meets the needs of the cycle shop is a critical step. While reviewing his current business requirements, he realizes that he needs to add another table to include the suppliers of the parts for the cycles. This new table requires Raj to update the parts table to include a foreign key to the supplier table.
What is a suggested primary key for the accessory table?- Aaccessory number
- Baccessory name
- Caccessory model
7Raj has the cycle database setup for his dad’s cycle shop in India. The next step is to work with his dad to learn what operations he will need to perform with the database. These are called user requirements. His dad needs the new application to perform these initial tasks (other requirements will be defined later):
What DML (data manipulation language) command must be used to indicate that a cycle was sold and should be removed from the Cycle table?- ADELETE FROM Cycle WHERE cycle _ id = T1234
- BREMOVE FROM Cycle WHERE cycle _ id = T1234
- CERASE FROM Cycle WHERE cycle _ id = T1234
8Raj has the cycle database setup for his dad’s cycle shop in India. The next step is to work with his dad to learn what operations he will need to perform with the database. These are called user requirements. His dad needs the new application to perform these initial tasks (other requirements will be defined later):
What command is used to report on the current on-hand quantities of red cycles?- ASELECT cycle _ model WHERE cycle _ color = ‘red’
- BSELECT * FROM Cycle WHERE cycle _ color = ‘red’
- CFIND * FROM Cycle WHERE cycle _ color = ‘red’
9Raj has the cycle database setup for his dad’s cycle shop in India. The next step is to work with his dad to learn what operations he will need to perform with the database. These are called user requirements. His dad needs the new application to perform these initial tasks (other requirements will be defined later):
How is a new cycle added to the Cycle table in the database?- AINSERT INTO Cycle (C3425, ‘Rockrider, ‘red’, 9999.00)
- BADD INTO Cycle VALUES (C3425, ‘Rockrider’, ‘red’, 9999.00)
- CINSERT INTO Cycle VALUES (C3425, ‘Rockrider’, ‘red’, 9999.00)
10Raj is making excellent progress automating his dad’s cycle shop. He has reduced the amount of paperwork and provided more accurate information for his dad to maintain the current inventory. As a result of the automation, his dad has decided that he wants to use a website to advertise and sell cycles. Raj is in charge of the next phase of this exciting change to the cycle shop business. Raj immediately realizes that the current database schema needs to be changed. If they are going to allow users to buy from the internet, he needs to have photos of all their products, including cycles, accessories, and parts.
Which DDL command can Raj use to add a new field to the Cycle table to store the file name of the photo?- AALTER TABLE Cycle ADD photo _ file _ name CHAR (30) NULL
- BADD photo _ file _ name TO TABLE Cycle
- CALTER Cycle TABLE USING photo _ file _ name CHAR(30) NULL
11Raj is making excellent progress automating his dad’s cycle shop. He has reduced the amount of paperwork and provided more accurate information for his dad to maintain the current inventory. As a result of the automation, his dad has decided that he wants to use a website to advertise and sell cycles. Raj is in charge of the next phase of this exciting change to the cycle shop business. Raj immediately realizes that the current database schema needs to be changed. If they are going to allow users to buy from the internet, he needs to have photos of all their products, including cycles, accessories, and parts.
What effect does the word NULL have when adding a new cycle to the table?
Based off of: ALTER TABLE Cycle ADD photo _ file _ name CHAR (30) NULL- Arequires the user to enter a filename for the photo
- Bdoes not require the user to enter a filename for the photo
- Cautomatically enters a filename for the photo
12Raj is making excellent progress automating his dad’s cycle shop. He has reduced the amount of paperwork and provided more accurate information for his dad to maintain the current inventory. As a result of the automation, his dad has decided that he wants to use a website to advertise and sell cycles. Raj is in charge of the next phase of this exciting change to the cycle shop business. Raj immediately realizes that the current database schema needs to be changed. If they are going to allow users to buy from the internet, he needs to have photos of all their products, including cycles, accessories, and parts.
What is the main difference between the DML command DELETE and the DDL command DROP?- AThey accomplish the same task; therefore, there is no difference
- BDELETE removes all (or a subset of) records from the table only; it does not
remove the table - CDROP removes all records from the table only; it does not remove the table
13Yuhong Li’s son, Yan, is taking a programming course in school and he asked her advice on selecting a project for class. Yuhong suggests that Yan create a program to help organize her CD collection that she has accumulated over the years. Yan likes the idea. He can create a database table to store all of data related to his mother’s collection and use C# or Visual Basic to create a user interface to search, add, and delete information from the table. Yan knows that defining the table fields is very important and selecting the right data type for each field is critical.
What data type should Yan use to store the CD label name?- Achar or variable char
- Bname
- Cinteger
14Yuhong Li’s son, Yan, is taking a programming course in school and he asked her advice on selecting a project for class. Yuhong suggests that Yan create a program to help organize her CD collection that she has accumulated over the years. Yan likes the idea. He can create a database table to store all of data related to his mother’s collection and use C# or Visual Basic to create a user interface to search, add, and delete information from the table. Yan knows that defining the table fields is very important and selecting the right data type for each field is critical.
What data type should he use to store the number of tracks on each CD?- Areal number
- Binteger
- Cchar
15Yuhong Li’s son, Yan, is taking a programming course in school and he asked her advice on selecting a project for class. Yuhong suggests that Yan create a program to help organize her CD collection that she has accumulated over the years. Yan likes the idea. He can create a database table to store all of data related to his mother’s collection and use C# or Visual Basic to create a user interface to search, add, and delete information from the table. Yan knows that defining the table fields is very important and selecting the right data type for each field is critical.
What data type should Yan use to store the duration of the song in total seconds?- Abyte
- Binteger
- CBoolean
16Yan has gathered together all of the CDs in his mother’s collection – she has more than he imagined! He has identified the data fields he needs in his database table and the best data type for each piece of data, so he is ready to create the database tables. Yan plans to set up the table using proper ANSI SQL syntax and wants to brush up on the details before he begins.
Proper ANSI SQL syntax refers to a set of rules that:- Adecide if a field can contain a blank value or not
- Bdetermine the size of all the data fields
- Cgovern the structure and content of statements
17Yan has gathered together all of the CDs in his mother’s collection – she has more than he imagined! He has identified the data fields he needs in his database table and the best data type for each piece of data, so he is ready to create the database tables. Yan plans to set up the table using proper ANSI SQL syntax and wants to brush up on the details before he begins.
Which SQL command is used to add a new table?- ACREATE TABLE table_name (column_name data type null/not null, column_name data type
null/not null, and so on) - BADD TABLE table_name (column_name data type null/not null, column_name data type null/not null,
and so on) - CINSERT TABLE table_name (column_name data type null/not null, column_name
data type null/not null, and so on)
- ACREATE TABLE table_name (column_name data type null/not null, column_name data type
18Yan has gathered together all of the CDs in his mother’s collection – she has more than he imagined! He has identified the data fields he needs in his database table and the best data type for each piece of data, so he is ready to create the database tables. Yan plans to set up the table using proper ANSI SQL syntax and wants to brush up on the details before he begins.
Based on the information Yan has gathered, what data field can he use
for a unique key to access the data in the table?- Aartist name
- BCD label name
- Ctrack name
19Yan is learning about views in his database management class. His instructor explained that there are two approaches to creating views: using a command line language T-SQL (Transact-SQL) or by using a graphical designer. Yan wants to apply his new learning to the database project he is creating for his mother’s CD collection. He has identified the following requirements for his application and will use T-SQL to create views:
• View all CDs sorted in alphabetical order
• Report on all CDs with a certain number of tracks
• Create a list of CDs by artist
• Calculate a count of all CDs
What is the best application of views and T-SQL for this project?- Acreate separate views with the information for each request
- Bcreate a new table for each of requirements in the list
- Cadd data to the existing tables when more CDs are purchased
20Yan is learning about views in his database management class. His instructor explained that there are two approaches to creating views: using a command line language T-SQL (Transact-SQL) or by using a graphical designer. Yan wants to apply his new learning to the database project he is creating for his mother’s CD collection. He has identified the following requirements for his application and will use T-SQL to create views:
• View all CDs sorted in alphabetical order
• Report on all CDs with a certain number of tracks
• Create a list of CDs by artist
• Calculate a count of all CDs
Which of the following is an important benefit of using views?- Aallow the user to access the data in the tables directly
- Breduce the storage requirements for the application and database
- Cuse to represent summation data
21Yan is learning about views in his database management class. His instructor explained that there are two approaches to creating views: using a command line language T-SQL (Transact-SQL) or by using a graphical designer. Yan wants to apply his new learning to the database project he is creating for his mother’s CD collection. He has identified the following requirements for his application and will use T-SQL to create views:
• View all CDs sorted in alphabetical order
• Report on all CDs with a certain number of tracks
• Create a list of CDs by artist
• Calculate a count of all CDs
Which code segment creates a view containing the title, artist, and year for all
CDs with more than 10 tracks?- ACREATE VIEW CD _ More _ than _ 10 AS SELECT CD _ Title, CD _ Artist,
CD _ Year FROM CD _ Collection WHERE Tracks > 10 - BCREATE TABLE CD _ More _ than _ 10 AS SELECT CD _ Title, CD _ Artist,
CD _ Year FROM CD _ Collection WHERE Tracks > 10 - CCREATE VIEW AS CD _ More _ than _ 10 FROM CD _ Collection WHERE Tracks > 10
- ACREATE VIEW CD _ More _ than _ 10 AS SELECT CD _ Title, CD _ Artist,
22After having gone through the process of creating the CD collection database for his mother, Yan realizes that this type of structure can be used for many other inventory databases. He has discovered that some common functionality is available in predefined SQL functions. By utilizing these built-in, ready-to-use functions, he can increase his productivity and spend his time creating any other necessary user-defined functions. Yan has also learned to distinguish between aggregate and scalar functions.
What aggregate function can Yan use to calculate the total number of CDs in the CD collection
database?- ASUM(column name)
- BCOUNT(column name)
- CAVG(column name)
23After having gone through the process of creating the CD collection database for his mother, Yan realizes
that this type of structure can be used for many other inventory databases.
He has discovered that some common functionality is available in predefined SQL functions. By utilizing these
built-in, ready-to-use functions, he can increase his productivity and spend his time creating any other
necessary user-defined functions. Yan has also learned to distinguish between aggregate and scalar functions.
Yan is not quite sure how scalar functions work. Which of the following is a scalar function?- AFIRST(column name) returns the first field in the specified column
- BSUM(column name) returns the total of all values in the column
- CUCASE(column name) returns the value of the field in all uppercase letters
24After having gone through the process of creating the CD collection database for his mother, Yan realizes that this type of structure can be used for many other inventory databases. He has discovered that some common functionality is available in predefined SQL functions. By utilizing these built-in, ready-to-use functions, he can increase his productivity and spend his time creating any other necessary user-defined functions. Yan has also learned to distinguish between aggregate and scalar functions.
How is a stored procedure invoked?- ARUN (procedure name, input values)
- BEXECUTE (procedure name, input values)
- CPERFORM (procedure name, input values)
25Katarina Larsson has always been very athletic; she enjoys kayaking, hiking, swimming, cycling, and more. So, Katarina was thrilled when she was hired as an intern in the information systems division of Adventure Works. Katarina is studying database management in college, so this internship is a valuable experience with the benefits of experiencing athletic adventures in Nova Scotia, Canada. Part of her new position includes writing SQL queries to analyze data about current trends in the recreational activities on the island enjoyed by residents and tourists. Katarina is ready to start creating reports on the following activities:
• hiking
• Whale watching
• kayaking
• camping
• Golfing
Which command would ensure that return visitors are only counted once when running a query
against the reservation system?- ASELECT ONLY
- BSELECT DISTINCT
- CSELECT UNIQUE
26Katarina Larsson has always been very athletic; she enjoys kayaking, hiking, swimming, cycling, and more. So, Katarina was thrilled when she was hired as an intern in the information systems division of Adventure Works. Katarina is studying database management in college, so this internship is a valuable experience with the benefits of experiencing athletic adventures in Nova Scotia, Canada. Part of her new position includes writing SQL queries to analyze data about current trends in the recreational activities on the island enjoyed by residents and tourists. Katarina is ready to start creating reports on the following activities:
• hiking
• Whale watching
• kayaking
• camping
• Golfing
For some of the reports it will be useful to see the results in alphabetical order.
Which command will produce an alphabetical list?- AORDER BY column _ name (either ASC or DESC)
- BSORT BY column _ name (either ASC or DESC)
- CARRANGE BY column _ name (either ASC or DESC)
27Katarina Larsson has always been very athletic; she enjoys kayaking, hiking, swimming, cycling, and more. So, Katarina was thrilled when she was hired as an intern in the information systems division of Adventure Works. Katarina is studying database management in college, so this internship is a valuable experience with the benefits of experiencing athletic adventures in Nova Scotia, Canada. Part of her new position includes writing SQL queries to analyze data about current trends in the recreational activities on the island enjoyed by residents and tourists. Katarina is ready to start creating reports on the following activities:
• hiking
• Whale watching
• kayaking
• camping
• Golfing
A truth table is helpful in visualizing the results of logical operators.
When comparing two fields, which condition always results in TRUE?- Athe AND operator and only one field = TRUE
- Bthe OR operator and at least one field = TRUE
- Cthe AND operator and at least one field = FALSE
28Nova Scotia is a beautiful location and Katrina is enjoying a variety of outdoor activities in her free time. She loves her new job at Adventure Works because it is challenging and she is learning a great deal! She is three weeks into her internship and realizes that by applying some complex queries to the recreational trends database she will be able to produce some very enlightening reports. She decides to take some time to review the concepts for sub queries (predicate, scalar, and table), UNIONS, JOINS, and INTERSECTS.
Which statement best defines a predicate subquery?- Areturns a single value; can be used in CASE expressions, WHERE clauses, ORDER BY, and SELECT
- Breturns a table based on the queries nested in the FROM clause
- Cuses extended logical constructs in the WHERE clause using AND, OR, LIKE, BETWEEN, AS, and TOP
29What is the difference between UNION and JOIN?
- AUNION combines the results of two SQL queries when there is the same number of columns and data
types; JOIN returns rows when there is at least one column match. - BUNION combines the results of two SQL queries when there is at least one column
match; JOIN returns rows when there is the same number of columns
and data types. - CUNION only returns rows that appear in both tables; JOIN returns rows when
there is at least one column match.
- AUNION combines the results of two SQL queries when there is the same number of columns and data
30When should the INTERSECT query be used?
- Ato find all rows from the left table even if there are no matches
- Bto return all rows that appear in both tables, similar to a Boolean OR
- Cto return only the rows that appear in both tables, similar to a Boolean AND
31Katarina gained a better understanding of the database layout through her reporting project at Adventure Works. The database manager for the team has given her a new assignment. She will be responsible for writing the SQL stored procedures that can be used by the programmers to insert, update, and delete data from the database. Adventure Works has gathered lots of new data from tourists about their preferences for recreational activities in Nova Scotia. Katarina’s first task is to insert new rows into the database to store this data. Katarina wants to refresh her memory on how to efficiently and correctly insert data into a database before she attempts this very important task.
How can Katarina set up the INSERT to allow the programmer to copy rows from other tables?- AShe can use the INSERT INTO with a SELECT . . . FROM clause
- BThis cannot be done with an INSERT command; she must use a JOIN.
- CShe can use row value constructors.
32When designing the INSERT SQL, what happens if data is missing for a particular column?
- AThe INSERT statement returns a syntax error.
- BThe INSERT statement uses the default value for the column.
- CThe INSERT statement inserts a NULL value in the column.
33What is the correct syntax for inserting multiple rows at one time?
- AINSERT INTO table (column1, val1a), (column2, val2a);
- BINSERT (column1, column2) VALUES (val1a, val1b), (val2a, val2b)INTO table;
- CINSERT INTO table (column1, column2) VALUES (val1a, val1b), (val2a, val2b);
34Because of her extensive work in adding data and creating reports from the Adventure Works database on recreational activities, Katarina has a better understanding of the company’s database organization. The database manager for the team is pleased with her progress and has given her a new assignment. She will be responsible for writing the SQL stored procedures that will be used by the developers to insert, update, and delete data from the database.
The developer wants to update all records in a database to reflect an increase in the provincial
value-added tax from 8 percent to 10 percent. Which of the following is the correct syntax?- AUPDATE RENTALS SET value _ added _ tax = .10;
- BSET sales _ tax _ rate = .10 IN RENTALS;
- CUPDATE sales _ tax _ rate = .10 IN RENTALS;
35Because of her extensive work in adding data and creating reports from the Adventure Works database on recreational activities, Katarina has a better understanding of the company’s database organization. The database manager for the team is pleased with her progress and has given her a new assignment. She will be responsible for writing the SQL stored procedures that will be used by the developers to insert, update, and delete data from the database.
Katarina wants to update data if a condition is true and perform an alternative update if the
condition is false. Which of the following is the best choice?- ACASE statement
- BLIKE statement
- CIF/THEN/ELSE statement
36What happens if a WHERE statement is not included with the DELETE statement?
- AThe entire table is deleted
- BThe data from the table is deleted
- CThe user receives a syntax error
37How are transactions useful when updating/deleting/adding records to a database?
- AThey allows multiple statements to be grouped together to avoid data integrity errors
- BThey count the number of changes to records in the table
- CThey restrict updates to only allow one statement to execute at a time
38How can a programmer enforce data integrity rules when making changes
to the records in a database?- AWhen all statements in a transaction have successfully completed, issue a commit
statement - BWhen all statements in a transaction have successfully completed, issue a rollback
statement - CWhen an error occurs in one statement inside a transaction, issue a com- mit
statement and continue to the next statement
- AWhen all statements in a transaction have successfully completed, issue a commit
Information
- Description
- Quiz on Database Fundamental Ch 1 - 3, created by cindyngien on 02/04/2015.
- Author
- cindyngien
- Language
- English
- Views
- 4
- History
- Created on 2 Apr 2015 · updated on 19 Feb 2016
- Rating
- No ratings yet Rate this quiz