Skip to main content

Command Palette

Search for a command to run...

Activity: Creating a Database and Tables in MySQL with Dummy Data

Updated
15 min read
T

I am a dedicated and skilled Software Engineer specializing in mobile app development, backend systems, and creating secure APIs. With extensive experience in both SQL and NoSQL databases, I have a proven track record of delivering robust and scalable solutions.

Key Expertise:

Mobile App Development: I make high-quality apps for Android and iOS, ensuring they are easy to use and work well.

Backend Development: Skilled in designing and implementing backend systems using various frameworks and languages to support web and mobile applications.

Secure API Creation: Expertise in creating secure APIs, ensuring data integrity and protection across platforms.

Database Management: Experienced with SQL databases such as MySQL, and NoSQL databases like Firebase, managing data effectively and efficiently.

Technical Skills: Programming Languages: Java, Dart, Python, JavaScript, Kotlin, PHP

Frameworks: Angular, CodeIgniter, Flutter, Flask, Django

Database Systems: MySQL, Firebase

Cloud Platforms: AWS, Google Cloud Console

I love learning new things and taking on new challenges. I am always eager to work on projects that make a difference.

Check our module on how to install MySQL on Linux or Windows, or watch our previous online class for guidance.

In this activity, you will create a MySQL database named denormalized_db and define 5 tables (employeetbl, studenttbl, producttbl, ordertbl, and salestbl). You'll also insert the dummy data provided above into these tables using only the command line (no GUI).

1. employeeData

employeeIDemployeeNamedepartmentIDdepartmentNamemanagerIDmanagerNameprojectIDprojectNamesalaryaddresscitystatezipCodephoneemailhireDatejobTitlemanagerPhonemanagerEmailprojectDeadlineprojectStatus
101John SmithD001ITM001Lisa WhiteP001Alpha60000123 Elm StNew YorkNY10001555-1234[email protected]2020-01-15Developer555-3456[email protected]2022-12-01Active
102Jane DoeD002HRM002Bob BrownP002Beta65000456 Maple AveNew YorkNY10002555-5678[email protected]2019-11-05Designer555-8765[email protected]2023-01-15Completed
103Bob BrownD003SalesM003Emma BlueP003Gamma55000789 Oak DrNew YorkNY10003555-8765[email protected]2021-02-12Analyst555-9091[email protected]2022-11-20Active
104Lisa WhiteD001ITM001Lisa WhiteP001Alpha70000234 Pine StNew YorkNY10004555-3456[email protected]2018-09-08Manager555-3456[email protected]2022-12-01Active
105Tom GreenD002HRM002Bob BrownP002Beta50000567 Birch BlvdNew YorkNY10005555-6543[email protected]2017-03-25Developer555-8765[email protected]2023-01-15Completed
106Lucy BlackD001ITM001Lisa WhiteP004Delta62000123 Elm StNew YorkNY10001555-1299[email protected]2020-06-20Developer555-3456[email protected]2022-09-05Active
107Mike GreyD002HRM002Bob BrownP002Beta54000456 Maple AveNew YorkNY10002555-7801[email protected]2019-08-13Designer555-8765[email protected]2023-01-15Completed
108Emma BlueD003SalesM003Emma BlueP005Epsilon58000789 Oak DrNew YorkNY10003555-9091[email protected]2021-04-05Analyst555-9091[email protected]2023-05-01Active
109Liam RedD003SalesM003Emma BlueP003Gamma59000234 Pine StNew YorkNY10004555-7890[email protected]2018-10-02Manager555-9091[email protected]2022-11-20Active
110Noah YellowD001ITM001Lisa WhiteP004Delta61000567 Birch BlvdNew YorkNY10005555-6789[email protected]2017-07-18Developer555-3456[email protected]2022-09-05Active


2. studentData

