0% found this document useful (0 votes)
8 views

Information Systems Visual Studio Worked Example

The document discusses questions related to an exam on entity relationship diagrams (EERD) and database normalization. It provides examples of EERD questions and issues related to normalization that may be covered. It also mentions designing a web form using Visual Studio and SQL to register student fundraising amounts.

Uploaded by

aidanansley2468
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Information Systems Visual Studio Worked Example

The document discusses questions related to an exam on entity relationship diagrams (EERD) and database normalization. It provides examples of EERD questions and issues related to normalization that may be covered. It also mentions designing a web form using Visual Studio and SQL to register student fundraising amounts.

Uploaded by

aidanansley2468
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

ELO 3 Questions

Do not come to the exam if you do not know the classical Client-Order structure. You must know it.

Make sure you know how to write the relational models from an EERD and vice versa.

Question 2: EERD For A3 2019: EXPECT a Client-Order type question

Modern Computer Aided design (CAD) packages like AutoCAD and Solid Ede rely on an underlying relational
database to store design information. This enables the designer to see the effect of a single design change on the
whole design. It also ensures that a change in e.g. a dimension is made in one place so multiple changes are avoided.
A product that is created consists of at least one or more sub-assemblies. A sub-assembly may consist of none or
more other sub-assemblies., while a sub-assembly again consists of at least one or more parts. A part can be used in
different sub-assemblies. Standard features define a part, where features can be faces, edges, holes, chamfers and
so on. Each feature is defined by its type (hole, groove etc.) and at least one but usually more than one dimension
that must be stored separately. An existing sub-assembly may be reused in other products. Products, sub-
assemblies, parts and standard features all have text descriptions.

Develop and represent the EERD for the requirements above.

Notice the table that links to itself twice. The sub assembly can consist of two or more sub-assemblies.

Indicate primary entities. Otherwise it is wrong. Write P next to the block or thicken the lines.
ELO 3 Questions
Question 3: Normalization See 2010 A2 – Q3

You can’t apply the basic steps here. The repetition rule is not applicable here. You are being tested on how you will
break the rules to get to the answer. [This question was hell. Very unsure of my answer]

WORD (Words, Description, )

Synonym (Words, Words)

Antonym (Words, Words)


ELO 3 Questions
Please know the difference between a Diagram Zero and Context Diagram

Question 4: DFD Context diagram (Testing a bit of insight)

A vehicle fleet management system (VFMS) monitors the movement of trucks via satellite tracking technology. A
truck sends its position, registration number, speed and fuel consumption continuously to the system via a
telemetry, but the system samples the signal only every 10 minutes where after the observation is stored
electronically. A credit card is used when a truck must pay a toll fee at a toll gate, and the receipt is sent directly and
electronically to the VFMS financial clerk. An operator of the VFMS can at any time request the position and/or
average speed over a certain time period of a given truck.

Compile the context diagram for the description.

Never have data stores on Context diagram level. Only Diagram Zero gets major data stores. So we ignore the saving
of data as it is detail for another level.
ELO 3 Questions
Question 5: Standard Project question - The A3 will have a similar structure

A large number of students participate in a project to collect funds to support other students with textbooks. A bank
account is maintained for this purpose, and the curator of the project registers all amounts paid in the database. A
student can register many amounts, but an amount registered is associated with a specific student. The student
collecting the most money by June 30th receives a gift from McDonuts. The total amount collected to date (a derived
item) by a student must be stored with the students detail. The data structure of the database is shown below.

Design a webpage using MS-Visual Studio and SQL code to accomplish registration of amounts. Explain your design in
detail. The design must enable the curator to enter new amounts and the change(s) must be shown, i.e. the latest
amounts must be displayed. The web page must contain at least one insert form and all students and their total
amounts collected must be shown. The individual amounts collected must be shown. The individual amount
transactions of the past must also be shown. Give the purpose of each VB (Visual Basic) object you use.

Assume:

1. A SQL database with valid tables and relationships exist and is already populated.
2. A valid working connection string exists.
3. It’s not necessary to describe the starting Visual studio or opening a new apex page. Simply start as if the
program is ready.
4. Assume a valid webpage is open.

The user interface:


ELO 3 Questions
StudentIDFK can only be the FK of StudentNo. Even though the names are different we need to show insight as to
that it can only be StudentNo’s FK. (AmountID, DatePaid, Amountpaid does not make sense for being a FK for
StudentNo)

The relationship is one to many (From tStudents to Amounts table) each time you add an amount you create a new
enrty for the student so that you can have multiple entries for a student on a table.

The final layout of the answer was given under as the user interface. We just need to add two Gridviews. One that
shows the total amount of each student transaction and the second that shows the individual payments received
from each student.

Prof wants to see a form where he can ADD (INSERT) the date. He wants to ADD (INSERT) the amount and he wants
a dropdown list (DDL) with the Student name to choose from to prevent typing a name wrong.

This question had two steps in it.


