Murach’s SQL for SQL Server – Exercise 10 – Guaranteed 100% score
1. Create a new database named Membership.
2. Write the CREATE TABLE statements needed to implement the following design in
the Membership database. Include reference constraints. Define IndividualID and
GroupID with the IDENTITY keyword. Decide which columns should allow null
values, if any, and explain your decision. Define the Dues column with a default of
zero and a check constraint to allow only positive values.
GroupID, int
GroupName, varchar
Dues, money
Groups
GroupID, int
IndividualID, int
GroupMembership
IndividualID, int
FirstName, varchar
LastName, varchar
Address, varchar
Phone, varchar
Individuals
3. Write the CREATE INDEX statements to create a clustered index on the GroupID
column and a nonclustered index on the IndividualID column of the
GroupMembership table.
4. Write an ALTER TABLE statement that adds a new column, DuesPaid, to the
Individuals table. Use the bit data type, disallow null values, and assign a default
Boolean value of False.
5. Write an ALTER TABLE statement that adds two new check constraints to the
Invoices table of the AP database. The first should allow (1) PaymentDate to be null
only if PaymentTotal is zero and (2) PaymentDate to be not null only if
PaymentTotal is greater than zero. The second constraint should prevent the sum of
PaymentTotal and CreditTotal from being greater than InvoiceTotal.
6. Delete the GroupMembership table from the Membership database. Then write a
CREATE TABLE statement that recreates the table, this time with a unique
constraint that prevents an individual from being a member in the same group twice.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at [email protected].
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at [email protected] and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at [email protected].
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************