CSCI335 SampleFinalExam
CSCI335 SampleFinalExam
Good Luck
Page 1 of 7
CSCI335 Sample Final Exam Fall 2021 – 2022
1. An aggregate function is a function where the values of multiple rows are grouped
together as input on certain criteria to form a single value of more significant
meaning such as average , total and product
2. The Deletion anomaly is when we delete one tuple, other tuples will be deleted as
well.
3. The count() function returns the number of columns in a relation
4. In order for a table to be in 1NF, there must not be multi-valued attributes.
5. In 2NF, we eliminate all Hidden Dependencies.
6. The Insert anomaly means that when we insert a new data, a lot of tuples need to
be updated as well.
7. A table can be in 3NF, even if it is not in 1NF.
8. If a relation is in 2NF, then it is also in 1NF.
9. Not being able to insert data because other data is required is an example of an
update anomaly.
10.All the attributes found in the “GROUP BY” clause should be also found in the
SELECT clause.
Page 2 of 7
CSCI335 Sample Final Exam Fall 2021 – 2022
c. Bank
8. The primary key is selected from the:
a. Composite keys
b. Determinants
c. Candidate keys
d. Foreign keys
9. To get the number of returned tuples from a query, which aggregate function we use?
a. Count
b. max
c. sum
d. We can use all of the above
10. You can add a row using SQL in a database with which of the following?
a. ADD
b. CREATE
c. INSERT
d. MAKE
Page 4 of 7
CSCI335 Sample Final Exam Fall 2021 – 2022
1) The table is susceptible to anomalies. Provide examples of insertion, deletion, and update anomalies
2) Describe and illustrate the process of normalizing the table into 3NF
Page 5 of 7
CSCI335 Sample Final Exam Fall 2021 – 2022
Patient Prescription
Medicine
Page 6 of 7
CSCI335 Sample Final Exam Fall 2021 – 2022
4. Find the names of patients who have a prescription that contains the medicine called Panadol.
7. Find the names of the patients who have prescriptions from the ‘Well Nutrition’ clinic
9. Find the name of the medicine(s) that have the lowest price
10. Find the name(s) of patient(s) who have more than one prescription
11. Find all the information about all medicines sorted in the ascending order of price.
12. Find the name of all medicines that have an ingredient called ‘paracetamol’
13. Find the name of all patients whose ID ends with ‘445’
Page 7 of 7