Ask PL-SQL Expert

Assignment

Consider the following tables (and data) that make up a database used to run Mafunzo University in a MySQL database environment.

Students

RegNo

Stu d Narne

DateOfBirth

Degree Course

J12/1234/2001

Ma ry Atieno

19901-1

BSc Computer Science

J25/9999/2001

Peter Ka ma u

1989-4-7

BSc Maths

P21/4554/2001

Mohammed Aziz

1991-6-7

BSc Chem

P21/4555/2001

J Noe Wa svpa

1991-3-4

BSc Chem

P21/4556/2001

Moses Ara ka

1990-5-17

BSc Chem

Z100/76786/2001

Joseph Musyoka

1990-4-4

BSc Maths, Chem

Courses

CourseCode

Title

Dept

SCH301

Physical Chem istry

Chemistry

SCH302

Inorpnic Chemistry

Chemistry

SCH303

Therm odyna mics

Chemistry

SCO206

Data has a System

CIT

SCO207

Computer Programming

CIT

SMA100

Basic Maths

Mathematics

SMA260

Linear Aleetra I

Mathematics

Registration

CourseCode

RegNo

TotalMark

SCH301

P21/4564/2001

62

SCH301

P21/4565/2001

71

SCH302

P21/4564/2001

41

SCH302

P21/4565/2001

72

SCH302

Z100/76786/2001

35

SCH303

J25/9999/2001

50

SCH303

P21/4565/2001

75

SCO206

J12/1234/2001

30

SCO206

J25/9959/2001

40

SCO207

J25/9999/2001

50

SMA200

J25/9999/2001

60

SMA200

Z100/76786/2001

70

Required:

1. Answer the following questions:

i) Draw an E-R Diagram that could have been used to come up with the above database.

ii) Describe three situations in the above database design where primary. keys have been used.

iii) Describe an example of a situation in the above database design where a foreign key has been used

iv) Describe three examples of constraints lapart from primary key -foreign key related constraints) that could be implemented as part of this database design,

2. Using the program named Notepad (or any other suitable text edito0 write out an 'SQL batch file' to:

i) Construct a database named rvlafunzo
ii) Construct the database tables structures above

3. Using the program named Notepad (or any other suitable text editor) write out an 'SQL batch file' to populate the tables created in question 2 so that they contain the records as shown in the sample database above_

Be creative and don't just copy the format of the previously provided batch files. Run the batch SQL files and then attempt the following questions:

4. Write out SQL queries that would perform the following tasks:

i) Retrieve the name of each student who registered in the course titled Data base Systems'

ii) Retrieve the title of the course along with the number DI students who registered in this course in order of the student registration number.

iii) Retrieve for each student the average mark attained for the courses registered for. Arrange the list in order of students' ages in starting from the oldest to the youngest

iv) Generate a list of course units (title and code) and respective average, standard deviation of mark attain ed by students taking the course

v) Generate a list of departments and the average mark attained by students taking courses offered in each department

5. Consider the following student relation:

Stud_ID

Shame

Course_ID

Units

101

Lennon

MSI 250

3.00

101

Lennon

MSI 415

3.00

125

Johnson

MSI 331

3.00

Clearly showing the steps you have followed, normalize it to 2NF.

6. You have a consultancy in which you work parttime. A local branch of a Ikwetu bank has commissioned you to design a database for them. Your system should enable them to maintain information about customers and their accounts.

Draw an ER diagram to model the application given the following information:

- Each customer has a name, a permanent address, and a KFA Pin number.

• Each customer can have multiple phone numbers, and the same phone number may be shared by multiple customers_

• A customer can own multiple accounts, but each account is owned by a single customer.

• Each account has an account number, a type (such as saving, current: etc), and a balance:

• The bank issues an account statement for each account and mails it to its account owner every month_ As time goes on, there will be multiple statem ents of the same account

• Each statement has an issued date and a statem ent ID. All the statements of the same account have different statement IDs, but two different accounts could have statements with the sam e statement ID. For example, it is possible that account A has a statement with ID '123', while account I3 has another statem ent with the same ID '123'.

If you need ad ditional assumptions to complete your diagram, please state your assumptions here as well.

PL-SQL, Programming

  • Category:- PL-SQL
  • Reference No.:- M92679215

Have any Question?


Related Questions in PL-SQL

Complete the following tasksin microsoft access create the

Complete the following tasks: In Microsoft Access, create the database and tables that you identified in W3 Assignment 2. In Microsoft Word, write the SQL statements to create the database and tables. Write SQL statement ...

Purpose of the assessment with ulo mapping the purpose of

Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop skills in managing data in databases and to gain understanding of data model development and implementation using a commercially a ...

Continuing the project you have worked on in weeks 1-4 in

Continuing the project you have worked on in Weeks 1-4, in this final week, complete the following tasks: Refine your database and SQL statements by incorporating your instructor's feedback. Verify that the database comp ...

For this assignment you will be provided a database backup

For this assignment, you will be provided a database backup for a database called FinanceDB. You will have to restore this backup to your own version of SQL Server. All of the questions in this assignment relate to the F ...

Assignment - queries functions and triggersaimthe aims of

Assignment - Queries, Functions and Triggers Aim The aims of this assignment are to: formulate SQL queries; populate an RDBMS with a real dataset, and analyse the data; design test data for testing SQL queries; create SQ ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As