收藏 分享(赏)

cuisine烹调风格).doc

上传人:gnk289057 文档编号:6833683 上传时间:2019-04-23 格式:DOC 页数:2 大小:31.50KB
下载 相关 举报
cuisine烹调风格).doc_第1页
第1页 / 共2页
cuisine烹调风格).doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、Database Lab work assignment 1(1) Write an SQL database schema for your database, using the CREATE TABLE commands. Pick suitable datatypes for each attribute. Page 85 of the text gives you the principal options regarding types, but Oracle likes you to use VARCHAR2 for character strings. Show the res

2、ponse of sqlplus to a request to describe each of your relation schemas. For example, to see the schema for relation Foo type DESCRIBE Foo;(2) Execute some INSERT commands to insert tuples into one of your relations. Show the response of sqlplus and the relation that results when you issue a SELECT

3、* command. (3) When writing a program to fabricate data, there are two important points to keep in mind: Although you have not (yet) declared keys in your relations, in many cases you probably know that an attribute or set of attributes in a relation will serve as a key. If so, be sure not to genera

4、te duplicate values for these attributes. Your database almost certainly includes relations that are expected to join with each other. For example, you may have a Student relation with attribute courseNo thats expected to join with attribute number in relation Course. In generating data, be sure to

5、generate values that actually do join-otherwise all of your interesting queries will have empty results! Problem Set1. Consider a database with the following relations: Dish盘菜 (food 食物, cuisine 烹调风格)Ingredients成分表 (food 食物, ingredient 成分, quantity 数量)ShoppingList采购表 (cuisine 烹调风格, ingredient 成分, qua

6、ntity数量)卡路里表 Calories (ingredient成分, quantity 数量, calories卡路里)Write the following queries. (a) Find the foods that include more than 16 units of butter. (b) Find the cuisines that use cumin as an ingredient (in at least one dish). (c) Change the ingredients for foods so that they include no more tha

7、n 16 units of butter. (If they already include more than 16 units of butter, then change it to 16 units of butter.) (d) Remove beef from all Indian (cuisine) dishes. (e) Create a summary table, ShoppingList that contains the total quantity of each ingredient used by all the dishes for each cuisine.

8、(f) For each dish, set the number of calories equal to the total number of calories for the entire dish. Note that the quantity in relation Calories need not match the quantity in Ingredients, so you need to compute calories per unit2. Consider a database with the following relations: Cars (license,

9、 owner, model)Motorcycle (license, owner, model)Ownership(owner, numberOfCars, numberOfMotorcycles)Write the following queries. (a) List people who own a car but do not own a motorcycle. (b) List people who own a car and also own a motorcycle. (c) List people who own a car but do not own a motorcycle. (d) List the number of cars owned by each person.

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报