Professional Documents
Culture Documents
CSC 313 Past Questions Answer
CSC 313 Past Questions Answer
CSC 313 Past Questions Answer
1.
a. Developers hide the complexity of database-system from users through several levels of abstraction
to simplify users' interaction with the system. Discuss the three levels of abstraction that helps to
achieve this.
Answer
The three levels of abstraction are:
i. Physical Level:
The lowest level of abstraction describes how the data are actually stored. The physical level describes
complex low-level data structures in detail.
b.
i. SELECT title
FROM course
prepared by Antoni
WHERE dept_name='computer science' AND credit=3;
WHERE instructor.dept_name='physics';
SET salary=salary*0.10;
C.
FROM student
WHERE matricNo=2034000002;
FROM student
SET lastName='Zinwota'
WHERE matricNo=2034000004;
prepared by Antoni
2.
a. Discuss the following integrity constraints that are implemented by databases systems;
*Assertions
*Authorization
* Domain constraints.
Answer
Assertions:
An assertion is a condition that we wish the database always to satisfy before a query.
When an assertion is created, the system tests it for validity. If the assertion is valid, then any future
modification to the database is allowed only if it does not cause that assertion to be violate.
Authorization:
Authorization is a mechanism which differentiate among the users of the database on the type of access
they are permitted on various data values in the database.
Each of these types of authorizations is called a privilege. We may authorize the user all, none, or a
combination of these types of privileges on specified parts of a database, such as a relation or a view.
Domain Constraints:
Domain constraints specify the set of possible values that may be associated with an attribute.
Such constraints may also prohibit the use of null values for particular attributes.
3.
prepared by Antoni
a.
Answer
Views are useful for hiding unneeded information and for gathering together information from more
than one relation into a single view.
Answer
CREATE VIEW v AS <query expression>;
Answer(iii)
CREATE VIEW instructor_view AS
Answer (iv)
b.
Answer
i.
prepared by Antoni
5.
a.
Give the appropriate names for all the definitions below as used in relational algebra
-A table with rows and columns
(Relation)
- A row of a relation
(Tuple)
- Named column of a relation
(Attribute)
- set of allowable values for one or more attributes
(Domain)
-Number of attributes in a relation
(Degree)
- Number of tuples in a relation
(Cardinality)
-A collection of normalized relation with distinct relation names
(Relational Database)
b.
Explain why relational algebra is considered a procedural query language and give at least 2
distinctive attributes that set relational algebra as a procedural query language from other kinds of
query languages.
Answer
Because it specify what data is required and how to get it.
prepared by Antoni
1. The order is specified in which the operations have to be performed.
c.
State the expression for the operations below and the requisite conditions that must be met before a
function can be executed.
-Select
σpredicate(relation)
-project
Πattributes(relation)
-union
r∪s
prepared by Antoni