The NewsShop Database - XML

The online resources on which NewsShop provides information are divided into various channels. These channels define a broad range of related resources that are further categorized into different categories. These categories are stored in tables, as discussed in the following list:

  • User. NewsShop provides a few categories free of cost to all users. However, to access other categories that are paid, a user needs to register at the Web site of NewsShop. The user can then log on to the site by specifying a username and a password. The information about the usernames and passwords of registered users is stored in the User table.
  • Channel. The Channel table contains the channels, such as Business, Education, and so on.
  • Category. The Category table contains the valid categories for which NewsShop provides information. This table contains a Category Type field that specifies whether a category is free or paid.
  • Article. The Article table contains information about the online resources and their descriptions.

The database design of the NewsShop database is shown in Figure.

The NewsShop Database.

The NewsShop Database

You can create the tables for the NewsShop database, shown in Figure, on SQL Server. When a user requests the data in the NewsShop database by using a Web service, the Web service might need to display data from more than one table. Therefore, you can create a view in SQL that contains data from the Category and Article tables. To create such a view, use the following SQL statement:

In addition, you will create a stored procedure, ValidateLogin, which validates the username and the password of the users who try to log on to the Web service of NewsShop, as shown:

After creating the database, you can create a Web service for NewsShop. We will discuss how to create a Web service in the following section.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

XML Topics