北美微论坛

App下载
扫码下载 App
联系我们
1框架
查看: 550|回复: 3
打印 上一主题 下一主题

[CS/EE] sql 大神请进

[复制链接]

小学生

Rank: 1

跳转到指定楼层
楼主
发表于 2014-12-8 22:06:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
final 来了  老师给的复习题不会肿么办? 求各位学霸帮忙。
1.Create a table Movie_Stars, which has the following columns:
Movie Number           numeric
Movie Title                varying character        25  
        Year Released           date and time              (required)
        First Name                varying character        15      
        Last Name                varying character               15
Be sure that the movie_number column is used as a way to uniquely identify a particular movie.

2.A) WITHOUT recreating the table again, add the column Movie_Category
      varying character 15 to the Movie_Stars table.

B) Make the movie_Category be required.  You MUST present two different         solutions for this part of the question)

3.Create a sequence, which starts with 10 and goes 10 numbers at a time.  Make sure that your sequence does not cache any values. e.g. 10,20,30….

4.Write the SQL statement to insert the following row into the Movie_Stars table structure:

The row values are:
Sequence #, New York Stories, January 1 1984, Nolte, Nick, Drama
Sequence #, Speed, 1999, FEB 12, Keanu, Reeves, Action
Sequence #, Bowfinger, 2001, August 03, Eddie, Murphy, Comedy

Make sure that you use the sequence you created in question 3 above to assign the sequence numbers to the three records.

收藏收藏 分享分享 赞赞赞!赞赞赞! 踩踩踩!踩踩踩! 新浪微博微博分享
回复

使用道具 举报

博士后

Rank: 7Rank: 7Rank: 7

沙发
发表于 2014-12-8 22:25:26 | 只看该作者
你有ERwin 吗,我都是先在ERwin create the table then forward engineer to SQL.
第一个问题你就把Movie_Number 设成primary key 就好了, 2A 直接加在原来的table 就好了,2B 是设置问题而已
3 你的话,你自己把data 放到SQL 上,我都是在ERwin 弄好table, forward the SQL 上,再用
INSERT INTO MOVIE_STARS_t (MovieNumber, MovieTitle.......)...
4 把data弄上去以后就可以写4的statements 啦
回复

使用道具 举报

高级院士

子涵子涵

Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15

常驻居民最佳新人

板凳
发表于 2014-12-9 06:39:54 | 只看该作者
楼主。。。我只想说这些难道不是SQL的基本语法么?????你随便百度一下都能出现类似的
回复

使用道具 举报

研究生

Rank: 5Rank: 5

地板
发表于 2014-12-9 11:04:13 | 只看该作者
那么多人学数据库
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

返回顶部