1. You are creating a database named NewDB. The database uses the server's default character. What SQL statement should you use to create the database? 2. You are creating a table in a MYSQL database from previous number. The table is named Bikes and includes two columns: BikelD and BikeName. The BikelD column must uniquely identify each row in the table, and values must be automatically assigned to each row. The BikeName column must include a descriptive name for each model of bike. The names vary in length but should never exceed 40 characters. What SQL statement should you use to create the table? 3. Write a SQL statement to insert the given data into the table countries against each column. Id Country Malaysia 1 2 Thailand 3 Mongolia Georgia Turkmenistan 4 5 6 Philippines 7 Israel Here in the following is the structure of the table "countries". | Field I Type | Null | Key | Default | Extra | | COUNTRY_ID | COUNTRY_NAME | varchar(40) | VES I | VES I varchar(2) | MULL NULL

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

SUBJECT/TOPIC: MySQL Database Management System (xampp)

PLEASE ANSWER THIS WITH COMPLETE EXPLANATION AND SOLUTION. 

ASSESSMENT TASK MySQL Database Management System (xampp)

1. You are creating a database named NewDB. The database uses the server's
default character. What SQL statement should you use to create the database?
2. You are creating a table in a MYSQL database from previous number. The table is
named Bikes and includes two columns: BikelD and BikeName. The BikelD
column must uniquely identify each row in the table, and values must be
automatically assigned to each row. The BikeName column must include a
descriptive name for each model of bike. The names vary in length but should
never exceed 40 characters. What SQL statement should you use to create the
table?
3. Write a SQL statement to insert the given data into the table countries against each
column.
Id
Country
1 Malaysia
2
Thailand
3
Mongolia
4
Georgia
5
Turkmenistan
95
6 Philippines
7
Israel
Here in the following is the structure of the table "countries".
| Field
1 Туре
| Null | Key | Default | Extra |
| COUNTRY_ID
COUNTRY_NAME | varchar(40)
| varchar(2)
| VES I
YES |
NULL
NULL
Transcribed Image Text:1. You are creating a database named NewDB. The database uses the server's default character. What SQL statement should you use to create the database? 2. You are creating a table in a MYSQL database from previous number. The table is named Bikes and includes two columns: BikelD and BikeName. The BikelD column must uniquely identify each row in the table, and values must be automatically assigned to each row. The BikeName column must include a descriptive name for each model of bike. The names vary in length but should never exceed 40 characters. What SQL statement should you use to create the table? 3. Write a SQL statement to insert the given data into the table countries against each column. Id Country 1 Malaysia 2 Thailand 3 Mongolia 4 Georgia 5 Turkmenistan 95 6 Philippines 7 Israel Here in the following is the structure of the table "countries". | Field 1 Туре | Null | Key | Default | Extra | | COUNTRY_ID COUNTRY_NAME | varchar(40) | varchar(2) | VES I YES | NULL NULL
1. You are creating a SELECT statement that retrieves data from the CDs
table. Your query results should include values from the CDName, InStock,
OnOrder, and Reserved columns. In addition, the results should include all
rows in the table. What SELECT statement should you create?
2. You want to modify the SELECT staternent that you created in Assessment
No. 1 so that the result set includes an additional column. The column
should add the values of the InStock and OnOrder columns and then
subtract the value in the Reserved column. You want to assign the Total
alias to the new column. What SELECT statement should you create?
3. Your next step is to modify the SELECT statement that you created in
Assessment No. 2. You plan to limit the rows returned to those rows that
121
have a Department value of Classical and an InStock value less than 20.
What SELECT statement should you create?
4. You now want to create a SELECT statement that summarizes data in the
CDs table. The result set should include data that is grouped together by
the Department column and then by the Category column. The summary
information should include the number of rows for each category, as well as
totals for all categories in each department. In addition, the summary
column in the result set should be assigned the alias Total, and all grouped
columns should be sorted in ascending order. What SELECT statement
should you create?
5. You now want to modify the SELECT statement that you created in
Assessment No. 4 to limit the rows returned to those with a Total value less
than 3. What SELECT statement should you create?
6. You are creating a SELECT statement that retrieves data from the CDs
table. Your query results should include values from the CDName column.
The values should be sorted in descending order. What SELECT statement
should you create?
Transcribed Image Text:1. You are creating a SELECT statement that retrieves data from the CDs table. Your query results should include values from the CDName, InStock, OnOrder, and Reserved columns. In addition, the results should include all rows in the table. What SELECT statement should you create? 2. You want to modify the SELECT staternent that you created in Assessment No. 1 so that the result set includes an additional column. The column should add the values of the InStock and OnOrder columns and then subtract the value in the Reserved column. You want to assign the Total alias to the new column. What SELECT statement should you create? 3. Your next step is to modify the SELECT statement that you created in Assessment No. 2. You plan to limit the rows returned to those rows that 121 have a Department value of Classical and an InStock value less than 20. What SELECT statement should you create? 4. You now want to create a SELECT statement that summarizes data in the CDs table. The result set should include data that is grouped together by the Department column and then by the Category column. The summary information should include the number of rows for each category, as well as totals for all categories in each department. In addition, the summary column in the result set should be assigned the alias Total, and all grouped columns should be sorted in ascending order. What SELECT statement should you create? 5. You now want to modify the SELECT statement that you created in Assessment No. 4 to limit the rows returned to those with a Total value less than 3. What SELECT statement should you create? 6. You are creating a SELECT statement that retrieves data from the CDs table. Your query results should include values from the CDName column. The values should be sorted in descending order. What SELECT statement should you create?
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education