04 Qmads Project 1 CG-1 - Tài liệu tham khảo | Đại học Hoa Sen

04 Qmads Project 1 CG-1 - Tài liệu tham khảo | Đại học Hoa Sen và thông tin bổ ích giúp sinh viên tham khảo, ôn luyện và phục vụ nhu cầu học tập của mình cụ thể là có định hướng, ôn tập, nắm vững kiến thức môn học và làm bài tốt trong những bài kiểm tra, bài tiểu luận, bài tập kết thúc học phần, từ đó học tập tốt và có kết quả cao cũng như có thể vận dụng tốt những kiến thức mình đã học.

Instructor Inputs
Project
NIIT Project 1.3
The entities for the Shop Here database management system are:
Employee
ItemDetails
OrderDetails
SupplierDetails
ProductCategory
The attributes of the entities listed above are as follows:
Employees: Employee ID, First Name, Last Name, City, Phone
ItemDetails: Item ID, Item Name, Item Description, Unit Price, Quantity In Hand,
Reorder Level, Reorder Quantity, Category ID, Supplier ID
OrderDetails: Purchase Order ID, Employee ID, Order Date, Receiving Date, Item
ID, Quantity Ordered, Quantity Received, Unit Price, Ship Method, Order Status
SupplierDetails: Supplier ID, First Name, Last Name, Address, Phone, Country
ProductCategory: Category ID, Category Name, Category Description
To create a computerized transaction system for Shop Here using SQL Server 2005, the
project team will have to perform the following tasks:
1. Create a database, ShopHere.
2. Create the tables as per the relationship diagram, ensuring minimum disk space
utilization.
3. Perform validations on the tables as per the following guidelines:
Table: Items.ItemDetails
z ItemID must be auto generated.
z ItemName should not be left blank.
z ItemDescription should not be left blank.
z QuantityInHand should be greater than 0. The record should not be inserted or
modified manually if QuantityInHand is 0.
z UnitPrice should be greater than 0.
z ReorderQuantity should be greater than 0.
z ReorderLevel should be greater than 0.
z CategoryID should be the foreign key from the ProductCategory table.
z SupplierID should be the foreign key from the SupplierDetails table.
Case Study 1: Shop Here
1.4 Project NIIT
Table: Items.ProductCategory
z CategoryID must be auto generated.
z CategoryName and CategoryDescription should not be left blank.
z CategoryName should be Household, Sports, Accessories, or Clothing.
Table: Supplier.SupplierDetails
z SupplierID must be auto generated.
z FirstName, LastName, Address, Phone, and Country should not be left blank.
z Phone must be in the following format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9]
[0-9]
Example: 11-111-1111-111-111
Table: HumanResources.Employee
z EmployeeID must be auto generated.
z Employee FirstName, LastName, City, and Phone should not be left blank.
z Phone must be in the following format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9]
[0-9]
Example: 11-111-1111-111-111
Table: Transactions.OrderDetails
z PurchaseOrderID must be auto generated.
z OrderDate should not be greater than the current date.
z If the order date is not entered, the current date should be taken as the default
date.
z QuantityOrdered, QuantityReceived, and UnitPrice should be greater than 0.
z QuantityReceived should allow NULL.
z QuantityReceived cannot be greater than QuantityOrdered.
z QuantityReceived should be added to QuantityInHand in the Items table.
z When a record is inserted into the table, QuantityInHand in the Items table
should be updated automatically.
z OrderStatus must be any of the following values: ‘InTransit’, ‘Received’, or
‘Cancelled’.
z ReceivingDate should allow NULL and should be greater than OrderDate.
NIIT Project 1.5
4. Create appropriate relationships between the tables.
5. Store the order details in a text file on a day-to-day basis. Make use of the required
tools to perform the data transfer.
6. Create the appropriate indexes to speed up the execution of the following tasks:
z Extract the order details for all the purchase orders in the current month.
z Extract the details of all the orders placed more than two years back.
z Extract the details of the top five suppliers to whom the maximum number of
orders have been placed in the current month.
7. Simplify the following tasks:
z Calculation of the total cost for a particular order
z Calculation of the total of all the orders placed by a particular employee in a
particular month
8. Implement an appropriate security policy on the database. For this, create logins
named George, John, and Sara. George is the database administrator and John and
Sara are database developers.
9. Back up the database daily and store it in the C drive.
10. Store crucial data in encrypted format.
11. Ensure that an alert is sent to George whenever the size of the temporary space in the
database server falls below 20 MB.
1.6 Project NIIT
The entities for the Showman House database management system are:
Customers
Events
Employee
EventType
Payments
PaymentMethod
The attributes of the entities listed above are:
Customers: Customer ID, Name, Address, City, State, Phone
Events: Event ID, Event Name, Event Type ID, Location, Start Date, End Date, Staff
Required, Employee ID, Customer ID, No Of People
Payments: Payment ID, Event ID, Payment Amount, Payment Date, Credit Card
Number, Card Holders Name, Credit Card Expiry Date, Payment Method ID, Cheque
No.
PaymentMethods: Payment Method ID, Description
Employee: Employee ID, First Name, Last Name, Address, Phone, Title
EventType: Event Type ID, Description, Charge Per Person
To create the computerized event management system for Showman House, the project
team of CreateMyDb Inc. needs to perform the following tasks:
1. Create a database called ShowmanHouse.
2. Create the table designs as per the relationship diagram ensuring minimum disk
space utilization.
3. Perform validations on the tables as per the following guidelines:
Table: HumanResources.Employees
z EmployeeID should be auto generated.
z FirstName, LastName, Address, and Phone should not be left blank.
z Title should have one of the following values: Executive, Senior Executive,
Management Trainee, Event Manager, or Senior Event Manager.
z Phone should be in the following format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9]
[0-9]
Example: 11-111-1111-111-111
Case Study 2: Showman House
NIIT Project 1.7
Table: Management.Events
z EventID should be auto generated.
z EventName, StartDate, EndDate, Location, NoOfPeople, and StaffRequired
should not be left blank.
z StaffRequired should be greater than 0.
z StartDate should be less than the End Date.
z StartDate and EndDate should be greater than the current date.
z NoOfPeople should be greater than or equal to 50.
z EventTypeID is a foreign key from the EventType table.
z CustomerID is a foreign key from the Customers table.
z EmployeeID is a foreign key from the Employee table.
Table: Management.Payments
z PaymentID must be auto generated.
z PaymentDate should be less than or equal to the start date of the event.
z PaymentDate cannot be less than the current date.
z PaymentMethodID is a foreign key from the PaymentMethods table.
z If the client wants to pay by using a credit card, its details need to be entered in
the record. If a credit card is not being used it must be ensured that the credit
card details are blank.
z ExpiryDate of the credit card should be greater than the current date.
z PaymentAmount should be calculated depending on the event type id and the
charge per person.
z ChequeNo should be entered if the payment is done through cheque, else it
should be left blank.
z PaymentAmount must be calculated by using the following formula:
PaymentAmount = ChargePerPerson * NoOfPeople
Table: Events.Customers
z CustomerID must be auto generated.
z Name, Address, City, State, and Phone should not be left blank.
z Phone should be in the following format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9]
[0-9]
Example: 11-111-1111-111-111
1.8 Project NIIT
Table: Event.EventTypes
z EventTypeID must be auto generated.
z Description should not be left blank.
z ChargePerPerson should be greater than 0.
Table: Management.PaymentMethods
z PaymentMethodID must be auto generated.
z Description must contain any of the three values: cash, cheque, or credit card.
4. Create appropriate relationships between the tables.
5. Store the details of all the employees who have managed an event in the current
month in a text file. This information will be displayed on the organization’s website.
Make use of the required tools to perform the data transfer.
6. Create appropriate indexes to speed up the execution of the following tasks:
z Extracting the customer details for an event organized on a particular date
z Extracting event details for all the events where the payment is pending
z Displaying the details of all the events where the staff required is greater than 25
7. Implement a proper security policy in the database. For this, create logins named
William, Sam, Chris, and Sara. Chris is the database administrator and Williams,
Sam, and Sara are database developers.
8. Back up the database daily and store the backup in the C drive.
9. Store crucial data in encrypted format.
10. Ensure that an alert is sent to Chris whenever the size of the temporary space in the
database falls below 20 MB.
NIIT Project 1.9
The entities for the New Project database management system are:
Employees
Projects
Clients
Time Cards
Work Codes
Time Card Expenses
Time Card Hours
Expense Codes
Payments
Payment Methods
The attributes of the entities listed above are:
Employees: Employee ID, First Name, Last Name, Title, Phone, Billing Rate
Projects: Project ID, Project Name, Project Description, Client ID, Billing Estimate,
Employee ID, Start Date, End Date
Clients: Client ID, Company Name, Address, City, State, Zip, Country, Contact
Person, Phone
Time Cards: Time Card ID, Employee ID, Date Issued
Time Card Hours: Time Card Detail ID, Time Card ID, Date Worked, Project ID,
Work Description, Billable Hours, Total Cost, Work Code ID
Work Codes: Work Code ID, Description
Time Card Expenses: Time Card Expense ID, Time Card ID, Expense Date, Project
ID, Expense Description, Expense Amount, Expense Code ID
Expense Codes: Expense Code ID, Description
Payments: Payment ID, Project ID, Payment Amount, Payment Date, Credit Card
Number, Card Holders Name, Credit Card Expiry Date, Payment Method ID
Payment Methods: Payment Method ID, Description
To create the computerized time card management system for New Project Ltd., the
development team needs to perform the following tasks:
1. Create a database called TimeCard.
2. Create the schemas called Payment, ProjectDetails, CustomerDetails, and
HumanResources.
3. Create the table designs as per the relationship diagram ensuring minimum disk
space utilization.
Case Study 3: New Project Ltd.
1.10 Project NIIT
4. Validate the tables as per the following guidelines:
Table:CustomerDetails.Clients
z ClientID should be auto generated.
z CompanyName, ContactPerson, Address, City, State, Zip, Country, and Phone
should be mandatory.
z Phone must be in the format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9]
[0-9]
Example: 11-111-1111-111-111
Table: HumanResources.Employees
z EmployeeID should be auto generated.
z Title must have any one of the following values: Trainee, Team Member, Team
Leader, Project Manager, or Senior Project Manager.
z BillingRate should be greater than 0.
z FirstName and Phone should not be left blank.
z Phone must be in the format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9]
[0-9]
Example: 11-111-1111-111-111
Table: ProjectDetails.Projects
z ProjectID should be auto generated.
z ProjectName, StartDate, and EndDate should not be left blank.
z BillingEstimate should be greater than 1000 USD.
z EndDate should be greater than the StartDate.
z ClientID is a foreign key from the Clients table.
Table: Payment.PaymentMethod
z PaymentMethodID should be auto generated.
z Description should not be blank.
Table: Payment.Payments
z PaymentID should be auto generated.
z PaymentAmount should be greater than 0.
z PaymentDate should be greater than the end date of the project.
| 1/42

