Working with SQL Server Database Objects - ntroducing Stored Procedures

ToyzUnlimited is a trendy toy store based in California. It buys toys from manufacturers, stocks them in its store and sells them for profits. ToyzUnlimited maintains the details of all branded toy products in a SQL Server 2005 database. To speed up the day-to-day tasks and operations related to the database, it has been decided to use SQL Server 2005 stored procedures for commonly performed tasks. | Working with SQL Server Database Objects Assignments Introducing Stored Procedures Sr. No. Assignment Question 1. ToyzUnlimited is a trendy toy store based in California. It buys toys from manufacturers stocks them in its store and sells them for profits. ToyzUnlimited maintains the details of all branded toy products in a SQL Server 2005 database. To speed up the day-to-day tasks and operations related to the database it has been decided to use SQL Server 2005 stored procedures for commonly performed tasks. Toys Field Name Data Type Key Field Description ProductCode varchar 5 Primary Key Product Code that uniquely identifies each toy Name varchar 30 Name of the toy Category varchar 30 Category of the toy such as for example block building board games puzzles etc Manufacturer varchar 40 Manufacturer name AgeRange varchar 15 Age range for the kids to use the toy. Eg 3-5 years UnitPrice money Price of the toy in dollars Netweight int Weight of the toy in grams QtyOnHand int Quantity available Table Toys Table 1. Start with creating the table Toys. The structure of the table is described above. Add at least 5 records to the table. Ensure that the value of the column QtyOnHand is more than 20 for each of the toys. 2. Write statements to create a stored procedure named HeavyToys that will list names of all the toys that are above 500 grams. 3. Write statements to create a stored procedure named PriceIncrease that will increment the unitprice of all toys by 10 dollars. 4. Write statements to create a stored procedure QtyOnHand that will decrease the quantity on hand of all toys by 5. 5. Execute the stored procedures HeavyToys PriceIncrease and QtyOnHand. 6. In SQL Server Management Studio locate the extended stored procedures defined under the master database and execute the following procedures in a query window 2007 Aptech Ltd Version Page 1 of

Bấm vào đây để xem trước nội dung
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.