0% found this document useful (0 votes)
94 views

Database Management System Exams

This document discusses database management system exams and assignments. It contains short quizzes and examples on SQL statements like SELECT, INSERT, UPDATE, DELETE, ALTER TABLE, and CREATE TABLE. The questions and examples cover topics like data definition language, data manipulation language, transactions, relational databases, and modifying database tables using ALTER statements. It provides practice questions to test understanding of fundamental database concepts and SQL syntax.

Uploaded by

Wissam Mosleh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views

Database Management System Exams

This document discusses database management system exams and assignments. It contains short quizzes and examples on SQL statements like SELECT, INSERT, UPDATE, DELETE, ALTER TABLE, and CREATE TABLE. The questions and examples cover topics like data definition language, data manipulation language, transactions, relational databases, and modifying database tables using ALTER statements. It provides practice questions to test understanding of fundamental database concepts and SQL syntax.

Uploaded by

Wissam Mosleh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

lOMoARcPSD|6127488

Database Management System Exams

Database Management System (AMA Computer University)

StuDocu is not sponsored or endorsed by any college or university


Downloaded by wissam mosleh ([email protected])
lOMoARcPSD|6127488

SHORT QUIZ 1

1. This describes the database design at the physical level. Physical schema
2. It is design to manage large bodies of information. Database system
3. It is a bundle of actions which are done within a database to bring it from one consistent
state to a new consistent state. Transaction
4. It is the term generally used to describe what was done by large mainframe computers
from the late 1940's until the early 1980's. Data Processing
5. It is the collection of basic objects. Entities
6. Are said to exhibit physical data independence if they do not depend on the physical
schema. Application Program
7. This is also known as facts that can be recorded and that have implicit meaning. Data
8. Are applied to the table and form the logical schema.
9. It is an interpreted data – data supplied with semantics. Information

m
er as
10. Is the underlying the structure of a database data model
11. It is collection of data that contains information relevant to an enterprise. Database

co
eH w
12. This is a characteristic of database that includes also the protection of the database
from unauthorized access confidentiality and unauthorized changes. Data integrity

o.
13. It is the collection of information stored in the database at a particular moment is called
rs e
instance of the database
ou urc
o

SHORT QUIZ 2
aC s

1. Which of the following is not part of data manipulation language? Alter


vi y re

2. Which of the following is not part of transaction control? CREATE


3. It is a collection of relations or two-dimensional tables controlled by the Oracle server.
Relational Database
ed d

4. Which of the following is not part of data control language? Insert


ar stu

5. He proposed the relational model for database systems in 1970. Dr. E.F Codd

SHORT QUIZ 3

1. Basic unit of storage composed of rows and columns Table


is

2. An alter statement that is used to delete an existing column in the table. DROP
Th

3. Suppose that a user wanted to add a new column name as CITY datatype set to char size
10. Which of the following is the correct sql statement? ALTER TABLE STUDENTS
ADD CITY CHAR(10);
sh

4. Which of the following datatype is not being used in oracle? INT


5. It logically represents subsets of data from one or more table. View
6. An alter statement that is used to update an existing column datatype or datatype size.
MODIFY
7. An alter statement that is used to add new column to the table. ADD

https://www.coursehero.com/file/52423806/428893484-Databasepdf/

Downloaded by wissam mosleh ([email protected])


lOMoARcPSD|6127488

8. Suppose that a user wanted to change the datatype of column ADDRESS from Varchar
to Char which of the following is the correct example. ALTER TABLE STUDENTS
MODIFY ADDRESS VARCHAR(20);
9. A statement that is use to rename the table or change the existing name of the table.
Rename
10. Which of the following is not true about ALTER statement? Insert new row in a table

ASSIGNMENT 1

1. Which of the following is the correct example of removing a column FIRSTNAME from
EMPLOYEES table? ALTER TABLE EMPLOYEESDROP COLUMN FIRSTNAME;
2. Which of the following is the correct example of adding a new column ADDRESS
datatypevarchar size 20 to EMPLOYEES table? ALTER TABLE EMPLOYEESADD ADDRESS
VARCHAR(20);

m
3. Which of the following is the correct example of dropping the table EMPLOYEES? DROP

er as
TABLE EMPLOYEES;

co
eH w
4. Which of the following is the correct example of renaming the table EMPLOYEES to
WORKERS? RENAME EMPLOYEES TO WORKERS;