Preview text:

t c je ro Instructor Inputs P Case Study 1: Shop Here
The entities for the Shop Here database management system are:  Employee  ItemDetails  OrderDetails  SupplierDetails  ProductCategory
The attributes of the entities listed above are as follows: 
Employees: Employee ID, First Name, Last Name, City, Phone 
ItemDetails: Item ID, Item Name, Item Description, Unit Price, Quantity In Hand,
Reorder Level, Reorder Quantity, Category ID, Supplier ID 
OrderDetails: Purchase Order ID, Employee ID, Order Date, Receiving Date, Item
ID, Quantity Ordered, Quantity Received, Unit Price, Ship Method, Order Status 
SupplierDetails: Supplier ID, First Name, Last Name, Address, Phone, Country 
ProductCategory: Category ID, Category Name, Category Description
To create a computerized transaction system for Shop Here using SQL Server 2005, the
project team will have to perform the following tasks:
1. Create a database, ShopHere.
2. Create the tables as per the relationship diagram, ensuring minimum disk space utilization.
3. Perform validations on the tables as per the following guidelines:
Table: Items.ItemDetails z
ItemID must be auto generated. z
ItemName should not be left blank. z
ItemDescription should not be left blank. z
QuantityInHand should be greater than 0. The record should not be inserted or
modified manually if QuantityInHand is 0. z
UnitPrice should be greater than 0. z
ReorderQuantity should be greater than 0. z
ReorderLevel should be greater than 0. z
CategoryID should be the foreign key from the ProductCategory table. z
SupplierID should be the foreign key from the SupplierDetails table. NIIT Project 1.3
Table: Items.ProductCategory z
CategoryID must be auto generated. z
CategoryName and CategoryDescription should not be left blank. z
CategoryName should be Household, Sports, Accessories, or Clothing.
Table: Supplier.SupplierDetails z
SupplierID must be auto generated. z
FirstName, LastName, Address, Phone, and Country should not be left blank. z
Phone must be in the following format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9] [0-9]’ Example: 11-111-1111-111-111
Table: HumanResources.Employee z
EmployeeID must be auto generated. z
Employee FirstName, LastName, City, and Phone should not be left blank. z
Phone must be in the following format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9] [0-9]’
Example: 11-111-1111-111-111
Table: Transactions.OrderDetails z
PurchaseOrderID must be auto generated. z
OrderDate should not be greater than the current date. z
If the order date is not entered, the current date should be taken as the default date. z
QuantityOrdered, QuantityReceived, and UnitPrice should be greater than 0. z
QuantityReceived should allow NULL. z
QuantityReceived cannot be greater than QuantityOrdered. z
QuantityReceived should be added to QuantityInHand in the Items table. z
When a record is inserted into the table, QuantityInHand in the Items table
should be updated automatically. z
OrderStatus must be any of the following values: ‘InTransit’, ‘Received’, or ‘Cancelled’. z
ReceivingDate should allow NULL and should be greater than OrderDate. 1.4 Project NIIT
4. Create appropriate relationships between the tables.
5. Store the order details in a text file on a day-to-day basis. Make use of the required
tools to perform the data transfer.
6. Create the appropriate indexes to speed up the execution of the following tasks: z
Extract the order details for all the purchase orders in the current month. z
Extract the details of all the orders placed more than two years back. z
Extract the details of the top five suppliers to whom the maximum number of
orders have been placed in the current month.
7. Simplify the following tasks: z
Calculation of the total cost for a particular order z
Calculation of the total of all the orders placed by a particular employee in a particular month
8. Implement an appropriate security policy on the database. For this, create logins
named George, John, and Sara. George is the database administrator and John and Sara are database developers.
9. Back up the database daily and store it in the C drive.
10. Store crucial data in encrypted format.
11. Ensure that an alert is sent to George whenever the size of the temporary space in the
database server falls below 20 MB. NIIT Project 1.5 Case Study 2: Showman House
The entities for the Showman House database management system are:  Customers  Events  Employee  EventType  Payments  PaymentMethod
The attributes of the entities listed above are: 
Customers: Customer ID, Name, Address, City, State, Phone 
Events: Event ID, Event Name, Event Type ID, Location, Start Date, End Date, Staff
Required, Employee ID, Customer ID, No Of People 
Payments: Payment ID, Event ID, Payment Amount, Payment Date, Credit Card
Number, Card Holders Name, Credit Card Expiry Date, Payment Method ID, Cheque No. 
PaymentMethods: Payment Method ID, Description 
Employee: Employee ID, First Name, Last Name, Address, Phone, Title 
EventType: Event Type ID, Description, Charge Per Person
To create the computerized event management system for Showman House, the project
team of CreateMyDb Inc. needs to perform the following tasks:
1. Create a database called ShowmanHouse.
2. Create the table designs as per the relationship diagram ensuring minimum disk space utilization.
3. Perform validations on the tables as per the following guidelines:
Table: HumanResources.Employees z
EmployeeID should be auto generated. z
FirstName, LastName, Address, and Phone should not be left blank. z
Title should have one of the following values: Executive, Senior Executive,
Management Trainee, Event Manager, or Senior Event Manager. z
Phone should be in the following format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9] [0-9]’ Example: 11-111-1111-111-111 1.6 Project NIIT
Table: Management.Events z
EventID should be auto generated. z
EventName, StartDate, EndDate, Location, NoOfPeople, and StaffRequired should not be left blank. z
StaffRequired should be greater than 0. z
StartDate should be less than the End Date. z
StartDate and EndDate should be greater than the current date. z
NoOfPeople should be greater than or equal to 50. z
EventTypeID is a foreign key from the EventType table. z
CustomerID is a foreign key from the Customers table. z
EmployeeID is a foreign key from the Employee table.
Table: Management.Payments z
PaymentID must be auto generated. z
PaymentDate should be less than or equal to the start date of the event. z
PaymentDate cannot be less than the current date. z
PaymentMethodID is a foreign key from the PaymentMethods table. z
If the client wants to pay by using a credit card, its details need to be entered in
the record. If a credit card is not being used it must be ensured that the credit card details are blank. z
ExpiryDate of the credit card should be greater than the current date. z
PaymentAmount should be calculated depending on the event type id and the charge per person. z
ChequeNo should be entered if the payment is done through cheque, else it should be left blank. z
PaymentAmount must be calculated by using the following formula:
PaymentAmount = ChargePerPerson * NoOfPeople
Table: Events.Customers z
CustomerID must be auto generated. z
Name, Address, City, State, and Phone should not be left blank. z
Phone should be in the following format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9] [0-9]’ Example: 11-111-1111-111-111 NIIT Project 1.7
Table: Event.EventTypes z
EventTypeID must be auto generated. z
Description should not be left blank. z
ChargePerPerson should be greater than 0.
Table: Management.PaymentMethods z
PaymentMethodID must be auto generated. z
Description must contain any of the three values: cash, cheque, or credit card.
4. Create appropriate relationships between the tables.
5. Store the details of all the employees who have managed an event in the current
month in a text file. This information will be displayed on the organization’s website.
Make use of the required tools to perform the data transfer.
6. Create appropriate indexes to speed up the execution of the following tasks: z
Extracting the customer details for an event organized on a particular date z
Extracting event details for all the events where the payment is pending z
Displaying the details of all the events where the staff required is greater than 25
7. Implement a proper security policy in the database. For this, create logins named
William, Sam, Chris, and Sara. Chris is the database administrator and Williams,
Sam, and Sara are database developers.
8. Back up the database daily and store the backup in the C drive.
9. Store crucial data in encrypted format.
10. Ensure that an alert is sent to Chris whenever the size of the temporary space in the database falls below 20 MB. 1.8 Project NIIT
Case Study 3: New Project Ltd.
The entities for the New Project database management system are:  Employees  Projects  Clients  Time Cards  Work Codes  Time Card Expenses  Time Card Hours  Expense Codes  Payments  Payment Methods
The attributes of the entities listed above are: 
Employees: Employee ID, First Name, Last Name, Title, Phone, Billing Rate 
Projects: Project ID, Project Name, Project Description, Client ID, Billing Estimate,
Employee ID, Start Date, End Date 
Clients: Client ID, Company Name, Address, City, State, Zip, Country, Contact Person, Phone 
Time Cards: Time Card ID, Employee ID, Date Issued 
Time Card Hours: Time Card Detail ID, Time Card ID, Date Worked, Project ID,
Work Description, Billable Hours, Total Cost, Work Code ID 
Work Codes: Work Code ID, Description 
Time Card Expenses: Time Card Expense ID, Time Card ID, Expense Date, Project
ID, Expense Description, Expense Amount, Expense Code ID 
Expense Codes: Expense Code ID, Description 
Payments: Payment ID, Project ID, Payment Amount, Payment Date, Credit Card
Number, Card Holders Name, Credit Card Expiry Date, Payment Method ID 
Payment Methods: Payment Method ID, Description
To create the computerized time card management system for New Project Ltd., the
development team needs to perform the following tasks:
1. Create a database called TimeCard.
2. Create the schemas called Payment, ProjectDetails, CustomerDetails, and HumanResources.
3. Create the table designs as per the relationship diagram ensuring minimum disk space utilization. NIIT Project 1.9
4. Validate the tables as per the following guidelines:
Table:CustomerDetails.Clients z
ClientID should be auto generated. z
CompanyName, ContactPerson, Address, City, State, Zip, Country, and Phone should be mandatory. z Phone must be in the format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9] [0-9]’ Example: 11-111-1111-111-111
Table: HumanResources.Employees z
EmployeeID should be auto generated. z
Title must have any one of the following values: Trainee, Team Member, Team
Leader, Project Manager, or Senior Project Manager. z
BillingRate should be greater than 0. z
FirstName and Phone should not be left blank. z Phone must be in the format:
‘[0-9][0-9]-[0-9] [0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9] [0-9]-[0-9] [0-9] [0-9]’ Example: 11-111-1111-111-111
Table: ProjectDetails.Projects z
ProjectID should be auto generated. z
ProjectName, StartDate, and EndDate should not be left blank. z
BillingEstimate should be greater than 1000 USD. z
EndDate should be greater than the StartDate. z
ClientID is a foreign key from the Clients table.
Table: Payment.PaymentMethod z
PaymentMethodID should be auto generated. z
Description should not be blank.
Table: Payment.Payments z
PaymentID should be auto generated. z
PaymentAmount should be greater than 0. z
PaymentDate should be greater than the end date of the project. 1.10 Project NIIT