站内搜索: 请输入搜索关键词
当前页面: 图书首页 > MySQL Tutorial

MySQL Tutorial

[ Directory ] Previous Section Next Section

Exercises

1:

Write SQL statements to create a database with the following schema:

customer(customerID, customerName, customerAddress)

order(orderID, orderDate, graphics/04inl05.gif)

orderItem(graphics/04inl06.gif, graphics/04inl07.gif, itemQuantity)

item(itemID, itemName)

You may make any assumptions you like about data types.

Test your statements in MySQL and view the resulting tables using SHOW and DESCRIBE.

2:

We would now like to add a notes field, which you may assume is of type TEXT, to each order in the orders table. Use an ALTER TABLE statement to achieve this, and check your result with a DESCRIBE statement.

3:

Drop the order database.


    [ Directory ] Previous Section Next Section