Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assignment: MySQL Data Types Introduction: In this programming assignment, you will create a database table that implements various data types in MySQL. The goal

Programming Assignment: MySQL Data Types Introduction: In this programming assignment, you will create a database table that implements various data types in MySQL. The goal of this assignment is to demonstrate your understanding of different data types in MySQL, their characteristics, and how to use them effectively in database design. Requirements: Create a database in MySQL named "datatypes_db". Create a table named "datatype_table" in the "datatypes_db" database. The "datatype_table" table should have the following columns: a. id (INT) - primary key and auto-increment b. name (VARCHAR(255)) c. age (TINYINT) d. height (FLOAT(4,2)) e. weight (DOUBLE(6,2)) f. birth_date (DATE) g. graduated (BOOLEAN) h. hobby (ENUM('reading', 'traveling', 'gaming', 'sports')) Fill in the table with the following data: a. Name: 'John Doe', Age: 30, Height: 5.9, Weight: 170.5, Birth Date: 1990-12-30, Graduated: true, Hobby: 'reading' b. Name: 'Jane Doe', Age: 28, Height: 5.5, Weight: 145.0, Birth Date: 1992-11-20, Graduated: true, Hobby: 'traveling' c. Name: 'Jim Smith', Age: 35, Height: 6.2, Weight: 185.0, Birth Date: 1985-07-15, Graduated: true, Hobby: 'gaming' d. Name: 'Sarah Johnson', Age: 26, Height: 5.6, Weight: 130.0, Birth Date: 1994-03-10, Graduated: false, Hobby: 'sports' Write SELECT queries to retrieve the following information from the "datatype_table" table: a. All columns and data b. All data except for the id column c. Names, ages, and hobbies of all people in the table d. Names and weights of all people who graduated Write a query to update Sarah Johnson's hobby to 'reading'. Write a query to delete Jim Smith's record from the "datatype_table" table. Create a backup of the "datatype_table" table and save it as "datatype_table_backup". Submission: Submit your MySQL queries used to complete the above requirements. Also, include a screenshot of the output of the SELECT queries for verification purposes.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions