More SQL
Introduction
We'll be working with data manipulation with your own databases and the WORLD database which can be downloaded here.
Questions
Using the tables created in the last session:
- Try to insert data when no columns are specified (i.e. you have to enter a value for each column)
- Try to insert data for some of the columns
1. Try to insert data excluding a column that is defined as NOT NULL and see if MySQL allows it
2. Try to insert data excluding the PK and see if MYSQL allows it - Create a table similar to the first table and try coping all the data from the original table using the INSERT command
- Delete data with some conditions from the table
- Update the data using some conditions
Using the WORLD database, create different reports from the available tables:
- With no condition
- With a single condition
- With multiple conditions using AND
- With multiple conditions using OR
- Order the result based on different attributes in ascending order
- Order the result based on different attributes in descending order
- By grouping a single field
- By grouping multiple fields
- By grouping a field and having a condition
- By grouping multiple fields and having a condition
- By using a wild card (* , %)
- By use of LIKE, IS NULL