Lab1 DI220152 DATABASE
Lab1 DI220152 DATABASE
Matric No : DI220152
One significant lesson learned the significance of data types and constraints in database
design. For instance, when defining columns in a table, specifying appropriate data types
(such as INT for integers or VARCHAR for variable-length strings) ensures data integrity
and efficient storage.
Difficulties were encountered in ensuring the accuracy and completeness of the SQL
commands. Syntax errors can easily occur if commands are not written correctly, leading to
issues in creating tables or databases. Debugging these errors required careful examination of
the commands and understanding SQL syntax rules.
New knowledge was gained about the primary key constraint, which uniquely identifies each
record in a table. In the exercise, primary keys were defined for both the Customer_Order and
Employees tables to ensure data integrity and enable efficient data retrieval.
Overall, the exercise provided valuable hands-on experience in database management using
MySQL. It reinforced the importance of precision in SQL syntax, the significance of data
types and constraints in database design, and the role of primary keys in maintaining data
integrity. These lessons will be beneficial in future endeavors involving database
development and management.
Page | 1
UNIVERSITI TUN HUSSEIN ONN MALAYSIA
FACULTY OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY
The Code:
The Output:
Page | 2
UNIVERSITI TUN HUSSEIN ONN MALAYSIA
FACULTY OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY
3. Write the SQL statement and show the capture screen showing the results of Exercise
no. 2
The Code:
The Output:
Page | 3