0% found this document useful (0 votes)
5 views6 pages

Database Programming Oracle Dbms

The document consists of a series of questions related to SQL and database management concepts. It covers topics such as data manipulation language (DML), data definition language (DDL), data integrity, and database transactions. Additionally, it addresses the importance of constraints, views, and the database development life cycle.

Uploaded by

mwiigo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views6 pages

Database Programming Oracle Dbms

The document consists of a series of questions related to SQL and database management concepts. It covers topics such as data manipulation language (DML), data definition language (DDL), data integrity, and database transactions. Additionally, it addresses the importance of constraints, views, and the database development life cycle.

Uploaded by

mwiigo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

QUESTION ONE

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

C. CREATE TABLE employee (name VARCHAR, id INTEGER)


What type of statement is this?
a) DML
b) DDL
c) View
d) Integrity constraint

D. SELECT * FROM employee


What type of statement is this?
a) DML
b) DDL
c) View
d) Integrity constraint

E. In the given query which of the keyword has to be inserted?

INSERT INTO employee _____ (1002,Joey,2000);

a) Table
b) Values
c) Relation
d) Field

F. SELECT * FROM employee WHERE salary>10000 AND dept_id=101;

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.

Employee_id Name Salary


1001 Annie 6000
1009 Ross 4500
1018 Zeith 7000

This is Employee table.


Which of the following employee_id will be displayed for the given query?
SELECT * FROM employee WHERE employee_id>1009;
a) 1009, 1001, 1018
b) 1009, 1018
c) 1001
d) 1018

H.

CREATE TABLE employee (id INTEGER,name VARCHAR(20),salary NOT NULL);


INSERT INTO employee VALUES (1005,Rach,0);
INSERT INTO employee VALUES (1007,Ross, );
INSERT INTO employee VALUES (1002,Joey,335);

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

I. Which of the following statements contains an error?


a) Select * from emp where empid = 10003;
b) Select empid from emp where empid = 10006;
c) Select empid from emp;
d) Select empid where empid = 1009 and lastname = ‘GELLER’;

J. To remove a relation from an SQL database, we use the ______ command.


a) Delete

3
b) Purge
c) Remove
d) Drop table

K. The number of attributes in relation is called as its.


a) Cardinality
b) Degree
c) Tuples
d) Entity
L.
INSERT INTO instructor VALUES (10211, ’Smith’, ’Biology’, 66000);
What type of statement is this?
a) Query
b) DML
c) Relational
d) DDL

M.
SELECT * FROM employee WHERE dept_name="Comp Sci";

In the SQL given above there is an error . Identify the error.


a) Dept_name
b) Employee
c) “Comp Sci”
d) From

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),

CONSTRAINT student_pk PRIMARY KEY (Studentid));


CREATE TABLE Courses (CourseCode CHAR(6) PRIMARY KEY
,CourseLevel INT
,Fee NUMBER(5,2));

INSERT INTO Students VALUES ('234349', 'Bill', 'Nomas', NULL, NULL);


INSERT INTO Students VALUES ('234350', 'Ramesh', 'Haslam', 22, 'SET');
INSERT INTO Students VALUES ('234351','John','Norman', 24, 'GHR');
INSERT INTO Students VALUES ('234347','John','Sagatara', NULL, NULL);
INSERT INTO Students VALUES ('234350','Ramesh','Bartok', 22, NULL);
INSERT INTO Students VALUES ('234341','John','Norman', 24, NULL);
INSERT INTO Students VALUES ('234348', 'David', 'Bulmar', NULL, NULL);
INSERT INTO Students VALUES ('234345', NULL, 'Desai', NULL, NULL);
INSERT INTO Courses VALUES ('GHR',1,249 );

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)

d) Why is it necessary to constrain updates performed on referenced data in tables such as


Courses and Students? Explain the measures available in SQL to constrain these updates.
(4 marks)
e) Describe with the aid of example SQL code how data may be inserted into a table by
selecting and copying data from one or more existing tables, hence avoiding the use of many
INSERT statements (3 marks)
f) Apart from containing sequences of SQL code in a script, describe other ways that SQL code
can be stored, contained, encapsulated and run as a sequence of executable statements.
(3 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

a) Explain various phases in Database Development Life Cycle. (15 marks)


b) State the components of database system environment. (5 marks)
QUESTION SEVEN
a) Explain Client-Server database systems. (8 marks)
b) Briefly explain important considerations associated with DBMS implementation issues.
(12 marks)
END

You might also like