studentIDstudentNameclassIDclassNameteacherIDteacherNamecourseIDcourseNamebirthDategradeaddresscitystatezipCodephoneemailenrollmentDateguardianNameguardianPhoneguardianEmailattendanceRateisGraduated
201Alice JohnsonC101Math 101T001Mr. ThompsonCO101Algebra2005-09-12A123 Cedar StNew YorkNY10001555-1200[email protected]2021-08-10Mary Johnson555-1010[email protected]95%No
202Bob WhiteC102History 202T002Mrs. GreenCO102World History2006-04-25B567 Cedar BlvdNew YorkNY10002555-6754[email protected]2020-09-15Paul White555-1020[email protected]92%No
203Charlie BrownC103Science 303T003Dr. SmithCO103Physics2005-11-07C789 Pine AveNew YorkNY10003555-9832[email protected]2019-07-05Susan Brown555-1030[email protected]89%No
204David GreenC104English 404T004Ms. JacksonCO104English Literature2007-06-03B+124 Oak DrNew YorkNY10004555-4621[email protected]2022-01-17Kate Green555-1040[email protected]94%No
205Emily GreyC105Art 505T005Mr. RobinsonCO105Painting2006-02-18A-455 Birch RdNew YorkNY10005555-9854[email protected]2021-03-13Henry Grey555-1050[email protected]97%Yes
206Fiona BlackC101Math 101T001Mr. ThompsonCO101Algebra2005-08-09B156 Oak DrNew YorkNY10006555-7234[email protected]2019-09-05Mary Johnson555-1010[email protected]90%No
207George BlueC103Science 303T003Dr. SmithCO103Physics2006-12-15B-786 Pine AveNew YorkNY10003555-1298[email protected]2020-04-20Susan Brown555-1030[email protected]88%No
208Hannah RedC102History 202T002Mrs. GreenCO102World History2005-05-25C+213 Birch BlvdNew YorkNY10004555-3322[email protected]2019-10-02Paul White555-1020[email protected]91%No
209Ian YellowC105Art 505T005Mr. RobinsonCO105Painting2007-03-12A412 Cedar StNew YorkNY10001555-7899[email protected]2021-05-18Henry Grey555-1050[email protected]99%Yes
210Jacob WhiteC104English 404T004Ms. JacksonCO104English Literature2006-11-20B126 Pine BlvdNew YorkNY10005555-9845[email protected]2020-12-04Kate Green555-1040[email protected]96%No


3. productData

productIDproductNamecategoryIDcategoryNamesupplierIDsupplierNamepricestocksupplierPhonesupplierEmailwarehouseIDwarehouseLocationreorderLevelmanufacturerIDmanufacturerNamemanufacturerPhonemanufacturerEmaildateAddedsalesAmountlastRestockedstatusSKUdescription
PR101LaptopCAT001ElectronicsSUP001TechSupply120050555-4001[email protected]W001NY Warehouse10MAN001Dell555-8001[email protected]2022-01-01500002022-09-15In StockLAP123High-end laptop
PR102SmartphoneCAT001ElectronicsSUP002GadgetWorld800200555-4002[email protected]W002LA Warehouse20MAN002Apple555-8002[email protected]2022-01-151600002022-10-01In StockSMRT456Latest model
PR103TabletCAT001ElectronicsSUP001TechSupply600100555-4001[email protected]W003TX Warehouse15MAN001Dell555-8001[email protected]2022-02-10600002022-08-20In StockTBL789Lightweight tablet
PR104MonitorCAT001ElectronicsSUP003OfficeDepot25075555-4003[email protected]W001NY Warehouse5MAN003Samsung555-8003[email protected]2022-03-05187502022-09-10In StockMON12327-inch monitor
PR105KeyboardCAT002AccessoriesSUP002GadgetWorld50150555-4002[email protected]W002LA Warehouse10MAN004Logitech555-8004[email protected]2022-04-0175002022-08-30In StockKYBD456Mechanical keyboard
PR106MouseCAT002AccessoriesSUP003OfficeDepot25300555-4003[email protected]W003TX Warehouse20MAN004Logitech555-8004[email protected]2022-05-1275002022-09-05In StockMSE789Wireless mouse
PR107PrinterCAT001ElectronicsSUP001TechSupply10040555-4001[email protected]W001NY Warehouse5MAN003Samsung555-8003[email protected]2022-06-1540002022-09-20In StockPRNT123Laser printer
PR108HeadphonesCAT002AccessoriesSUP002GadgetWorld70100555-4002[email protected]W002LA Warehouse15MAN004Logitech555-8004[email protected]2022-07-2070002022-08-25In StockHDPH456Noise-cancelling
PR109SpeakersCAT001ElectronicsSUP003OfficeDepot9060555-4003[email protected]W003TX Warehouse10MAN003Samsung555-8003[email protected]2022-08-1054002022-09-25In StockSPKR789Bluetooth speakers
PR110Web CameraCAT001ElectronicsSUP001TechSupply4080555-4001[email protected]W001NY Warehouse5MAN001Dell555-8001[email protected]2022-09-0132002022-09-30In StockWBCM123HD webcam


4. orderData