① Primary  INSERT (the transactions)
② Secondary  UPDATE (the total amount that each student registered)
The following is an attempt at the answer and can be subject to improvements.
Marks indicated for each step in [#]
My Total marks is out of 35
Additional information or explanation in {}
① Primary  INSERT (the transactions)
1. Add a SQL datasource and name it dsStudents [2]
2. Point it using the connection string to tStudents. This will feed correct data to the student dropdownlist. [2]
3. Add SQL datasource, name it dsInsertAmount. The purpose is for this to insert transactions into table
Amounts. [3]
4. At Advanced Enable ISNERT, UPDATE, DELETE SQL statements for dsInsertAmount [1]
{We need this enabled beacause the students ddl will just read from a set table of data but this table will
need to be updated with data we input so it needs to be enabled for the user.}
5. Add a formview, name it fvInsertAmount. Link to dsInsertAmouts. [3]
6. Change the behaviour from default to INSERT [1]
7. Go to Edit Template and select InsertItemTemplate. This changes the default display to an insert and
cancel display (You can see the visual representation at the end of this attempt) [2]
8. Go to insert item template and delete the studentNo textbox. Replace it with a ddl. Rename it ddlStudents
assosiacte it with dsStudents. [3]
9. Enable Auto Postback [1]
10. Data bind the DDL student with StudentIDFK. [2]
{This step is crucial as we deleted the textbox next to Student Name. The textbox associated with students
we deleted so we must restore the databinding to make sure whatever is selected in the ddl of students will
go into the StudentIDFK column in the amounts table. We repair the lost connection, if not the INSERT will
not work}
ELO 3 Questions
11. Add a gridview and rename it to gvStudents. Associate it with dsStudents. This will display the tStudents
table and the cumulative amouts of each student. [3]
12. Add a gridview and rename it to gvInsertAmount. Associate it with dsInsertAmount. This will display new
individual entries made by students. [3]

② Secondary  UPDATE (the total amount of the student)


We need to know that the object dsInsertAmounts has certain events associated with it. One of the events is Item
Inserted. There are 2 of them. Item inserting (present tense), and item inserted (Past tense). We want to utilise this
to do the update for us.
Once the record is inserted into the Amounts table we want to update the tStudent table with the cumulative
amount.
Now for the code part for the formview [9]- All that is important is in Blue. Write that in the test
So after we clicked the submit button. We go to Visual Basic where the Coding starts and select ItemInserted to
help. It is in the right hand corner

We are not expected to write out code. We must conceptually show that we can intercept the ItemInserted event at
the Amounts table and use it to update our tStudents table.

Conceptually tell that we need the Amount table and we need tStudents table via: [2]
Sub fvInsertAmount_ItemInserted ( )
Dim txtAmount as Textbox = fvInsertAmount.FindControl (“AmountPaidTextBox”)
This will refer to that little box next to amounts. This gives you a handle on that. If the syntax is not exactly like that
in VB it’s not an issue but the main idea should conceptually be intact and shown that you understand the logic.

The concept is: Working over the boundary of the Formview asking it to give the handle to the Amounts box (where
we enter the contribution made) and we put it into the (integer) Dim txtAmount.

We now do the same for the ddlStudents because an amount is linked to a specific student chosen. [1]
Dim ddlStudents as DropDownList = fvInsertAmount_FindControl (“ddlStudents”)

The concept is we now have references to txtAmounts and ddlStudents with this code.
Why do we need these references? We want to write an update SQL string. And this is the important part of the
secondary task (② Secondary  UPDATE).

Before we can update the SQL string we must define it: [1]
Dim SQL as String

Now we write the code that will update the tStudents table. [1]
SQL = “UPDATE tStudents SET CumulativeAmount = CumulativeAmount + ” & txtAmount.Text & “WHERE
StudentNo = “ & ddlStudents.Text

This string of code updates the CumulativeAmount in the tStudents table by taking the specific student that
contributed and taking their specific current cumulative value and adding the new amount contributed using the
txtAmount we defined. The WHERE tells the program where to update the contribution. And we told it to update
WHERE the StudentNo is the same as what is in the ddlStudents box using the reference we made for the
ddlStudents at the second line of code.
ELO 3 Questions

The exact code is not as important as showing prof that you want to:
Update tStudents table  Adjust Cumulative amounts  Remember to do it WHERE

Please remember that: INSERT happens at the end of a table and UPDATE changes data in a specific row and the
specific row is given by WHERE. Know what we want to do. Otherwise he will know you don’t know what’s up.

After all the coding we add the update commands: [2]


dsInsertAmount.UpdateCommand = SQL
dsInsertAmount.Update()

If you want to be fancy add update gridviews code too: [2]


gvStudents.DataBind()
gvInsertAmount.DataBind()

End Sub
Visual representation of step 7)
Amounts Table:

After linking the Formview to the Amounts table and changing the behaviour to ‘Insert’. Then changing the
Formview to an InsertItemTemplate you get the following:

The insert and cancel is added after


InsertItemTemplate is selected. It was originally Edit
Delete New. See Brians video on SunLearn
Delete the textbox next to StudentIDFK and replace with a dropdownlist. Rename the dropdownlist to ddlStudents.
The resultant is:

You might also like