Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : A
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : B
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : B
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : B
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : C
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : D
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : C
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : A
Explanation:
The SET TRANSACTION ISOLATION LEVEL SERIALIZABLE statement specifies that no other statement can read data that has been modified but not yet committed by other transactions.
Incorrect Answers:
B: The WITH (UPDLOCK) table hint specifies that the database engine will not update or delete a row that is locked by other transactions.
C: The SET TRANSACTION ISOLATION LEVEL SNAPSHOT statement specifies that data read by any statement in a transaction will be the transactionally consistent version of the data that existed at the start of the transaction. It does not prevent data that is being updated from being read.
D: The WITH (READPAST) table hint specifies that the database engine will skip past a row that is locked by other transactions. However, READPAST can only be specified for a table referenced in an UPDATE or DELETE statement, or for table referenced in a FROM clause.
References:
https://docs.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql?view=sql-server-2017 https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table?view=sql-server-2017
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : B
Explanation:
A partitioned view is a view defined by a UNION ALL of member tables structured in the same way, but stored separately as multiple tables in either the same instance of SQL Server or in a group of autonomous instances of SQL Server servers, called federated database servers.
References:
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-view-transact-sql?view=sql-server-2017
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : C
Explanation:
BATCHSIZE specifes the number of rows in the BULK INSERT opetation to be copied to the server as one transaction at a time. If this transaction fails, SQL
Server commits or rolls back the transaction for every batch.
Incorrect Answers:
A: TABLOCK specifies that a table-level lock is acquired for the duration of the bulk-import operation.
B: MAXERRORS specifies the maximum number of syntax errors allowed in the data before the entire bulk-import operation is canceled. Each row that cannot be imported by the bulk-import operation is ignored and counted as one error.
D: LASTROW specifies the number of the last row to load. The default is 0, which indicates the last row in the specified data file.
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : C
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : BD
Coho Winery -
Overview -
Overview -
You are a database developer for a company named Coho Winery. Coho Winery has an office in London.
Coho Winery has an application that is used to process purchase orders from customers and retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end adds orders to a database named Sales. The Sales database is managed by a server named Server1.
An empty copy of the Sales database is created on a server named Server2 in the London office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of orders from offshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions -
Database and Tables -
The following scripts are used to create the database and its tables:
Answer : D
Topic 7, Fourth Coffee -
Fourth Coffee -
Background -
Corporate Information -
Fourth Coffee is global restaurant chain. There are more than 5,000 locations worldwide.
Physical Locations -
Currently a server at each location hosts a SQL Server 2012 instance. Each instance contains a database called StoreTransactions that stores all transactions from point of sale and uploads summary batches nightly.
Each server belongs to the COFFECORP domain. Local computer accounts access the StoreTransactions database at each store using sysadmin and datareaderwriter roles.
Planned changes -
Fourth Coffee has three major initiatives:
The IT department must consolidate the point of sales database infrastructure.
The marketing department plans to launch a mobile application for micropayments.
The finance department wants to deploy an internal tool that will help detect fraud.
Initially, the mobile application will allow customers to make micropayments to buy coffee and other items on the company web site. These micropayments may be sent as gifts to other users and redeemed within an hour of ownership transfer. Later versions will generate profiles based on customer activity that will push texts and ads generated by an analytics application.
When the consolidation is finished and the mobile application is in production, the micropayments and point of sale transactions will use the same database.
Existing Environment -
Existing Application Environment
Some stores have been using several pilot versions of the micropayment application. Each version currently is in a database that is independent from the point of sales systems. Some versions have been used in field tests at local stores, and others are hosted at corporate servers. All pilot versions were developed by using
SQL Server 2012.
Existing Support Infrastructure -
The proposed database for consolidating micropayments and transactions is called CoffeeTransactions. The database is hosted on a SQL Server 2014 Enterprise
Edition instance and has the following file structures:
Answer : A
Explanation:
The fraud detection service will need to meet the following requirement (among others):
* Detect micropayments that are flagged with a StatusId value that is greater than 3 and that occurred within the last minute.
Fourth Coffee -
Background -
Corporate Information -
Fourth Coffee is global restaurant chain. There are more than 5,000 locations worldwide.
Physical Locations -
Currently a server at each location hosts a SQL Server 2012 instance. Each instance contains a database called StoreTransactions that stores all transactions from point of sale and uploads summary batches nightly.
Each server belongs to the COFFECORP domain. Local computer accounts access the StoreTransactions database at each store using sysadmin and datareaderwriter roles.
Planned changes -
Fourth Coffee has three major initiatives:
The IT department must consolidate the point of sales database infrastructure.
The marketing department plans to launch a mobile application for micropayments.
The finance department wants to deploy an internal tool that will help detect fraud.
Initially, the mobile application will allow customers to make micropayments to buy coffee and other items on the company web site. These micropayments may be sent as gifts to other users and redeemed within an hour of ownership transfer. Later versions will generate profiles based on customer activity that will push texts and ads generated by an analytics application.
When the consolidation is finished and the mobile application is in production, the micropayments and point of sale transactions will use the same database.
Existing Environment -
Existing Application Environment
Some stores have been using several pilot versions of the micropayment application. Each version currently is in a database that is independent from the point of sales systems. Some versions have been used in field tests at local stores, and others are hosted at corporate servers. All pilot versions were developed by using
SQL Server 2012.
Existing Support Infrastructure -
The proposed database for consolidating micropayments and transactions is called CoffeeTransactions. The database is hosted on a SQL Server 2014 Enterprise
Edition instance and has the following file structures:
Answer : A