o.
5. Which of the following is the correct example of removing a column SALARY from
rs e
EMPLOYEES table? ALTER TABLE EMPLOYEES DROP COLUMN SALARY;
ou urc
6. Which of the following is the correct example of truncating the table EMPLOYEES?
TRUNCATE TABLE EMPLOYEES;
o

7. Which of the following is the correct example of modifying the column lastname?
Change the datatype size to 20. ALTER TABLE EMPLOYEES MODIFY LASTNAME
aC s
vi y re

VARCHAR(20);
8. Which of the following is the correct example of modifying the column JOB_ID? Change
the datatype size to 10. ALTER TABLE EMPLOYEES MODIFY JOB_ID CHAR(10);
9. Which of the following is the correct example of adding a new column
ed d

CONTACT_NOdatatypeNUMBER size 11 to EMPLOYEES table? ALTER TABLE EMPLOYEES


ar stu

ADD CONTACT_NO NUMBER(11);


10. Which of the following is the correct example of creating a new table STUDENTS? The
column STUD_ID is set to primary key. CREATE TABLE STUDENTS( STUD_ID NUMBER(3)
is

PRIMARY KEY);
Th

SHORT QUIZ 4
1. A type of DML statement that is use to remove existing rows in a table. DELETE
2. Consists of a collection of DML statements that form a logical unit of work. Transaction
sh

3. A type of insert statement that specify the NULL keyword in the VALUES clause. Explicit
4. Suppose that a user wanted to insert a new value using the implicit method which of the
following is the correct example. INSERT INTO STUDENST(USN_ID, FIRSTNAME)
VALUES(10,’ELENA’)
5. A type of insert statement that omit the column from the column list. Implicit
6. Suppose that a user wanted to update the lastname of student to ‘Santos’ and YR_LVL to
‘Irreg’ whose USN_ID is equal to 50, in one select statement which of the following is the

https://www.coursehero.com/file/52423806/428893484-Databasepdf/

Downloaded by wissam mosleh ([email protected])


lOMoARcPSD|6127488

correct sql statement to use. UPDATE STUDENTS


SET LASTNAME = ‘SANTOS’, YR_LVL = ‘IRREG’
WHERE USN_ID = 50;
7. A type of DML statement that is use to update existing rows in a table. UPDATE
8. A type of DML statement that is use to add new rows in a table. INSERT
9. Suppose that a user wanted to insert a new value using the explicit method which of the
following is the correct example. INSERT INTO STUDENTS VALUES (10,
NULL,’ELENA’,NULL);
10. Suppose that a user uses the DELETE statement as shown below: what is/are the
possible output. All rows are deleted but the table is still intact.

m
er as
ASSIGNMENT 002

co
eH w
1. Which of the following is the correct example of deleting a student record from
STUDENTS table whose COURSE is equal to NULL; DELETE FROM STUDENTS WHERE

o.
COURSE IS NULL;
rs e
2. Which of the following is the correct example updating all student COURSE to ‘BSIT’ from
ou urc
STUDENTS table? UPDATE STUDENTS SET COURSE = ‘BSIT’;
3. Which of the following is the correct example of deleting all records in STUDENTS table;
o

DELETE FROM STUDENTS;


4. Which of the following is the correct example updating the student LASTNAME TO
aC s
vi y re

‘SANTOS’ and course to ‘BSCS’ whose STUD_ID is equal to 109?


UPDATE EMPLOYEES SET LASTNAME = ‘SANTOS’, COURSE = ‘BSCS’ WHERE STUD_ID =
109;
5. Which of the following is the correct example of inserting new values to STUDENTS table
ed d