orderIDcustomerIDcustomerNameproductIDproductNamequantityorderDateshippingDateshippingMethodshippingAddresscitystatezipCodephoneemailtotalAmountdiscountsalesRepIDsalesRepNamesalesRepPhonesalesRepEmailpaymentMethodstatustrackingNumber
1001C001Alice BrownPR101Laptop12022-10-012022-10-05UPS123 Cedar StNew YorkNY10001555-1212[email protected]1200100S001John White555-6789[email protected]Credit CardShippedUPS123456789
1002C002Bob GreenPR102Smartphone22022-10-022022-10-06FedEx456 Maple AveNew YorkNY10002555-2323[email protected]1600150S002Lisa Black555-6790[email protected]PayPalShippedFEDX987654321
1003C003Charlie SmithPR103Tablet32022-10-032022-10-07DHL789 Oak DrNew YorkNY10003555-3434[email protected]1800200S003Michael Blue555-6791[email protected]Bank TransferShippedDHL123987654
1004C004David JohnsonPR104Monitor22022-10-042022-10-08UPS234 Pine StNew YorkNY10004555-4545[email protected]50050S001John White555-6789[email protected]Credit CardProcessingUPS876543210
1005C005Emily BrownPR105Keyboard12022-10-052022-10-09FedEx567 Birch BlvdNew YorkNY10005555-5656[email protected]5010S002Lisa Black555-6790[email protected]PayPalShippedFEDX543216789
1006C001Alice BrownPR106Mouse12022-10-062022-10-10DHL123 Cedar StNew YorkNY10001555-1212[email protected]255S001John White555-6789[email protected]Credit CardDeliveredDHL789456321
1007C002Bob GreenPR107Printer12022-10-072022-10-11UPS456 Maple AveNew YorkNY10002555-2323[email protected]10010S002Lisa Black555-6790[email protected]PayPalDeliveredUPS123654789
1008C003Charlie SmithPR108Headphones22022-10-082022-10-12FedEx789 Oak DrNew YorkNY10003555-3434[email protected]14020S003Michael Blue555-6791[email protected]Bank TransferShippedFEDX987123654
1009C004David JohnsonPR109Speakers12022-10-092022-10-13DHL234 Pine StNew YorkNY10004555-4545[email protected]9015S001John White555-6789[email protected]Credit CardShippedDHL321654987
1010C005Emily BrownPR110Web Camera12022-10-102022-10-14UPS567 Birch BlvdNew YorkNY10005555-5656[email protected]405S002Lisa Black555-6790[email protected]PayPalProcessingUPS987321456

5. salesData

salesIDproductIDproductNamecustomerIDcustomerNamesalesDateamountquantityregionIDregionNamesalesRepIDsalesRepNamecommissiontaxdiscounttotalRevenuepaymentMethodinvoiceIDinvoiceDateinvoiceAmountsalesStatusregionManagerregionPhoneregionEmail
2001PR101LaptopC001Alice Brown2022-10-0112001R001NorthS001John White100100501150Credit CardINV10012022-10-021200CompletedDavid Grey555-1212[email protected]
2002PR102SmartphoneC002Bob Green2022-10-0216002R002EastS002Lisa Black1501501001550PayPalINV10022022-10-031600CompletedEmma White555-2323[email protected]
2003PR103TabletC003Charlie Smith2022-10-0318003R003SouthS003Michael Blue2002001501700Bank TransferINV10032022-10-041800CompletedJohn Brown555-3434[email protected]
2004PR104MonitorC004David Johnson2022-10-045002R001NorthS001John White505025475Credit CardINV10042022-10-05500In ProgressDavid Grey555-1212[email protected]
2005PR105KeyboardC005Emily Brown2022-10-05501R002EastS002Lisa Black1010545PayPalINV10052022-10-0650CompletedEmma White555-2323[email protected]
2006PR106MouseC001Alice Brown2022-10-06251R001NorthS001John White55223Credit CardINV10062022-10-0725CompletedDavid Grey555-1212[email protected]
2007PR107PrinterC002Bob Green2022-10-071001R002EastS002Lisa Black1010595PayPalINV10072022-10-08100CompletedEmma White555-2323[email protected]
2008PR108HeadphonesC003Charlie Smith2022-10-081402R003SouthS003Michael Blue202010130Bank TransferINV10082022-10-09140CompletedJohn Brown555-3434[email protected]
2009PR109SpeakersC004David Johnson2022-10-09901R001NorthS001John White1510585Credit CardINV10092022-10-1090In ProgressDavid Grey555-1212[email protected]
2010PR110Web CameraC005Emily Brown2022-10-10401R002EastS002Lisa Black55238PayPalINV10102022-10-1140CompletedEmma White555-2323[email protected]

Step 2: Documen

Create a new blog post documenting the entire process of:

    • Logging into MySQL via the command line.

      • Creating the database denormalized_db.

      • Defining the 5 tables (employeetbl, studenttbl, producttbl, ordertbl, salestbl).

      • Inserting the dummy data into each table.

  • Provide code snippets and brief explanations for each step.

  • Share the Hashnode link on the svfc portal once published.

Goal:

By completing this activity, you will have:

  • Created a MySQL database and defined 5 tables using the command line.

  • Inserted dummy data into each table.

  • Documented the process

38 views

More from this blog

T

Thirdy Gayares

99 posts

Software Engineer | Mobile Developer | Data Scientist