Geehthan A/L Vinogobalan S55515: Activity 1
Geehthan A/L Vinogobalan S55515: Activity 1
S55515
ACTIVITY 1
1&2
3.
4
Database named mypractical is created.
ACTIVITY 2
Data Dictionary
Table 1-Customer
Attribute Description Data Type Size
custID Customer INT -
code
custName Customer VARCHAR 30
Name
custJob Designation VARCHAR 30
custAdd1 Address 1 VARCHAR 30
custAdd2 Address 2 VARCHAR 30
custState State VARCHAR 30
custPostCod Postcode INT 30
e
custContact Contact No. VARCHAR 30
Table 1-Sales
Attribute Description Data Type Size
slsID Sales ID INT -
CustID Customer INT -
ID
slsType Sales type VARCHAR 30
slsOrdDate Sales DATE -
Order Date
slsShipDat Sales Ship DATE -
e Date
Table 3-Product
Attribute Description Data Type Size
prdID Product ID VARCHAR 30
prdName Product VARCHAR 30
Name
prdCategory Product VARCHAR 30
category
prdUnit Product DATE
unit
prpCostPrice Product DECIMAL 25
cost price
prdSalesPric Product DECIMAL 25
e sales price
SQL script.
Customer
Sales
Product
SQL SCRIPT
Table 1 –Customer
Table 2- Sales
Table 3-Product
Activity 3
Srvtechnician table
Output :
Srvcustomer table
Output:
Srvvehicle table
Output
Srvservice table
Output
Srvservicedetails table
Output:
Srvparts table
Output
Activity 4
TASK 1
SQL SCRIPT AND OUTPUT
TASK 2
Output :
2.
3
4.
5.
Deleting records only delete the values that insert in the course table. Meanwhile removing
the course table delete the table from the scheme which means it does not exist.
Lab Exercise
Branch table
Output:
Account table
Output:
Customer table
Output :
Loan table
Output:
Transaction table
Output :
SQL SCRIPTS OF LAB 2
ACTIVITY 2
use mypractical;
CREATE TABLE Table1_Customer
(
custID int ,
custName varchar(30),
custJob varchar(30),
custAdd1 varchar(30),
custAdd2 varchar(30),
custState varchar(30),
custPostCode int,
custContact varchar(30)
);
DESC Table1_Customer;
DESC Table2_Sales;
DESC Table3_Product;
ACTIVITY 3
CREATE table srvtechnician
(
tchNo INT(12) ,
tchName varchar(60) NOT NULL,
tchHireDate Date,
constraint pk_srvtechnician primary key(tchNo)
);
DESC srvservice;
TASK 2
CREATE TABLE student
(
StudentID VARCHAR(6) primary key,
StuName VARCHAR (50),
Gender CHAR(1) check (Gender in('M','F')),
Program VARCHAR(70),
Intake INT(4)
);
alter table student
modify StuName VARCHAR(10);
DESC student;
ACTIVITY 5
use mypractical;
create table course
(
courseid VARCHAR(10) primary key,
coursename VARCHAR(50)
);
DESC course;
use mypractical;