Anda di halaman 1dari 2

CMP304 - Database Management I (Test) 17-05-2018 Matric Number: _________________

1. List the requirements for database applications?


2. DBMS architecture could be described based on a three abstraction levels architecture. List them
3. Define Data Model
4. In relational database model, list the main elements used in a relational database.
5. Define Primary key
6. What is an E-R Model?
7. What is the difference between a weak entity and a regular entity?
8. List and explain the two types of SQL Statement types
9. Write an SQL statement to CREATE a table
10. Write an SQL statement to INSERT record into a table
11. Write an SQL statement to change the DOB to 10th June 1980
12. Write an SQL statement to view all records where state equals OSUN
13. Write an SQL statement to CREATE a database
14. List the three APIs for connecting to a MySQL database
15. Write a PHP module to print the current date
Answer:
1. Presentation Requirement, Data Creation/Modification Requirements, Interrogation Requirements and
Accuracy / Consistency Requirements (Lecture 1)
2. DBMS architecture could be described based on a three abstraction levels architecture. They are: a) External layer or
External Schema, b) Logical Layer or Logical Schema and c) Internal layer or Internal Schema (Lecture 2)
3. Data Model is the logical data structures, including operations and constraints provided by the DBMS to effectively
process data. (Lecture 4)
4. Domain, Attributes, Relation Schema (Table Schema), Relational Database Schema, Tuple (Record/row),
Relation (Table) and Relational Database (Lecture 5)
5. An attribute or a set of attribute that enable data in a table to be uniquely identified. It is specified in table
schema as a primary key. (Lecture 6)
6. The Entity-Relation model is one of the most widely used approaches for database conceptual modelling. The
E-R model includes representations describing objects such as entities, relationships and attributes. The E-R
model includes a graphical representation known as E-R diagrams. Each object has a graphical representation
in the E-R model. (Lecture 9)
7. Weak entity: that is its existence is dependent on another entity. For example, a borrowedBook entity could
be a weak entity as its existence depends on the member entity. Regular entity: its existence is not dependent
on any other entity.
8. DML - stands for Data Manipulation Language, it’s the part of SQL that deals with querying updating and
inserting records in tables and views. e.g. SELECT, INSERT, DELETE, UPDATE
DDL – stands for Data Definition Language, it’s the part of SQL that deals with the construction and alteration
of database structures like tables, views and the further entities inside these tables like columns. It may be used
to set the properties of columns as well e.g. CREATE, DROP, GRANT, ALTER
9. CREATE TABLE <tablename>
10. INSERT INTO biodata (matric, surname, firstname) VALUES (‘16/03CS001’,’MOHAMMED’,’Rasheed’)
11. UPDATE table SET DOB = ‘1980-06-10’
12. SELECT * FROM table WHERE STATE = ‘OSUN’
13. CREATE DATABASE <databasename>
14. (i) mysql (ii) mysqli (iii) pdo
15. <?php
echo date("d/m/Y”);
?>

Anda mungkin juga menyukai