ERD to Codes

Your task is to develop the database tables using MySQL as shown in class. Neglect the relationships as we will talk about this in subsequent classes. Make sure to save your document as we will be referring to this database in the next class.

26th March 2021 (Database Mysql source code)

QUIZ 1 (9TH APRIL 2021)

Instructions: Use the attached MySQL codes to answer questions 1 – 4. You can run the codes on the online server as shown in class. Prepare your answer on a word file (do not forget to write your name and student number) and send it to my email.

Quiz duration: 30mins

Note that looking at the ERD diagram can help you understand the tables in the database.

  1. You have been asked by your manager to get the total number of customers in the database. How many customers are currently in the database? (Show the codes you used in getting the total number of customers in the database)
  2. The manufacturing department wishes to know how many products are currently in the database. Kindly tell them the number of products in the database (Also show the code you used to find this)
  3. The sales department want to know the last order date. Kindly tell them the last order date as written in the database. (show codes used to find this)
  4. The marketing department wants to know how many orders were done on the 2005-05-16. Kindly tell them (also show the codes you used).
  5. Why do we use SELECT DISTINCT?
  6. With the help of a table, show the difference between the OR operator and the AND operator

Leave a Reply