where the course is set to NULL; INSERT INTO STUDENTS VALUES(1,'DELA


ar stu

CRUZ','JUANITO',NULL);
6. Which of the following is the correct example inserting a new value to STUDENTS table
that will only add new data to STUD_ID and LASTNAME? The stud_id is 10 and lastname
is

is ‘CRUZ’ INSERT INTO STUDENTS(STUD_ID,LASTNAME) VALUES(10,’CRUZ’);


7. Which of the following is the correct example of updating the LASTNAME to ‘REYES’ of all
Th

students from STUDENTS table whose STUD_ID is equal to 01020564? UPDATE


STUDENTS SET LASTNAME = ‘REYES’ WHERE STUD_ID = 01020564;
8. Which of the following is the correct example of inserting new values to STUDENTS
sh

table? INSERT INTO STUDENTS VALUES(1,'DELA CRUZ','JUANITO','BSIT');


9. Which of the following is the correct example inserting a new value to STUDENTS table
that will only add new data to STUD_ID and LASTNAME? The stud_id is 10 and lastname
is 'CRUZ' and the rest of the column is set to NULL. INSERT INTO STUDENTS VALUES
(10,'CRUZ',NULL,NULL);

https://www.coursehero.com/file/52423806/428893484-Databasepdf/

Downloaded by wissam mosleh ([email protected])


lOMoARcPSD|6127488

10. Which of the following is the correct example of updating the COURSE to ‘N/A’ of all
students from STUDENTS table whose course IS NULL; UPDATE STUDENTS SET COURSE
= ‘N/A’ WHERE COURSE IS NULL;
CREATE TABLE PARTS(
PARTNUM CHAR(4) PRIMARY KEY,
DESCRIPTION VARCHAR(20),
ONHAND NUMBER(6),
CLASS CHAR(5),
WAREHOUSE NUMBER(6),
PRICE NUMBER(6));

INSERT INTO PARTS VALUES('AT94', 'IRON',50,'HW',3,2495);


INSERT INTO PARTS VALUES('BVO6','HOME GYM' ,45,'SG',2,79495);
INSERT INTO PARTS VALUES('CD52','MICROWAVE OVEN',32,'AP',1,165);
INSERT INTO PARTS VALUES('DL71','CORDLESS DRILL',21,'HW',3,12995);

m
INSERT INTO PARTS VALUES('DR93','GAS RANGE',21,'AP',2,495);

er as
INSERT INTO PARTS VALUES('DW11','WASHER',12,'AP',3,399);
INSERT INTO PARTS VALUES('FD21','STAND MIXER',22,'HW',3,159);

co
INSERT INTO PARTS VALUES('KL62','DRYER',12,'AP',1,349);

eH w
INSERT INTO PARTS VALUES('KT03','DISHWASHER',8,'AP',3,595);

o.
INSERT INTO PARTS VALUES('KV29','TREADMILL',9,'SG',2,1390);

rs e
ou urc
o

SHORT QUIZ 5
aC s
vi y re

1. This is use to create expression with number and date values. Arithmetic expression
2. This is use to Selects the columns in a table that are returned by a query. Selects a few
or as many of the columns as required. Projection
3. It is a value that is unavailable, unassigned, unknown, or inapplicable. NULL
ed d

4. A system used to concatenate one column to another column. ||


ar stu

5. It is a character, a number, or a date that is included in the SELECT statement. Literal


6. Which of the following is not true about writing SQL statements? SQL statements are
case sensitive.
is

7. This is used to selects the rows in a table that are returned by a query. Various criteria
Th

can be used to restrict the rows that are retrieved. Selection

8. Supposed that the user uses the f SELECT statement: what will be the possible output.
SELECT GRADE AS STUDENT MARK FROM GRADE_REPORT; Error because of missing “” mark.
sh

9. This is used to brings together data that is stored in diferent tables by specifying the
link between them Joins
10. This character is used to override the default precedence or to clarify the statement. ( )

SHORT QUIZ 6
1. True/False. The != not equal to symbol is also equal to this symbol<>. TRUE
2. This is used to restrict the rows that are returned by a query. Where

https://www.coursehero.com/file/52423806/428893484-Databasepdf/

Downloaded by wissam mosleh ([email protected])


lOMoARcPSD|6127488

3. True/False. This symbol % denotes zero or many characters. TRUE


4. True/False Character values are format sensitive and date values are case sensitive-
sensitive. FALSE
5. This is used to display rows based on a range of values. Between
6. This is used to in conditions that compare one expression with another value or
expression. Comparison
7. True/False. A null value means that the value is unavailable, unassigned, unknown,
or inapplicable. TRUE
8. This is used to test for values in a specified set of values. IN
9. This is used to perform wildcard searches of valid search string values. Like
10. True/False. Character strings and date values are enclosed with double quotation
marks. FALSE

LONG QUIZ 1

m
er as
1. Which of the following is not part of common Comparison operator? LIKE

co
eH w
2. SELECT NAME, ORG, POSITION, ID * (100 + 3) FROM ORGCHAR WHERE ORG = ‘AMATHS’

o.
It will retrieve the record of ANNA with new ID of 1030
rs e
3. Which of the following is not part of disadvantage of database? Data integrity
ou urc
4. SELECT NAME, ORG, POSITIONFROM ORGCHARWHERE ORG =’JPCS’OR POSITION =
‘SEC’AND NAME LIKE ‘%N’; It will retrieve the record of JOAN,ROAN and JUN
o

5. Which of the following is not part of characteristics of database? Data Processing


aC s
vi y re

6. Which of the following is not part of basic SELECT statement Logical condition
7. INSERT INTO ORGCHART (ID, NAME) VALUES (11,’YAMBAO,JUN’); The ORG and
POSITION of YAMBAO will automatically sets to NULL.
ed d

8. SELECT NAME, ORG, POSITIONFROM ORGCHARWHERE ORG =’JPCS’OR POSITION = ‘SEC’;


ar stu

It will retrieve the record of JOAN,ROAN and JUN


9. UPDATE ORGCHARTSET ORG = ‘PCS’WHERE ORG IS NULL; 1 row/s is updated
10. INSERT INTO ORGCHART VALUES (11,’YAMBAO,JUN’, NULL, NULL); The ORG and
is

POSITION of YAMBAO will automatically sets to NULL.


11. SELECT NAME, ORG, POSITIONFROM ORGCHARWHERE NAME LIKE ‘%A’; It retrieves the
Th

record of ANNA and MOJICA


12. Which of the following is not part of DML statement? CREATE table
13. Suppose that the user wanted to add a new column name as CUST_NAME data type
sh

char size 6. What is the correct type of statement to use? ALTER


14. Which of the following is not the correct example of entity? Phone_no
15. Which of the following is not part of other Comparison Operator? <>
16. Which of the following is not part of handling data? Semi-Computerized
17. Table is known as the collection of data that contains information relevant to an
enterprise. False
18. Which of the following is not part of DDL statement? DELETE

https://www.coursehero.com/file/52423806/428893484-Databasepdf/

Downloaded by wissam mosleh ([email protected])


lOMoARcPSD|6127488

19. Suppose that the user wanted to add a new column name as CUST_NAME data type
char size 6. What is the correct SQL statement to use? ALTER TABLE PARTS
ADD CUST_NAME CHAR(6);
20. Which of the following is not part of advantage of database? Database instance
21. Database Management System is a collection of interrelated data and a set of programs
to access those data. True
22. Database Architecture is the overall design of the database false
23. Security is one of the characteristics of the database that includes also the protection of
the database from unauthorized access confidentiality and unauthorized changes. False
24. SELECT NAME, ORG, POSITIONFROM ORGCHARWHERE NAME LIKE ‘A%’AND POSITION =
‘SEC’;It retrieves the record of AGAPITO
25. Database is the term generally used to describe what was done by large mainframe
computers from the late 1940's until the early 1980's. false

m
er as
SHORT QUIZ 007

co
Trims leading or trailing characters (or both) from a character string. Trim

eH w
1.
2. This is use to return one result per group of row. Multiple row

o.
3. It is a table that is owned by the user SYS and can be accessed by all users. Dual
4. rs e
This is used to converts the first letter of each word to uppercase and the remaining
ou urc
letters to lowercase. INITCAT
5. This is use to return one result per row. Single row
6. It is use to accept numeric input and return numeric values. Number function
o

7. This is use to accept character input and can return both character and number values.
aC s

Character function
vi y re

8. This is use to find the numeric position of a named character starting at character
position n. INSTR
9. What is the return value if the user try to do the following:
ed d

SELECT TRUNC (65.73,-2) FROM DUAL; 0


ar stu

10. Extracts a string of determined length. SUBSTR

SHORT QUIZ 008


is

1. SELECT COUNT(*) FROM STOCKS; 9


2. SELECT MAX(NAME) FROM STOCKS;
Th

3. SELECT SUM(QTY) FROM STOCKS WHERE WAREHOUSE IN (1,5) GROUP BY WAREHOUSE


HAVING MAX(WAREHOUSE) >=5;
4. SELECT COUNT(PRICE) FROM STOCKS; 3
sh

5. SELECT AVG(NVL(QTY,0)) FROM STOCKS; 8.22


6. SELECT AVG(WAREHOUSE) FROM STOCKS; 5
7. SELECT COUNT(DISTINCT QTY) FROM STOCKS; 4
8. SELECT MIN(PRICE) FROM STOCKS; 7
9. SELECT COUNT (AVG(PRICE)) FROM STOCKS GROUP BY WAREHOUSE; 3
10. SELECT MIN(ID) FROM STOCKS; 1

https://www.coursehero.com/file/52423806/428893484-Databasepdf/

Downloaded by wissam mosleh ([email protected])


lOMoARcPSD|6127488

m
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
ed d
ar stu
is
Th
sh

https://www.coursehero.com/file/52423806/428893484-Databasepdf/

Downloaded by wissam mosleh ([email protected])


Powered by TCPDF (www.tcpdf.org)

You might also like