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

Lab 2

The document provides instructions for creating and populating multiple database tables. It includes steps to: 1. Create tables for courses, faculty, and semesters with various attributes and data types. 2. Insert sample data into the courses, faculty, and semesters tables. 3. Display all records from each table to confirm the data was inserted correctly. 4. Create a registration table with foreign keys linking to the other tables and insert sample registration data.

Uploaded by

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

Lab 2

The document provides instructions for creating and populating multiple database tables. It includes steps to: 1. Create tables for courses, faculty, and semesters with various attributes and data types. 2. Insert sample data into the courses, faculty, and semesters tables. 3. Display all records from each table to confirm the data was inserted correctly. 4. Create a registration table with foreign keys linking to the other tables and insert sample registration data.

Uploaded by

Shafrinaa Jeffri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab2

Open your previous Database

1.1 Create the following table : KURSUS (use CREATE TABLE command)

Attribute DataType Length Remarks


KodKursus VARCHAR 10 Primary Key
NamaKursus VARCHAR 100 NOT NULL
JamKredit INT 1

1.2 INSERT 5 (FIVE) courses in the table KURSUS (use INSERT command)

1.3 DISPLAY ALL the records in table KURSUS (use SELECT command)

2.1 Create the following table : PENSYARAH (use CREATE TABLE command)

Attribute DataType Length Remarks


NoStaf VARCHAR 10 Primary Key
NamaPensyarah VARCHAR 100 NOT NULL
KodFakulti VARCHAR 10 NOT NULL
Email VARCHAR 100
TelephoneBimbit VARCHAR 16
NoBilik VARCHAR 5
NamaBlok VARCHAR 15
TelephonePejabat VARCHAR 16

2.2 INSERT 5 (FIVE) pensyarah in the table PENSYARAH (use INSERT command)

2.3 DISPLAY ALL the records in table PENSYARAH (use SELECT command)

3.1 Create the following table : SEMESTER (use CREATE TABLE command)

Attribute DataType Length Remarks


IdSemester VARCHAR 10 Primary Key
NamaSemester VARCHAR 100 NOT NULL
TarikhMulaSem Date
TarikhAkhirSem Date

3.2 INSERT 3 (THREE) semester in the table SEMESTER (use INSERT command)

3.3 DISPLAY ALL the records in table SEMESTER (use SELECT command)
4.1 Create the following table : PENDAFTARANKURSUS (write the folloeing codes in your SQL)

Attribute DataType Length Remarks


NoMatrik VARCHAR 10 PrimaryKey and ForeignKey from
Table PELAJAR
KodKursus VARCHAR 10 Primary Key and ForeignKey from
Table KURSUS
IdSemester VARCHAR 10 Primary Key and ForeignKey from
Table Semester

4.2 INSERT 3 (THREE) registration information in the table PENDAFTARANKURSUS (use INSERT
command)

Make sure that : NoMatrik must be in PELAJAR

KodKursus must be in KURSUS

IdSemester must be in SEMESTER

4.3 DISPLAY ALL the records in table PENDAFTARANKURSUS (use SELECT command)

You might also like