Database Programming Oracle Dbms
Database Programming Oracle Dbms
A. Which one of the following is used to define the structure of the relation, deleting
relations and relating schemas?
a) DML
b) DDL
c) Query
d) Relational Schema
B. Which one of the following provides the ability to query information from the database
and to insert tuples into, delete tuples from, and modify tuples in the database?
a) DML(Data Manipulation Language)
b) DDL(Data Definition Language)
c) Query
d) Relational Schema
a) Table
b) Values
c) Relation
d) Field
2
Which of the following fields are displayed as output?
a) Salary, dept_id
b) Employee
c) Salary
d) All the field of employee relation
G.
H.
Some of these insert statements will produce an error. Identify the statement.
a) Insert into employee values (1005,Rach,0);
b) Insert into employee values (1002,Joey,335);
c) Insert into employee values (1007,Ross, );
d) None of the mentioned
3
b) Purge
c) Remove
d) Drop table
M.
SELECT * FROM employee WHERE dept_name="Comp Sci";
N. SELECT emp_name
FROM department
WHERE dept_name LIKE ’ _____ Computer Science’;
Which one of the following has to be added into the blank to select the dept_name which
has Computer Science as its ending string?
a) %
b) _
c) ||
d) $
O. .If the attribute phone number is included in the relation all the values need not be entered
into the phone number column. This type of entry is given as.
a) 0
b) –
4
c) Null
d) Empty space
QUESTION TWO
Assume the following SQL script is to be executed:-
CREATE TABLE Students (StudentID CHAR(6)
,StudentFname VARCHAR(20) NOT NULL
,StudentLname VARCHAR(20) NOT NULL
,Date_of_Birth DATE
,CourseCode CHAR(6),
a) Classify TWO types of data integrity checks that have been specified to prevent invalid data
being entered. Give examples of each of these types of data integrity checks.
(4 marks)
b) Change the script to enforce an additional constraint that would be applied to restrict the data
of birth of all students to be later than 01-jan-1998. (2 marks)
5
c) Change the script to enforce an additional constraint that would ensure data integrity between
data referenced in both the Students and Courses Tables. Assume that a student can only
attend one course at a time and a course may have many students. (4 marks)
QUESTION THREE
a) Explain what is meant by a transaction and why it is an important unit of operation in a
DBMS? (2 marks)
b) Describe, with an example, one type of problem that can occur in a multi-user environment
when concurrent access to the database is allowed. (5 marks)
c) Backups of the database should be taken in order to protect data. Describe five measures that
can be taken in order to ensure the security and effectiveness of database backups.
(5 marks)
d) Describe four possible benefits of “Views” in databases. (8 marks)
QUESTION FOUR
Write brief notes on each of the following: (20 marks)
a) File System Data Management: state the problems and limitations evident in File
System.
b) Data Redundancy: state the characteristics of the file system that can lead to it
c) Database system: state the potential costs of implementing a database system.
QUESTION FIVE
6
a) Explain various DML Commands used in SQL with examples. (10 marks)
b) What is database recovery? Write about the sources of failure and recovery procedure.
(10 marks)
QUESTION SIX