wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Advanced Database

Total questions: 15

Worksheet time: 9mins

Name
Class
Date
1.

update guirreRose set guirre_strand = 'TVL' where deptno = 30;


This is rejected, why is it rejected?

a)

Dept is not a key preserved base table.

b)

Because there is an aggregation function

c)

There is a check option.

2.

SQL> create view guirreRose as

2 select empno, ename, sal, comm, dept.deptno, dname, loc

3 from emp, dept

4 where emp.deptno = dept.deptno;


View created.


The user then runs:


update guirreRose set loc = 'CASHEL' where deptno = 30;


Is the command accepted or rejected?

a)

Accepted

b)

Rejected

3.

SQL> create view guirreRose as

2 select empno, ename, sal, comm, dept.deptno, dname, loc

3 from emp, dept

4 where emp.deptno = dept.deptno;


View created.


The user then runs:


update guirreRose set ename = 'ROSE' where empno = 7934;


Is this accepted or rejected?

a)

Accepted

b)

Rejected

4.

Trigger is invoked before/after data row is:

a)

deleted

b)

updated

c)

inserted

d)

all answers are correct

5.
Below are the Data Definition Command, EXCEPT
a)
CREATE
b)
ALTER
c)
MERGE
d)
SELECT
6.

Which of the following is the correct command to create a view?

a)

CREATE VIEW guirreRose AS

b)

SELECT VIEW guirreRose FROM

c)

CREATE TABLE VIEW guirreRose AS

d)

CREATE VIEW TABLE guirreRose FROM

7.
Below are the procedural SQL that can be used to enhance the power of SQL, EXCEPT:
a)
Triggers
b)
Stored procedures
c)
Function
d)
View
8.
Assume that you have the following:
CREATE FUNCTION totalPaidByCust(custID INT)
........
END
If you want to query the function, the command will be:
a)
CALL totalPaidByCust(3);
b)
SELECT totalPaidByCust(3);
c)
EXECUTE totalPaidByCust(3);
d)
None of the answer is correct
9.

Given the syntax below what is the attribute name:


CREATE TABLE guirreRose. guirre_BSIS (guirre_Score INT (3) NOT NULL), ENGINE=INNODB;

a)

guirreRose

b)

guirre_BSIS

c)

guirre_Score

10.

Given the syntax below, its accepted or rejected?


ALTER TABLE dbName. table_name CHANGE ATTRIB NAME (original guirre_attrib_name new_guirre_attrib_name DATATYPE (DATA LENGTH) NULL), ENGINE=INNODB;

a)

Accepted

b)

Rejected

11.

What is the codes of the output above:

a)

INSERT INTO guirreRose.guirreCampus`

(`guirre_bpc_campus`,` guirre_course`, `guirre_year`, `guirre_section`) VALUES ('ANGAT', 'COMSEC','2','A')

b)

CREATE guirreRose.guirreCampus`(`guirre_bpc_campus`,

` guirre_course`, `guirre_year`, `guirre_section`) VALUES ('ANGAT', 'COMSEC','2','A')

c)

UPDATE guirreRose.guirreCampus`(`guirre_bpc_campus`,

` guirre_course`, `guirre_year`, `guirre_section`) VALUES ('ANGAT', 'COMSEC','2','A')

d)

ALTER guirreRose.guirreCampus`(`guirre_bpc_campus`,

` guirre_course`, `guirre_year`, `guirre_section`) VALUES ('ANGAT', 'COMSEC','2','A')

12.

Identify the attribute/s from the codes below:


UPDATE `college_applications` SET

`year` = '2' WHERE

`college_applications`.`id` = 0519;

a)

year

b)

id

c)

year and id

d)

college applications

13.

ALTER TABLE guirreRose. guirre_bsis CHANGE guirre_sec (guirre_sec new_guirre_section VARCHAR (1) NOT NULL) ENGINE=INNODB;


What would be the new attribute name?

a)

guirreRose

b)

guirre_bsis

c)

guirre_sec

d)

guirre_section

14.

Data Definition Language

a)

Insert, Update, Delete, Select

b)

Insert, Create, Delete, Select

c)

Create, Alter, Drop, Truncate

d)

Insert, Alter, Drop, Truncate

15.

Data Manipulation Language (DML)

a)

Insert

b)

Update

c)

Create

d)

Select

e)

Truncate