0% found this document useful (0 votes)
3 views

SQL Database Concepts Exercise.

SQL concepts

Uploaded by

abemaa92
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

SQL Database Concepts Exercise.

SQL concepts

Uploaded by

abemaa92
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1. Which of the following is NOT a built-in data type in SQL Server 2012?

a) Int
b) Char
c) Date
d) Currency

2. Which data type would you use to store a variable-length string of up to 2GB in SQL
Server 2012?
a) Varchar(max)
b) Text
c) Nvarchar
d) Char

3. Which of the following is a potential drawback of implicit data type conversions in


SQL Server?
a) It can lead to faster query execution times.
b) It can simplify query writing by reducing the need for explicit type
conversions.
c) It can result in unexpected query results due to data loss or truncation.
d) It is only applicable to certain data types and cannot be used with others.

4. Which of the following is a potential issue to be aware of when using CAST to


convert a numeric value into a character string in SQL Server? a

a. The length of the resulting string may not be sufficient to hold the
entire value.
b) The CAST function only works with integer values, not decimal values.
c) The CAST function can result in the loss of precision for the numeric value.
d) The resulting character string may not be compatible with other string-based
functions or operators.

5. Which of the following is NOT a characteristic of a stored procedure in SQL Server?

a) They can be used to encapsulate complex business logic.


b) They can be executed by multiple users at the same time.
c) They can return multiple result sets.
d) They can be used to create or modify database objects.

6. Which of the following statements about triggers in SQL Server is true?


a) Triggers are used to enforce referential integrity constraints.
b) Triggers can be used to encapsulate complex business logic.
c) Triggers are always fired before a data modification operation is executed.
d) Triggers are always executed as part of a transaction.

7. Which of the following statements about databases in SQL Server is true?


a) A database can contain multiple schemas.
b) A database can be used to define relationships between tables.
c) A database can be backed up and restored to a point-in-time.
d) A database can be used to execute procedural code
8. Which of the following statements about views in SQL Server is true?
a) Views are physical copies of table data.
b) Views can be used to encapsulate complex queries.
c) Views can be used to store data in a denormalized format.
d) Views can be used to execute procedural code.

9. Which of the following statements about views in SQL Server is true?


a) Views are physical copies of table data.
b) Views can be used to encapsulate complex queries.
c) Views can be used to store data in a denormalized format.
d) Views can be used to execute procedural code.

10. Which SQL keyword is used to retrieve data from one or more tables in a database?
a) Select
b) Delete
c) Insert
d) Retrieve
e) None of the above

True or False
1. File groups in SQL Server are used to organize database objects physically on disk.
2. The primary advantage of file groups in SQL Server is that they allow for more
efficient backup and recovery of the database.
3. File groups in SQL Server can be used to specify which database objects should be
backed up or restored.
4. When creating a file group in SQL Server, it is necessary to specify the location of the
physical files on disk.
5. One disadvantage of using file groups in SQL Server is that it can increase the
complexity of database administration.
6. It is possible to move database objects from one file group to another in SQL Server
using the ALTER TABLE statement.
7. In SQL Server, a file group can be marked as read-only to prevent modifications to
the objects stored in it.
8. It is possible to perform a partial backup of a file group in SQL Server, rather than
backing up the entire database.
9. File groups in SQL Server are not supported in all editions of the software.
10. In SQL Server, it is possible to specify a different backup schedule for each file group
in a database.

You might also like