|
Project 4 - Blinky Database Spec Version 2.0, last updated 08/07/2006 |
The database for the blog project is named Blinky, and it is located in a SQL Server database on the http://wren.cis.upenn.edu/ server in Pat's office, Moore 174. Here is how to connect to it. Of Blinky's 4 tables, you should have readonly access to the Blogs, BlogPages, and BlogComments tables.
You should have limited access to the Users table; you should be able to read the UserID and DisplayName columns (but not UserPassword). To discover which blog users really have blogs, you could read through the Blogs table looking at the UserID field in each blog, and adding the blog's username to an array of usernames only if the name was not already in the array. Then you could translate the usernames into display names.
Users
This table contains the users, their passwords, and their display name.
| Column Name | DataType | Length | Allow Nulls | Description |
| UserID [Primary Key] | char | 16 | No | log on name for user. must be unique. |
| UserPassword | char | 16 | No | user password |
| DisplayName | char | 16 | Yes | display name for user |
Blogs
This table contains the blogs and their dates. The BlogTitle must be less than 256 characters. The text of a blog is broken up into 'Pages' (aka, chunks) of 2048 characters. The first page is stored in BlogBody (below). Any additional pages are stored in BlogPages.
| Column Name | DataType | Length | Allow Nulls | Description |
| UserID | char | 16 | No | UserID from Users |
| BlogID [Primary Key] | int | 4 | No | unique integer identifying blog |
| DatePosted | datetime | 8 | No | DateTime that the blog was posted |
| BlogTitle | char | 256 | Yes | Title of Blog |
| BlogBody | char | 2048 | Yes | Body of Blog. If length is exceeded, it will roll over to BlogPages |
BlogPages
This table contains the roll over data for a blog (see above).
| Column Name | DataType | Length | Allow Nulls | Description |
| BlogID [Primary Key] | int | 4 | No | No |
| PageNumber [Primary Key] | int | 4 | No | the number of page, indexed at 1. |
| PageBody | char | 2048 | No | page body |
BlogComments
This table contains the data for the comments on a blog. Note that you can comment on a blog, but not on another comment.
| Column Name | DataType | Length | Allow Nulls | Description |
| OrgBlogID | int | 4 | No | BlogID that the user has commented on |
| CommentID [Primary Key] | int | 4 | No | ID of the comment |
| CommentDate | datetime | 8 | No | comment date/time |
| CommentUserID | char | 16 | No | the login of the user who made the comment |
| CommentBody | char | 2048 | Yes | The text of the user's comment |

Visitors: