Write sql code to create all tables shown in the er diagram

Assignment Help PL-SQL Programming
Reference no: EM131309181

Assignment

The following data model is designed to hold information relating to Students, Student Courses and Tutors who deal with these students. For this scenario we need to define the following facts:

The Entities required should include:

The Entities are related based on the ER diagram below. Use it to determine table relationships. For example

- One Student can enroll in or many Courses

- One Course can have one or many Students enrolled in it.

- One Student can have zero, one or many forms of contact with the Course Tutor

- One Employee (Tutor) can deal with many contacts

- One contact Type (Phone, E-mail, Assessments, Projects etc.) can have zero, one or many contacts

The design allows

• a Student to enroll in one or multiple Courses,

• a Course allowing one or more Students enrolled in it.

• a student may be in contact with the Course Tutor many times using many different forms of contact.

• a tutor will deal with many contacts involving many Students.

Use the following data model to create your tables.

1345_Data Model.jpg

ASSIGNMENT TO COMPLETE

Write the SQL code to create the following:

1. Write sql code to create all tables shown in the ER diagram. Assign appropriate datatype for each field including which should allow NULLs, Primary Key and set as Identity

2. Write sql code for each table to create a Foreign key constraint on appropriate referenced table.

3. Create INDEX on LastName column in Student Information table. Name the new INDEX "IX_LastName."

4. Write code to ALTER Student Information table to ADD new column named CreatedDateTime with datatype as datetime.

5. Write code to ALTER Student Information table to create a DEFAULT on the Country field. Set default as ‘US'

6. Write code to ALTER Student Information table to DROP AltTelephone column.

7. Write sql code to create three stored procedures on the Student Information table:

a. Insert single student record stored procedure. Insert three sample student records.

b. Update Country with ‘Bruin Nation' in single student record. Use StudentID in WHERE clause to update only one record.

c. Delete single student record. Use StudentID in WHERE clause

8. Write sql code to create a VIEW based on the Student Information table. Only return First Name and Last Name columns. Name the view DisplayName

9. Write sql code to create a VIEW based on the Student Information table. Concatenate First Name, Last Name and Title to create new virtual column with alias name of "StudentDisplayName."

10. Create a trigger on the Student Information table to set Country field to UPPER case when new record added.

When submitting completed project just submit the SQL code in a word document or as a sql text file.

Reference no: EM131309181

Questions Cloud

How fear undermines health among immigrants at risk : The issue of fear is a dominant feature that affects how an individual approaches day-to-day living and health. Explain the relationship between fear and health identified by the researchers in the article. Do you agree that structural violence pe..
How does owner occupied housing enter into the accounts : Specifically how does owner occupied housing enter into the accounts? (Hint: Do some Web searching on "imputed rent on owner occupied housing.")
Write a memo rejecting an idea to shorten wait lines : Write a memo rejecting an idea to shorten wait lines.-  Write this memo, using your knowledge of bad-news replies.
Processing of the encounter form : 1. During processing of the encounter form (to generate the claim), the billing specialist notices that the provider entered a check mark in front of the procedure, "Hemoccult Stool," and a check mark in front of the diagnosis, "Gout." Because med..
Write sql code to create all tables shown in the er diagram : Write sql code to create all tables shown in the ER diagram. Assign appropriate datatype for each field including which should allow NULLs, Primary Key and set as Identity.
Provide examples of reasons for project closures : Provide examples of reasons for project closures aside from normal project completion. How do these reasons affect closure processes for a project manager?
Write a blog post to reject an idea on behalf of starbucks : Write a blog post to reject an idea on behalf of Starbucks.- write your response as a blog entry, which might be posted on the site.
More fun and team members more committed : Describe some ways a project manager can make a project more fun and team members more committed.
Which of the transactions would not be counted in gdp : Luigi's Pizza buys 30 pounds of mozzarella cheese, holds it in inventory for 1 month, and then uses it to make pizza (which it sells).

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Write the select statement to show all records

Create a stored function called get_customer_balance which will return a customer's balance from the membership table by passing in a membership number and write a single SELECT statement to show the customer balance for member 102 by using the get..

  Write sql statement to display first-last name of students

Write a SQL statement to display the First and Last name of students who have the Status greater than 1 and less than 10. Use BETWEEN.

  Installation of sql

Describe your experiences related to your setup of MySQL. Include any difficulties or issues that you had encountered during the installation.

  Median-of-three partitioning method

Show the steps of partitioning  36, 38, 8, 31, 19, 15, 14, 35, 20, 7  with median-of-three partitioning method  (only show the first partition into 3 subparts, elements are less than pivot, pivot, elements are larger than pivots).

  You may want to build a database with the required tables

In order to test your program, you may want to build a database with the required tables.  However, the database is not part of the assessment of the assignment.

  Write an equivalent query in the relational algebra

Write an equivalent query in the relational algebra - what is required for a view to be updateable and what happens to the fields of the inserted record in the base table not included in the view.

  Understand the concept of sql

List  all the student Id and teacher Id where GPA is 3 or more than 3. List all the students of the teacher whose name is 'John Eric'. List student Id, name, and address of all the students whose date of birth is 1983. List all the Course Code  where..

  Question regarding the concepts reflection

Analyze the online instruction manual for a home appliance, or locate an online manual for a similar product. Answer the following questions in your analysis:

  Application which tests the random number generation

Write a Java application that inputs three integers from the user and displays the sum, average, product, smallest and largest of the numbers.

  How to select the primary key

How to select the primary key from the candidate keys? How do foreign keys relate to candidate keys? provide examples from either your workplace or class assignments

  How does the order of joins in an sql statement

How does the order of joins in an SQL statement affect the performance of the join and what can the DBA do to determine the preferred order of joins for an SQL statement that includes the join of at least three tables?

  Explain your experiences related to your setup of mysql

Describe your experiences related to your setup of MySQL. Include any difficulties or issues that you had encountered during the installation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd