Monday 29 February 2016

RDBMS Lab@home 6

1. Write a query to display the credit card number of Catherine Abel. (Use the AdventureWorks database)

Ans.

2.Write a query to display EmployeeID of those employees who belong to the department, Tool Design. (Use the AdventureWorks database)

Ans.
3.Write a query to display EmployeeID of those employees who belong to the department, Tool Design. (Use the AdventureWorks database)

Ans.
4. Write a query to display the first name and the last name of the customers along with their credit card identification number. (Use the AdventureWorks database)

Ans. 
5. Write a query to display CreditCardID, CardNumber, and ExpYear of the credit cards that do not expire in the year 2005 and 2007. (Use the AdventureWorks database)

Ans.

6. Write a query to display the sales person ID and the total number of sales orders processed by each sales person. In addition, display the commision earned by each sales person. Commision is given to each sales person at the rate of $ 10 per order. Exclude the orders where sales person ID is null. The details of the sales person who has got the maximum commision should be displayed first in the result set. (Use the AdventureWorks database)


7. Create a table named Recipient in the NarrowFabrics database to store the details of the recipients to whom the orders are dispatched. The following table provides the structure of the Recipient table.


8. NarrowFabrics, Inc. is a leading cloth manufacturing organization that manufactures and delivers clothes to the distributors. Being a database developer at NarrowFabrics, you need to create a database that will store the various database objects, such as tables, views, and indexes, used by the organization. Write the SQL statements that you can use to create a database named NarrowFabrics.


9. Create a table named Country in the NarrowFabrics database to store the country details. The following table provides the structure of the Country table.


10. LiveChain, Inc. is a leading media company that organizes events and provides photography services. After each event, the company stores the pictures taken in the event and delivers the pictures to the client on request. As a database developer, you have been assigned the task to create a database named PictureLibrary that the company can use to store the pictures.


11. John is working with Client Network Ltd as the Database Administrator. He wants to create a database to store the details of all the employees working in the organization. He needs to ensure that while saving, the data is placed in multiple file groups so that he is able to effectively manage the backup and restore operations. What should John do to perform this task?


12. You need to store the details of the offices in the central database, PictureLibrary. Write the SQL statement to create the OfficeLocation table in the PictureLibrary database. The following table shows the structure of the OfficeLocation table.


13. Write a query to make EmpDetail_FG as the default filegroup for the EmpDetail database.




No comments:

Post a Comment