I) 1.What are the limitation on trigger?
2.Explain Update Trigger
3.What is Transaction and its characteristic?
4.How the transaction control statements affect @@trancount
Statement value of @@trancount
1.Begin tran -----
2.Commit tran -----
3.Save tran -----
4.Rollback trigger -----
5.Rollback tran -----
6.Rollback tran save item -----
5. What is Rollback Transaction and how it is differ from Rollback Trigger?
6. What is difference between chained and unchained mode in transaction?
II) Under consideration is the database of naval ships that took part in World War II. The database has the following
relations:
Classes(class,type,country,numGuns,bore,displacement)
Ships(name,class,launched)
Battles(name,date)
Outcomes(ship,battle,result)
Ships in classes are arranged to a single project. A class is normally assigned the name of the first ship in the class under consideration (head ship); otherwise, class name does not coincide with any ship name in the database).
The relation Classes includes the class name, type (bb for a battle ship, or bc for a battle cruiser), country the ship was built, number of main guns, gun caliber (diameter of the gun barrel, in inches), and displacement (weight in tons). The relation Ships includes the ship's name, its class name, and launch year. The relation Battles covers the name and date of the battle the ships participated; while the result of their participation in the battle (sunk, damaged, or unharmed - OK) is in the relation Outcomes. Note: the relation Outcomes may include the ships not included in the relation Ships.
1. Modify data in Classes table so that gun calibers are measured in centimeters (1 inch = 2.5cm), and the
displacement - in metric tons (1 metric ton = 1.1 tons). Calculate displacement to within integer.
Ans: update classes set bore=bore*2.5,displacement=round(displacement/1.1,0)
2. Delete from Ships table all the ships that belongs to
3. Find the names of ship in the ships sunked in battles and the names of corresponding battles.
No comments:
Post a Comment