Database
Database
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
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
12. This is a characteristic of database that includes also the protection of the database
from unauthorized access confidentiality and unauthorized changes. Data integrity
13. It is the collection of information stored in the database at a particular moment is called
instance of the database
SHORT QUIZ 2
SHORT QUIZ 3
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);
3. Which of the following is the correct example of dropping the table EMPLOYEES? DROP
TABLE EMPLOYEES;
4. Which of the following is the correct example of renaming the table EMPLOYEES to
WORKERS? RENAME EMPLOYEES TO WORKERS;
5. Which of the following is the correct example of removing a column SALARY from
EMPLOYEES table? ALTER TABLE EMPLOYEES DROP COLUMN SALARY;
6. Which of the following is the correct example of truncating the table EMPLOYEES?
TRUNCATE TABLE EMPLOYEES;
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
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
CONTACT_NOdatatypeNUMBER size 11 to EMPLOYEES table? ALTER TABLE EMPLOYEES
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)
PRIMARY KEY);
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
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
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.
ASSIGNMENT 002
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
COURSE IS NULL;
2. Which of the following is the correct example updating all student COURSE to ‘BSIT’ from
STUDENTS table? UPDATE STUDENTS SET COURSE = ‘BSIT’;
3. Which of the following is the correct example of deleting all records in STUDENTS table;
DELETE FROM STUDENTS;
4. Which of the following is the correct example updating the student LASTNAME TO
‘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
where the course is set to NULL; INSERT INTO STUDENTS VALUES(1,'DELA
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 ‘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
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
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);
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));
SHORT QUIZ 5
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
4. A system used to concatenate one column to another column. ||
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.
7. This is used to selects the rows in a table that are returned by a query. Various criteria
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.
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
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
2. SELECT NAME, ORG, POSITION, ID * (100 + 3) FROM ORGCHAR WHERE ORG = ‘AMATHS’
It will retrieve the record of ANNA with new ID of 1030
3. Which of the following is not part of disadvantage of database? Data integrity
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
5. Which of the following is not part of characteristics of database? Data Processing
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.
8. SELECT NAME, ORG, POSITIONFROM ORGCHARWHERE ORG =’JPCS’OR POSITION = ‘SEC’;
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
POSITION of YAMBAO will automatically sets to NULL.
11. SELECT NAME, ORG, POSITIONFROM ORGCHARWHERE NAME LIKE ‘%A’; It retrieves the
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
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
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
1. Trims leading or trailing characters (or both) from a character string. Trim
2. This is use to return one result per group of row. Multiple row
3. It is a table that is owned by the user SYS and can be accessed by all users. Dual
4. This is used to converts the first letter of each word to uppercase and the remaining
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
7. This is use to accept character input and can return both character and number values.
Character function
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:
SELECT TRUNC (65.73,-2) FROM DUAL; 0
10. Extracts a string of determined length. SUBSTR