Domain 1_ Database Design _ Quizizz
What ensures that orphaned records do not occur?
a) Primary keys
b) Entity-relationship diagrams (ERDs)
c) Referential integrity
d) Composite keys
In the database design and building process, when should an entity-relationship diagram (ERD) be created?
a) Before a database is built
b) After a database has been built
c) When a database is being built
d) After a database has been in use for a significant period of time
What is a primary key field?
a) A field that can only be altered by one person with specific credentials
b) A field that ensures every record in a table is the same
c) A field that is unable to be altered
d) A field that ensures every record in a table is unique
Which statement best defines normalization?
a) The process of ensuring primary keys exist within the same column in all entities within a database
b) The process of creating primary keys
c) The process of ensuring that an entity in a database has a solid design and that the data in the entity can work well with other entities
d) The process of ensuring that all entities in a database have at least one primary key and one composite key
What is a characteristic of one-to-one relationships?
a) They use a primary key in one table and a non-primary key in another table
b) They use primary keys from three tables
c) They use non-primary keys from two tables
d) They use primary keys from two tables
Which two data field types are text fields?
a) Money
b) Int
c) Nvarchar
d) Varchar
It is important to make sure a database is backed up regularly so that the data can be if it is accidentally deleted or changed.
a) debugged
b) replaced
c) restored
d) remade
Within a database, what is data stored in?
a) Entities
b) Graphs
c) Columns
d) Rows
Which data field type would be used to store a value of 0 or 1?
a) Varchar
b) Datetime
c) Bit
d) Date
Varchar uses _________ amount of memory.
a) The number of characters plus two bytes
b) Double the number of characters
c) 8 bytes
d) 4 bytes
Nvarchar uses _________ amount of memory.
a) The number of characters plus two bytes
b) 4 bytes
c) Double the number of characters
d) 8 bytes
Smallmoney uses _________ amount of memory.
a) The number of characters plus two bytes
b) 4 bytes
c) Double the number of characters
d) 8 bytes
Datetime uses _________ amount of memory.
a) 4 bytes
b) Double the number of characters
c) The number of characters plus two bytes
d) 8 bytes
What is a column, also known as a field?
a) A place to enter data within an entity
b) A description of the data being stored
c) A line within an entity
d) An entity property that defines the data being stored in records
Match the data field type to its number range: -2 billion to 2 billion
a) Int
b) Small integer
c) Tiny integer
d) Money field
Which role is automatically assigned to any user on a server and assigned to a database?
a) Default
b) Guest
c) User
d) Public
What is a row, also known as a record?
a) A line within an entity
b) Entity properties that filter data
c) A description of the data being stored
d) A copy of data within an entity
Which statement best defines referential integrity?
a) A concept that ensures that a primary key value exists in a relationship before the corresponding foreign key value is allowed
b) A concept that ensures that there is at least one primary key in every table within a database
c) A concept that ensures that a composite key value exists in a relationship before the corresponding foreign key value is allowed
d) A concept that ensures that a foreign key value exists in a relationship before the corresponding primary key value is allowed
Which is a sign of a well-built entity-relationship diagram (ERD)?
a) The primary key field is indicated
b) The columns being used in relationships are indicated
c) Entity names are indicated
d) Entities are shown as having multiple relationships with one another
Refer to the image. Which option should be set to Yes to enforce referential integrity?
a) INSERT and UPDATE Specifications
b) Enforce Foreign Key Constraint
c) Check Existing Data on Creation
d) Enforce For Replication
A bit field is usually used as a
a) date
b) text
c) numeric
d) boolean
Money data field type uses _________ amount of memory.
a) 1 byte
b) 8 bytes
c) 4 bytes
TinyInt data field type uses _________ amount of memory.
a) 8 bytes
b) 1 byte
c) 4 bytes
Int data field type uses _________ amount of memory.
a) 4 bytes
b) 8 bytes
c) 1 byte
What does the WITH GRANT OPTION clause add to a GRANT statement?
a) The ability for the administrator to grant all privileges to others
b) The ability for the user getting the permission to grant that permission to others
c) The ability for the user getting the permission to grant all permissions to others
d) The ability for the administrator to grant others the same permission being granted to the administrator
When a permission on a resource is no longer needed, which statement is run to remove that permission?
a) DENY
b) DELETE
c) REVOKE
d) DROP
What is the principle of least privilege?
a) A principle that states that people should have access to all permissions
b) A principle that states that people should only have the permissions they need to do their job
c) A principle that states that people should only have the permissions they request
d) A principle that states that people should have access to all permissions unless there is no need for them to have access to a permission
What should one do in the first form of normalization?
a) Ensure that there is a composite key in every entity
b) Ensure that every record in an entity is unique and all fields are independent of one another
c) Ensure that there are only two fields that have duplicate data
d) Ensure that every primary key is the same across all entities
Refer to the image. What is the displayed graphic called?
a) Entry relationship diagram (ERD)
b) Entry resolution diagram (ERD)
c) Entity relationship diagram (ERD)
d) Entity resolution diagram (ERD)
Which two data field types are numeric fields?
a) Varchar
b) Money
c) Nvarchar
d) Int
Which statement best defines third normal form?
a) A value change in a non-key column in one table necessitates a change in another non-key column
b) A value change in a key column in one table necessitates a change in another key column
c) A value change in a key column in one table does not necessitate a change in a non-key column
d) A value change in a non-key column in one table does not necessitate a change in another non-key column
What do primary keys usually consist of?
a) Multiple rows
b) A single column
c) A single row
d) Multiple columns
Which data field type allows for Unicode characters?
a) Bit
b) Varchar
c) Datetime
d) Nvarchar
Why might a composite key, also known as a compound key, be necessary for a database?
a) If the information within a column designated as a primary key exists in more than one column
b) If the data within a table is linked to another table
c) To provide more security for the database
d) If multiple users access the database
Integer data type has a range of?
a) -32,767 to 32,767
b) -214,000 to 214,000
c) 0 to 255
d) -922 trillion to 922 trillion
e) -2 billion to 2 billion
Small integer data type has a range of?
a) -214,000 to 214,000
b) -32,767 to 32,767
c) 0 to 255
d) -922 trillion to 922 trillion
e) -2 billion to 2 billion
Tiny integer data type has a range of?
a) -922 trillion to 922 trillion
b) -32,767 to 32,767
c) 0 to 255
d) -2 billion to 2 billion
e) -214,000 to 214,000
Money field data type has a range of?
a) -32,767 to 32,767
b) 0 to 255
c) -2 billion to 2 billion
d) -214,000 to 214,000
e) -922 trillion to 922 trillion
Smallmoney field data type has a range of?
a) -32,767 to 32,767
b) 0 to 255
c) -214,000 to 214,000
d) -2 billion to 2 billion
e) -922 trillion to 922 trillion
Verifying a backup file ensures it is ready to be restored.
a) The file can be tested
b) The file can have its contents examined
c) The file can be verified
d) Part of the file can be restored
Domain 2_ Database Object Management _ Quiziz
Which command removes a table from a database?
b) DROP TABLE
Which statement best defines a view?
b) A stored statement that leads one to specific information
What type of parameter must be specified when creating a stored procedure?
d) Input
What is not allowed in object names in SQL?
a) Spaces
While a clustered index is based on a
b) column (a non-clustered index can be based on any other field).
Refer to the image. What will happen when this code is executed?
a) The code will not run due to an error in the syntax
Which three pieces of information should be specified when creating a table?
b) The columns to add to the table
d) The name of the table
e) The data types for each column within the table
By default,
d) null values are allowed in columns when tables are created.
What type of parameter is used in apps to return a value that the app will use later?
b) Output
The main purpose of a view is that it can accept parameters.
b) False
To change a view, with what keyword should CREATE in the CREATE VIEW command be replaced?
b) ALTER
What is one main security benefit of stored procedures being used within app code?
c) A stored procedure hides SQL keywords from being exposed in app code
Which best defines the purpose of an index?
b) Helps speed up queries within a table as long as the indexes are created with strategic purpose
What function must be included in a stored procedure to see the results of a function that runs inside of the stored procedure?
d) RETURN
Which piece of information goes in parentheses when creating a nonclustered index in SQL?
d) The columns being indexed
What is the only way to make changes to a table structure after a table has been created?
c) Use the ALTER command to make changes to the table
How should one change a column from not allowing null values to allowing null values?
d) Alter the column with the ALTER command
Domain 3_ Data Retrieval _ Quizizz
1. Once a table alias is established, it has to be used throughout the __________.
Answer: b) query2. Where should a WHERE clause be used within the GROUP BY clause?
Answer: d) Before the GROUP BY clause3. Which comparison operator should one use to return records from before a given date?
Answer: d) <4. Which statement best defines a self join?
Answer: b) A join between two columns in the same table5. The WHERE clause creates __________ on the data being queried.
Answer: d) filters6. When would one normally implement a full outer join? Choose two answers.
Answers:
a) Mismatched records from both tables in a join need to be visible
b) Before combining two data sets into one7. The percent symbol (%) is a __________ that allows any number of characters.
Answer: b) wildcard8. Which statement best defines an inner join?
Answer: a) A join in which records will only display if the value of the join field is in both tables.9. What clause is used to sort information in a query?
Answer: d) ORDER BY10. Rather than using a join, one may use a ___________ to display fields from a corresponding table.
Answer: d) subquery11. What keyword can be used with a WHERE clause to filter information within a range?
Answer: b) BETWEEN12. Which aggregate is used to show the highest value in a numeric field within a group?
Answer: c) MAX13. What keyword or key phrase can be used to return only records that do not match multiple criteria?
Answer: a) NOT IN14. Refer to the image. What will happen when this self join is executed?
Answer: d) The result will display the employees with a manager but omit the employee without a manager.15. Which aggregate is used to show the average of a numerical field?
Answer: a) AVG16. Refer to the image. Which WHERE clause will show every person except for those living in Los Angeles in the results?
Answer: a) WHERE NOT City = 'Los Angeles'17. Which comparison operator returns records on or before a given date?
Answer: d) <=18. Refer to the image. What type of join is shown?
Answer: c) Left outer join19. Refer to the image. What is the column alias?
Answer: d) Line Total20. Which aggregate is used to show the number of records for each item in a group?
Answer: b) COUNT21. Which aggregate is used to show the lowest value in a numeric field within a group?
Answer: b) MIN22. What keyword or key phrase shows records with fields that are not empty?
Answer: a) NOT NULL23. Which statement best defines a cartesian product, also known as a cross join?
Answer: b) Every record in one table is related to every record in another.24. Refer to the image. What should the first line of the SELECT statement read to limit results to the first 100 records in the table?
Answer: a) SELECT TOP 100 FirstName,25. Refer to the image. What will the results of this query show?
Answer: c) People living in Los Angeles with the last name Cox and people living in Long Beach with the last name Cox.26. Refer to the image. What information will the new column show?
Answer: b) The list price with 10% taken off.27. What keyword should one use between two SELECT statements to show records that are alike in two tables?
Answer: a) INTERSECT28. What letters can be added to the end of a column to show the column in reverse order?
Answer: a) DESC29. What keyword or key phrase is used to filter records from an aggregate?
Answer: b) HAVING30. A user wants to see all records from the Sales.Customer table and only records with an entry in the CustomerID column from the Sales.SalesOrderHeader table. What type of join should the user implement?
Answer: a) Left outer join31. What keyword or key phrase shows records with empty fields?
Answer: c) NULL32. What keyword shows every record that matches the same criteria?
Answer: a) ALL33. What purpose does a DISTINCT keyword after a SELECT statement serve?
Answer: d) It prevents duplicate rows from showing in a result.34. What clause is used for columns that are not being used in an aggregate?
Answer: d) GROUP BY35. In a query involving a table, where does the WHERE clause belong?
Answer: c) After the table36. What clause should be used to get an approximate match to a search rather than an exact match?
Answer: d) LIKE clause37. What keyword can be used between two criteria when using a WHERE clause to narrow results further?
Answer: c) AND38. Which aggregate totals the values of a field?
Answer: c) SUM39. What keyword should one use between two SELECT statements to combine two datasets into one?
Answer: c) UNION40. Which comparison operator returns records after a given date?
Answer: c) >41. Which comparison operator returns records on or after a given date?
Answer: d) >=42. What function can be added to a computed column to show the results as dollar amounts?
Answer: a) Currency function (cur)43. What keyword shows all records with at least one match in a subquery?
Answer: d) ANY44. What keyword or key phrase can be used with a WHERE clause to return records matching multiple criteria?
Answer: c) INDomain 4: Data Manipulation
1. What statement is used to change existing data?
Answer: d) UPDATE2. What is the difference between a DELETE statement and a TRUNCATE TABLE statement?
Answer: d) One can identify specific records that are being deleted with a DELETE statement, while a TRUNCATE TABLE statement deletes all data in a table.3. What statement is used to copy records from one table into an existing table?
Answer: b) INSERT INTO...SELECT4. What statement is used to insert values into a table?
Answer: d) INSERT INTO...VALUES5. What keyword removes records from a table?
Answer: a) DELETE6. What statement is used to copy records from an existing table to a new table?
Answer: d) SELECT INTO7. What clause should always be included in an UPDATE statement?
Answer: b) WHERE8. What must be included in parentheses in an INSERT INTO...VALUES statement?
Answer: c) Required fields
Domain 5: Troubleshooting
1. One error that may occur is attempting to retrieve data with a well-written query but against the wrong ___________.
Answer: c) database2. Which statement best defines a syntax error?
Answer: d) Causes a statement not to run3. Refer to the image. What is the runtime error in the query?
Answer: c) The Sales.Customer table has not been created yet4. Refer to the image. What is the syntax error in the query?
Answer: a) There is a comma after the last column listed in the query5. Refer to the image. What is the runtime error in the query?
Answer: b) The primary key entry is being duplicated6. Refer to the image. What is the syntax error in the query?
Answer: d) The VALUES keyword is missing7. Refer to the image. What type of error is shown in the query?
Answer: a) Syntax error8. Refer to the image. What type of error is shown in the query?
Answer: c) Runtime error4o