You are on page 1of 8

DATABASE SYSTEM - SEPTEMBER 2016

INTRODUCTION
A database is an organized collection of data. It is the collection of
schemas, tables, queries, reports, views and other objects. The data are typically
organized to model aspects of reality in a way that supports processes requiring
information, such as modeling the availability of rooms in hotels in a way that
supports finding a hotel with vacancies.
A database management system (DBMS) is a computer software application that
interacts with the user, other applications, and the database itself to capture and
analyze data. A general-purpose DBMS is designed to allow the definition, creation,
querying,

update,

and

include MySQL, PostgreSQL,

administration
Microsoft

of

SQL

databases.

Well-known

Server, Oracle, Sybase, SAP

DBMSs
HANA,

and IBM DB2. A database is not generally portable across different DBMSs, but
different

DBMS

can

interoperate

by

using

standards such

as SQL and ODBC or JDBC to allow a single application to work with more than one
DBMS. Database management systems are often classified according to the
database model that they support; the most popular database systems since the
1980s have all supported the relational model as represented by the SQL language.
Sometimes a DBMS is loosely referred to as a 'database'.

DATABASE SYSTEM - SEPTEMBER 2016

QUESTION 1
Currently I use E Class system that is available for students and staff that
are studying and working at MSU. This system is used for students to check
important things such as timetable, result, news, GEMS statement, subject
registration, and many more. Student and staff need to enter their unique ID and
password of choice in order to log in. This kind of database system is common
within universities.

DATABASE SYSTEM - SEPTEMBER 2016

QUESTION 2
CREATE TABLE STUDENT
(NO_MATRIK INTEGER,
NAME CHAR(30),
ADDRESS CHAR(30),
NO_TEL INTEGER,
COURSE CHAR(30));
INSERT INTO STUDENT
VALUE ('12345','Mazlina','Ampang','123842375','DTM');
INSERT INTO STUDENT
VALUE ('23456','Kumar','Gombak','126101617','MLVK');
INSERT INTO STUDENT
VALUE ('34567','Ridwan','Selayang','-','DPG');
INSERT INTO STUDENT
VALUE ('45678','Low Teck','Ampang','132356894','SSK');
INSERT INTO STUDENT
VALUE ('56789','Aminah','Bangsar','172567741','DPG');
CREATE TABLE COURSE
(COURSE CHAR(30),
SUBJECT1 CHAR(30),
SUBJECT2 CHAR(30),
SUBJECT3 CHAR(30),
3

DATABASE SYSTEM - SEPTEMBER 2016


LECT1 CHAR(30),
LECT2 CHAR(30),
LECT3 CHAR(30));
INSERT INTO COURSE
VALUE ('DTM','TT235','TT695','PP563','L003','L322','L056');
INSERT INTO COURSE
VALUE ('MLVK','TT365','TT695','SS003','L123','L322','L601');
INSERT INTO COURSE
VALUE ('DPG','PP563','SS003','PP999','L056','L056','L003');
INSERT INTO COURSE
VALUE ('SSK','TT234','TT235','PP023','L123','L003','L322');
CREATE TABLE LECTURER
(LECT_ID CHAR(30),
NAME CHAR(30),
ADDRESS CHAR(30),
QUALIFICATION CHAR(30),
DEPARTMENT CHAR(30));
INSERT INTO LECTURER
VALUE ('L003','John','Damansara','Msc CS','Teknologi');
INSERT INTO LECTURER
VALUE ('L123','Milah','Kajang','Mba','Perdagangan');
INSERT INTO LECTURER
VALUE ('L056','Ahmad','Gombak','Bsc CS','Teknologi');
INSERT INTO LECTURER
VALUE ('L322','Raj','Kajang','Bsc IT','Teknologi');
4

DATABASE SYSTEM - SEPTEMBER 2016

INSERT INTO LECTURER


VALUE ('L601','Siti','Cheras','Ba Econ','Perdagangan');

DATABASE SYSTEM - SEPTEMBER 2016

1.Subject taken by Kumar (2.5m)


SELECT STUDENT.NAME, STUDENT.COURSE, COURSE.SUBJECT1, COURSE.SUBJECT2,
COURSE.SUBJECT3
FROM STUDENT, COURSE
WHERE STUDENT.COURSE = 'MLVK';

2.Aminahs lecturer and subject.(2.5m)


SELECT S.NAME, C.SUBJECT1, C.SUBJECT2, C.SUBJECT3, C.LECT1, C.LECT2, C.LECT3
FROM STUDENT S, COURSE C
WHERE S.NAME = 'Aminah' AND C.COURSE = 'DPG';

3.Subject that teach by Ahmad(2.5m)


SELECT

L.NAME,

L.LECT_ID,C.COURSE,

C.SUBJECT1,

C.SUBJECT2,

C.SUBJECT3,

C.LECT1, C.LECT2, C.LECT3


FROM COURSE C, LECTURER L
WHERE L.NAME = 'Ahmad' AND C.COURSE = 'DTM';

DATABASE SYSTEM - SEPTEMBER 2016

4.Student that dont have any contact number.(2.5m)


SELECT S.NO_MATRIK, S.NAME, S.ADDRESS, S.NO_TEL, S.COURSE
FROM STUDENT S
WHERE S.NAME = 'Ridwan';

DATABASE SYSTEM - SEPTEMBER 2016

CONCLUSION
A database is a collection of information that is organized so that it can easily be
accessed, managed, and updated. In one view, databases can be classified
according to types of content bibliographic, full-text, numeric, and images. From this
assignment I can practice my database .

You might also like