SQL Introduction
Try to solve the following questions:
- Create a database and call it MyFirstPractice
- Create a table and call it MyFirstTable
- Try defining several attributes with different attribute type
- Try defining primary keys differently, by adding the PRIMARY KEY keyword in front of the field name and also by defining a constraint for a primary key
- Try defining a table that has a composite attribute and define the primary key by adding PRIMARY KEY in front of the fields
- When you are comfortable with CREATE TABLE, try to create the table graphically. (Right click on your database name and choose create table)
- Using the ALTER TABLE command:
1. Add a column
2. Add a column after specific column
3. Delete a column
4. Rename table name
5. Drop a primary key
6. Add a primary key
7. Modify the definition of a column
8. Modify the definition of column, drop primary key and rename table at the same time - Repeat the above for several fields
- Drop the table
- Drop the database