0% found this document useful (0 votes)
18 views2 pages

Datadbas Midterm Examination

Uploaded by

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

Datadbas Midterm Examination

Uploaded by

Johann Sano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

DATABAS MIDTERM EXAMINATION

Name: _________________________________ Score:________

I. MULTIPLE CHOICE: Write your answer on the space provided. No Erasure Please.

1. _______With Sql, what is the command to get the current date and the current time of the computer.
a. Getdate b. datediff c. dateAdd d. none
2. _______ With sql, what is the command to open the database
a. Use b. Drop c. Create d. none
3. _______With Sql, what is the command to convert the records into capital letter.
a. Upper b. lower c. toupper d. none
4. _______With Sql,returns the number of characters of the specified string expression, excluding trailing blanks.
a. Right b. Left c. Substring d. none
5. _______ With Sql it is a function that return a character expression after removing leading spaces.
a. Ltrim b. Rtrim c.Left d. none
6. ______It is a smallest unit of data in a database.
a. Identifier b. Data Item c. Data Aggregate d. none
7. ______One advantages of DBMS, to avoid duplicate records.
a. Data Consistency b. Sharing of Data c. Control redundancy d. Improved Security
8. ______One advantages of DBMS, the database are shared by all authorized user in an organization.
a. Data Consistency b. Sharing of Data c. Control redundancy d. Improved Security
9. ______ One advantages of DBMS, the protection of the database from any unauthorized users.
a. Data Consistency b. Sharing of Data c. Control redundancy d. Improved Security
10. ______One disadvantages of DBMS, it requires a large area and a substantial amount of memory to make it run efficiently.
a. Complexity b. Size c. Additional Hardware Cost d. none
11. ______Components of DBMS it can range from simple to mainframe.
a. Hardware b. Software c. Data d. none
12. ______The lowest level of abstraction describes how the data is actually stored.
a. Physical level b. Logical Level c. View Level d. none
13. _____Which SQL statement is used to insert new data in a database?
a. INSERT NEW b. ADD RECORD c. ADD NEW d. INSERT INTO
14. ______A type of keys that data item uniquely identifies a record.
a. Primary key b. Foreign key c. Secondary key d. none
15. ______The highest level of abstraction describes only part of the entire database that is needed by the user.
a. Physical level b. Logical Level c. View Level d. none
16. ______It is a collection of entities that have similar characteristics.
a. Reality b. Entity Class c. Metadata d. none
17. ______One advantages of DBMS, is cost saving measures can be done by combining all of an organization’s operational data
into a single database.
a. Improved Security b. Sharing of Data c. Economy of Scale d. none
18. _______One disadvantages of DBMS, additional storage space and peripheral.
a. Complexity b. Cost of DBMS c. Additional Hardware Cost d. none
19. _____With SQL, how do you select a column named "FirstName" from a table named "Persons"?
a. EXTRACT FirstName FROM Persons b. SELECT FirstName FROM Persons
c. SELECT Persons.FirstName d. SELECT * FROM Persons
20. _____What does SQL stand for?
a. Structured Query Language b. Structured Question Language
c. Strong Question Language d. None
21. _____Which SQL statement is used to extract data from a database?
a. EXTRACT b. SELECT c. OPEN d. GET
22. _____Which SQL statement is used to modify data in a database?
a. UPDATE b. MODIFY c. SAVE d. EDIT
23. _____Which SQL statement is used to delete data from a database?
a. REMOVE b. COLLAPSE c. DELETE d. TRUNCATE
24. _____With SQL, how do you select all the columns from a table named "Persons"?
a. SELECT Persons b. SELECT *.Persons c. SELECT * FROM Persons d. SELECT [all] FROM Persons
25. ______It is a collection of unprocessed facts.
a. Information b. Data c. Records d. none
26. ______It is software that enables the user to define, create, and maintain the database.
a. DBMS b. File c. Ms Word d. none
27. ______It is an individual object, concept or event about which the organization chooses to collect or store data.
a. Reality b. Entity c. key d. none
28. ______The next level of abstraction describes what data are stored in the database and relationships that exist among data.
a. Physical level b. Logical Level c. View Level d. none
29. ______It is information about the data in an organization.
a. Data Item b. Metadata c. Data aggregate d. none
30. _______It is a symbol for database.
a. rectangle b. diamond c. drum d. none
31. _______A command that erases all data modification made from that start of the transaction or to a save point.
a. rolling b. rollout c. rolling d. none
32. _______ A command to end a current transaction and make permanent all changes performed in the transaction.
a. change b. commit c. return d. none
33. _______A system function that returns the last-inserted identity value.
a. @@Error b. @@id c. @@Identity d. none
34. _______ A function that return the day of the month.
a. day b. month c. year d. none
35. _______It encloses a series of Transact-SQL.
a. Begin-End b. {} c. /**/ d. none
36. ______ A function that return the month.
a. day b. month c. year d. none
37. ______ A function to return a character expression after removing trailing spaces.
a. Trim b. Rtrim c. Ltrim d. none
38. ______ Returns the string with the character in reverse order
a. Reverse b. backtrack c. Date d. none
39. _______ It returns the error number and exception.
a. @@Exception b. @@Error c. @@Identity d. none
40. _______With SQL, How do you select StudID, StudName and Average exams from Student Table.
a. Select * from Student b. Select STUDID, STUDNAME, AVERAGE from Student
c. Select stno, stname from average d. none

II. PROGRAMMING: Write your answer on the space provided.

Tables:
A. tblStudents
StudentID BIGINT Primary Key / Identity (Yes)

Stno VARCHAR(10) YYYY-99999

LastName VARCHAR(50)

FirstName VARCHAR(50)

MiddleName VARCHAR(50)

CourseID INT 1,2,3,4

Year INT 1,2,3,4

Status BIT Default value 1

DateCreated DATETIME GetDate()

DateUpdated DATETIME GetDate()

1. Create an INSERT script


2. Create an UPDATE script(all needed fields) using StudentID basis
3. Create a DELETE script using StudentID basis
4. Create a SELECT script that will display: Stno, Name(Fname Mname Lname), Course, Year, Status(Active or Inactive),
DateCreated, DateUpdated

CourseID=Course
1 = ‘BSIT’
2 = ‘BSIM’
3 = ‘BSCS’
4 = ‘ACT’

You might also like